Dagon InferenceDocs Console

API

Chat Completions

OpenAI Chat Completions. Point an OpenAI SDK at https://inference.dagon.so/v1 and call it as usual.

On this page

Request

POST/v1/chat/completions

curl https://inference.dagon.so/v1/chat/completions \
  -H "Authorization: Bearer $DAGON_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "abliterated-model-large-flash",
    "messages": [{"role": "user", "content": "Explain this stack trace."}],
    "max_tokens": 1024
  }'

Forwarded fields

Only documented fields whose cost the meter can see are forwarded: model, messages, max_tokens, max_completion_tokens, n, stream, stream_options, temperature, top_p, stop, presence_penalty, frequency_penalty, logit_bias, logprobs, top_logprobs, seed, response_format, tools, tool_choice, parallel_tool_calls, functions, function_call, reasoning_effort, verbosity, prompt_cache_key, store, metadata, user, safety_identifier. Any other non-null field is 400 unsupported_parameter (null fields are dropped).

  • Output cap. max_completion_tokens wins over max_tokens, and only the checked one is forwarded. Without either, 16,384 is written for you.
  • n: 1 to 8, chat only. It multiplies the hold.
  • Tools. Only client-executed function (or custom) tools. tool_choice may be none, auto, required or name one of the request's own functions.
  • Images. image_url parts with a data:image/…;base64, URL or an http(s) URL, on models whose input_modalities include image.

Not available

Server-run tools (web search, code execution, file search, MCP, image generation), audio output, prediction, service_tier and content stored upstream (file_id) are refused: none can be priced per token. Web search is 400 web_search_not_supported.

Response

The provider's OpenAI-format body, unchanged, with these headers added:

HeaderValue
x-gateway-request-idThe gateway's id for this request; quote it to support.
x-gateway-receipt-idThe receipt id; fetch it at GET /v1/receipts/:id.
x-gateway-receiptNon-streaming only: the signed receipt itself, base64url JSON.

Reading headers with the SDKs:

raw = client.chat.completions.with_raw_response.create(
    model="abliterated-model-large-flash", messages=[{"role": "user", "content": "Hi"}], max_tokens=200,
)
print(raw.headers.get("x-gateway-receipt-id"))
reply = raw.parse()

Last updated