Base Configuration
Base URL
Section titled “Base URL”OdiRouter LLM endpoints use the unified /v1 prefix:
https://odirouter.ai/v1Authentication
Section titled “Authentication”Authentication uses the Authorization: Bearer header:
Authorization: Bearer {apiKey}Common headers
Section titled “Common headers”| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer {apiKey} |
Content-Type | Recommended for POST requests | Public POST endpoints in this document use application/json |
X-Request-Id | No | Caller-defined request ID. The platform generates one automatically if omitted |
SDK configuration
Section titled “SDK configuration”from openai import OpenAI
client = OpenAI( api_key="YOUR_API_KEY", base_url="https://odirouter.ai/v1",)import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.ODIROUTER_API_KEY, baseURL: "https://odirouter.ai/v1",});Path rules
Section titled “Path rules”- Set the OpenAI SDK
base_urltohttps://odirouter.ai/v1. - The full Responses API address is
https://odirouter.ai/v1/responses. - Do not expose the API key in browser code or
NEXT_PUBLIC_*variables; keep keys on the server.