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)

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
429too many signup/sign-in attemptsWait, then retry
400This model is not currently offered (+ live IDs)Switch model to an id from the error or GET /v1/models
503 / timeoutsnetwork or node overloadRetry with short backoff