REST Endpoints

Here, you'll find an overview of Javelin's REST API, which enables you to work programmatically with the Javelin platform.

Authentication

All API requests to the Javelin Gateway require authentication. Typically, you'll do this with a combination of two headers:

  • X-Javelin-APIKey: Your personal Javelin API key, which authenticates you with the Javelin platform itself.

  • Authorization: Bearer <PROVIDER_API_KEY>: The API key for the downstream LLM provider (e.g., OpenAI). Javelin securely proxies this key to the provider.

AI Endpoints

  • POST /query/{routename}: To run a query against a specific, pre-configured route.

  • POST /chat/completions: An OpenAI-compliant endpoint ideal for conversational interfaces. Requires the X-Javelin-route header.

  • POST /embeddings: An OpenAI-compliant endpoint to generate embeddings for the text you provided. Requires the X-Javelin-route header.

  • POST /guardrail/{processor}/apply: To apply specific guardrails to the offered content. Supported processors include promptinjectiondetection, trustsafety, and lang_detector.

What's Next?

  • Use the SDK to work with these endpoints easily.

  • Use the CLI to manage your resources from your terminal.

Last updated