Dagon InferenceDocs Console

API

Anthropic Messages

Anthropic Messages at /v1/messages. Anthropic SDKs take the bare origin https://inference.dagon.so as base URL (no /v1); errors on this endpoint use the Anthropic error shape.

On this page

Request

POST/v1/messages

curl https://inference.dagon.so/v1/messages \
  -H "x-api-key: $DAGON_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model": "abliterated-model-large-flash", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'

Forwarded fields

model, messages, max_tokens, system, stop_sequences, stream, temperature, top_p, top_k, tools, tool_choice, thinking, metadata. Anything else non-null is 400 unsupported_parameter.

  • max_tokens is required (400 missing_max_tokens), at most 65,536 or the model's limit.
  • tool_choice may be {type: "auto" | "any" | "none"} or {type: "tool", name} naming one of the request's tools. Server tools (web search, web fetch, code execution, MCP) are refused.
  • No anthropic-beta value is accepted: any beta is 400 unsupported_parameter. container, context_management, mcp_servers and file sources are refused too.
  • Images: image blocks with a base64 source.

Count tokens

POST/v1/messages/count_tokens

Free. Validated like /v1/messages and answered {"input_tokens": n}. It needs a key with credit available (402 insufficient_credits otherwise) and is limited to 600 calls per hour and 2 in flight per account. Counting is served by abliteration.ai, so a model it does not serve on Messages is 400 unsupported_endpoint.

curl
curl https://inference.dagon.so/v1/messages/count_tokens \
  -H "x-api-key: $DAGON_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "abliterated-model-large-flash", "messages": [{"role": "user", "content": "Hello"}]}'

Last updated