API reference

API

Same request shape as OpenAI. Different base URL and key

Base URL

All inference calls use https://inference.dahl.global/v1. Chat completions require Authorization: Bearer <API_KEY> and a key with an allocated token balance.

Chat completions

POST /v1/chat/completions is OpenAI-compatible. Send model and messages. Read assistant text from choices[0].message.content.

curl https://inference.dahl.global/v1/chat/completions \
  -H "Authorization: Bearer $DAHL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMaxAI/MiniMax-M2.7",
    "messages": [
      { "role": "user", "content": "Hello, Dahl!" }
    ]
  }'
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "..."
      }
    }
  ]
}

Streaming

Add "stream": true. Dahl forwards OpenAI SSE (data: {…} lines, ending with data: [DONE]). Prefer streaming for long completions so the client can render tokens as they arrive.

curl https://inference.dahl.global/v1/chat/completions \
  -H "Authorization: Bearer $DAHL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMaxAI/MiniMax-M2.7",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'

Responses (Codex / Agents SDK)

POST /v1/responses is a thin adapter over the same models as chat completions. Codex CLI and the OpenAI Agents SDK use this path by default. Send model and input (a string or item list). Read text from output_text or output[]. Streaming uses Responses SSE (response.created … response.completed) — there is no data: [DONE].

curl https://inference.dahl.global/v1/responses \
  -H "Authorization: Bearer $DAHL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMaxAI/MiniMax-M2.7",
    "input": "Hello, Dahl!"
  }'
{
  "id": "resp_…",
  "object": "response",
  "status": "completed",
  "model": "MiniMaxAI/MiniMax-M2.7",
  "output_text": "…",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        { "type": "output_text", "text": "…" }
      ]
    }
  ]
}

Point Codex at a custom provider id (dahl), not the built-in openai provider — otherwise Codex calls /v1/responses/compact, which this broker does not implement (local compact instead).

model = "MiniMaxAI/MiniMax-M2.7"
model_provider = "dahl"

[model_providers.dahl]
name = "Dahl"
base_url = "https://inference.dahl.global/v1"
env_key = "DAHL_API_KEY"
requires_openai_auth = false
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://inference.dahl.global/v1",
    api_key=os.environ["DAHL_API_KEY"],
)
r = client.responses.create(
    model="MiniMaxAI/MiniMax-M2.7",
    input="Hello, Dahl!",
)
print(r.output_text)

Using a coding tool? See the setup pages for OpenCode, VS Code and Hermes Agent.

Tools

MiniMax and DeepSeek Flash accept OpenAI-style tools / tool_choice on chat completions. Vision is not offered on current models. Always confirm that the model is currently listed in GET /v1/models before sending tool payloads.

Public endpoints

These do not need an API key:

  • GET /v1/models — live model IDs
  • GET /v1/status?window=1h|24h|7d|30d — recent uptime probes (default 24h)
  • GET /health — process health
  • GET /v1/auth/check-username?username=… — username availability

Errors

StatusMessageWhat to do
401Missing API token / invalid API tokenSend Authorization: Bearer with a current key
402available tokens exhaustedAllocate from the pool or top up
402this API key has N tokens and this request needs at least MThe key holds less than the prompt plus room for the answer. Allocate more from the pool or lower max_tokens
429too many signup/sign-in attemptsWait, then retry
429 model_concurrencyThis model is at concurrency capacity…The model is full right now. Retry after Retry-After or switch model (see below)
429 parallel_key_limit / parallel_user_limittoo many parallel requests…Too many requests at once on this key or account. Wait for in-flight requests to finish or lower concurrency
404This model is not currently offered (+ live IDs)Switch model to an id from the error or GET /v1/models
400… type has unsupported value "image_url"Current models do not accept images. Remove the image from the request; in chat clients start a new session so the image is not resent from history
405Method Not AllowedWrong path. Send POST to https://inference.dahl.global/v1/chat/completions; in clients set the base URL to https://inference.dahl.global/v1
502 / 503 / timeoutstemporary error on our side or overloadNot related to your key. Retry with short backoff

Priority at peak hours

When a model is at capacity, requests are admitted by account class: paid accounts first, then free accounts, then keys not linked to an account. Tokens on the key do not change the order. The first credited top-up makes the account paid.

Request limits

Requests outside these limits get 400 with the reason in error.message:

  • Up to 2048 messages in messages.
  • Up to 256 values in one enum inside a tool schema (tools[].function.parameters).
  • JSON nesting depth up to 32.
  • Every tool message carries the tool_call_id of the call it answers.
  • Text only: image_url content parts are rejected.
  • Some non-standard parameters (for example max_input_tokens) are rejected; the error names the parameter.