Everything you need to integrate D Route. Designed to mirror the OpenAI Chat Completions API — so your existing code just works.
All requests need a Bearer token in the Authorization header. Generate a key from the dashboard.
Keys are scoped per project. Rotate or revoke any time. Never commit keys to git — use environment variables.
All endpoints use the same base. Replace YOUR_KEY in code samples with the value from your dashboard.
This example uses the OpenAI Python SDK with auto routing — D Route picks the best model for the prompt.
Standard chat-completions endpoint, OpenAI-compatible.
| Field | Type | Description |
|---|---|---|
model | string | Model ID (e.g. gpt-4o, claude-3-5-sonnet, auto) |
messages | array | List of {role, content} messages |
stream | boolean | Enable SSE streaming (default false) |
temperature | number | Sampling temperature 0–2 |
max_tokens | integer | Stop after N tokens |
tools | array | Function-calling tool definitions |
Set stream: true and use the SDK's iterator. Tokens arrive in <50ms chunks.
Send an image URL or base64 data — supported on every vision model.
Define functions as tools; the model returns tool_calls with arguments you dispatch.
Returns the live list of models on D Route with availability and capability flags.
OpenAI-compatible embeddings endpoint. Currently powered by top embedding models from OpenAI, Voyage and BGE.
Works with the official OpenAI SDKs in Python, Node, Go, Java, .NET and Ruby. Just change base_url.
No SDK — use raw HTTP. POST JSON, parse the SSE stream line by line.