Connecting
Integration
Connect any OpenAI-compatible client to
https://your-gateway.example.com/v1Connection
Use these values in any OpenAI-compatible client.
Base URL
—
Model
deepseek-v4.1-flash
Authentication
Authorization: Bearer <gateway key>
Protocol
OpenAI Chat Completions · SSE streaming
Payload cap
—
Models
Requests for any model id are served by the active model; this is the canonical id.
Loading model metadata…
Examples
Copy-paste snippets for common OpenAI-compatible clients.
POST /v1/chat/completions
curl https://your-gateway.example.com/v1/chat/completions \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}'Endpoints
Public routes served by the gateway.
| Method | Path | Description |
|---|---|---|
| POST | /v1/chat/completions | Chat completions (streaming, tools, vision, reasoning) |
| GET | /v1/models | OpenAI-compatible model list |
| GET | /health | Liveness probe |
| GET | /status | Queue and upstream status JSON |
OpenAI compatibility
What is translated and preserved.
- Chat completions. system/developer, user, assistant and tool messages are normalized and forwarded.
- Streaming. SSE with OpenAI chat.completion.chunk events, usage and data: [DONE].
- Vision. image_url parts as data URLs, base64 or https URLs are translated to the provider's image blocks.
- Tool calling. OpenAI tools/tool_choice are translated; tool_calls and tool results round-trip.
- Reasoning. reasoning_effort or thinking enables reasoning; reasoning_content is returned in messages and deltas.
- Usage. Input, output and cached prompt tokens are reported, including on streamed responses.
- Errors. Standard OpenAI error objects with provider status codes preserved.
Operational notes
Behaviour worth knowing when integrating.
The gateway keeps a strict FIFO queue and holds one upstream request at a time, so concurrent clients never see provider concurrency errors. Excess latency is queue wait, visible per request.
Provider fair-use 429 responses pause the lane for the advertised Retry-After; queued requests resume automatically and the affected request is retried.
n > 1 is not supported and returns a clear error. Sampling penalties and logprobs are accepted but not forwarded. Remote image URLs and base64/data-URL images are both supported.
The upstream provider key is held server-side only; clients authenticate exclusively with the gateway bearer token.