API reference
Build in three minutes.
The API is OpenAI-compatible. Keep your SDK, change the base URL and the model id. An Anthropic-compatible Messages endpoint is available on the same base URL.
Quickstart
- Create an account and top up credits.
- Create an API key on the dashboard. Copy it once — it is not shown again.
- Set
base_urltohttps://dreaminference.com/v1. - Send a chat completion.
curl https://dreaminference.com/v1/chat/completions \
-H "Authorization: Bearer $UNBOUND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash-1017",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}'from openai import OpenAI
client = OpenAI(
base_url="https://dreaminference.com/v1",
api_key="di_live_..."
)
resp = client.chat.completions.create(
model="glm-5.3-flash",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)Authentication
Send your key as a bearer token. The x-api-key header is also accepted for compatibility with Anthropic clients.
Authorization: Bearer di_live_...Chat completions
POST /v1/chat/completions accepts the standard OpenAI body: model, messages, stream, temperature, max_tokens, tools. Streaming uses Server-Sent Events and ends with data: [DONE].
Response headers
x-request-id — use this when contacting support.
x-ratelimit-remaining-requests, x-ratelimit-reset-requests — present on 429 responses.
Anthropic-compatible endpoint
Point an Anthropic SDK at the same base URL. The gateway accepts /v1/messages and maps the request to the selected model. Claude Code and other Anthropic clients work with the same key.
from anthropic import Anthropic
client = Anthropic(
base_url="https://dreaminference.com/v1",
api_key="di_live_..."
)
msg = client.messages.create(
model="kimi-k3.1-pro",
max_tokens=512,
messages=[{"role": "user", "content": "Hello"}],
)Models
GET /v1/models returns the catalog with context limits and per-token prices. The model id is stable; the underlying provider can change without changing your code.
curl https://dreaminference.com/v1/models -H "Authorization: Bearer $UNBOUND_API_KEY"Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | Missing, revoked or unknown key |
| 402 | insufficient_credit | Top up to continue |
| 404 | model_not_found | Model is not enabled |
| 429 | rate_limit_exceeded | Slow down and retry with backoff |
| 502 | upstream_error | The model provider failed; not charged |
| 503 | upstream_unavailable | No healthy route; retry |
Rate limits
New accounts start at 60 requests per minute and 3 concurrent requests. Limits rise with lifetime spend. A 429 includes retry-after; use exponential backoff with jitter.