Integration Overview
The Vexrail API is fully compatible with the OpenAI chat completions format. If your AI application already uses an OpenAI-compatible SDK, integration requires minimal changes -- you update the base URL and add authentication headers.
Base URL
https://api.vexrail.com/v1
Authentication Headers
Every API request requires two custom headers:
| Header | Value |
|---|---|
x-publishable-key | Your publishable key (pk_live_...) |
x-secret-key | Your secret key (sk_live_...) |
Conversation Tracking
To maintain conversation context, include an additional header:
| Header | Value |
|---|---|
x-conversation-id | A unique identifier for the conversation session |
The conversation ID groups messages into a single conversation thread. This is important for:
- Contextual ad relevance (understanding the full conversation).
- Conversation analytics in your dashboard.
Use a UUID or any unique string that persists across messages in the same conversation.
How It Works
- Your application sends a chat completion request to
https://api.vexrail.com/v1/chat/completions. - Vexrail forwards the request to the underlying LLM.
- If monetization is enabled, Vexrail may include contextual product recommendations in the response.
- The response is returned to your application in the standard OpenAI format.
Your application does not need to handle ad logic. Promotions are woven into the AI response naturally when relevant.
Supported SDKs
Vexrail works with any OpenAI-compatible SDK. We provide integration guides for:
- OpenAI SDK (JavaScript/TypeScript and Python)
- LangChain (JavaScript/TypeScript and Python)
- Vercel AI SDK (JavaScript/TypeScript)
- OpenRouter (JavaScript/TypeScript and Python)
Supported Features
| Feature | Supported |
|---|---|
| Chat completions | Yes |
| Streaming (SSE) | Yes |
| Non-streaming (JSON) | Yes |
| Model selection | Yes |
| List models | Yes |
Available Models
You can list available models by calling the models endpoint. The response follows the OpenAI models list format.
Next Steps
Choose your SDK and follow the integration guide: