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

  1. Create an account and top up credits.
  2. Create an API key on the dashboard. Copy it once — it is not shown again.
  3. Set base_url to https://dreaminference.com/v1.
  4. Send a chat completion.
bash
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
  }'
python
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.

http
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.

python
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.

bash
curl https://dreaminference.com/v1/models -H "Authorization: Bearer $UNBOUND_API_KEY"

Errors

StatusCodeMeaning
401invalid_api_keyMissing, revoked or unknown key
402insufficient_creditTop up to continue
404model_not_foundModel is not enabled
429rate_limit_exceededSlow down and retry with backoff
502upstream_errorThe model provider failed; not charged
503upstream_unavailableNo 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.