Quotaflow
llms.txtOpenAPIDashboard
Protocol Surfaces

Anthropic-compatible Messages

When to use this page

Use this page when your client expects the Anthropic Messages API shape.

Base URL

https://api.quotaflow.ai

Endpoint

POST https://api.quotaflow.ai/v1/messages

Supported models

Your API key decides your Claude line. Each Claude key is assigned exactly one line, and the line decides the model-id prefix the key uses, the response identity it receives, and the supply that serves it. You cannot switch lines by changing the prefix: send the prefix of your key's line, or the bare id.

Your key's linePrefix to sendResponse identity
Anthropicanthropic/claude-*Anthropic: msg_01... message ids, toolu_01... client-tool ids
Anthropic Enterpriseanthropic-enterprise/claude-*Anthropic: msg_01... message ids, toolu_01... client-tool ids
AWS Bedrockaws-bedrock/claude-*AWS Bedrock: msg_bdrk_... message ids, toolu_bdrk_... client-tool ids
AWS Bedrock Enterpriseaws-bedrock-enterprise/claude-*AWS Bedrock: msg_bdrk_... message ids, toolu_bdrk_... client-tool ids
Claude Codeanthropic/claude-* (this line has no prefix of its own)Anthropic: msg_01... message ids, toolu_01... client-tool ids

To see the exact ids your key may send, call GET /v1/models (or GET /openai/v1/models) with that key. Authenticated model discovery lists only your key's line, so the ids it returns are the ids to use. A request that spells another line's prefix is refused with 403; a prefix that is not one of the prefixes above, such as a misspelling, is refused as an unknown model with 404, whose message tells you to call GET /v1/models for the models the key can request.

A bare id such as claude-opus-4-8 is accepted on every key and follows the key's line. On an AWS Bedrock Enterprise key, the aws-bedrock/claude-* spelling also stays accepted and is served on the key's own enterprise line, because that was the line's spelling before it had its own prefix; model discovery lists only the aws-bedrock-enterprise/claude-* ids.

All Claude lines use the same key-scoped, capability-verified scheduling rules. The anthropic/ and aws-bedrock/ lines share one managed supply pool, where the assigned prefix controls the customer-visible response contract and not the upstream vendor selected for a request. The anthropic-enterprise/ and aws-bedrock-enterprise/ lines are served only by the enterprise supply assigned to them, and that supply serves no other line; the one exception is Quotaflow's own first-party supply, which can serve the enterprise lines while still serving the others. An enterprise line has platform fallback only when that first-party supply is assigned to it. The response model is the bare canonical Claude id without the routing prefix. For every completed message, Quotaflow generates the public message id before the first response byte from that selected customer projection; it is opaque and does not reveal or preserve an upstream message id. A managed supplier may make an internal fallback decision, but it cannot change the requested public model, message-id profile, or add fallback/provider narration to the response. Tool definitions and tool_use_id result references are projected together so their relationship remains intact. Documented cache and thinking-token details are retained when supplied with valid public values; Anthropic-only service_tier and inference_geo fields are omitted from the AWS Bedrock projection. Provider headers, hosts, account metadata, route details, and upstream request ids are not exposed on any projection. The request and event schema at /v1/messages remains Anthropic-compatible on every line.

Enterprise lines

Each enterprise prefix selects a separate supply line while keeping the documented response identity of its base line:

The response contract, message-id shape, and provider-metadata sanitization of an enterprise line are identical to its base line, and the request must still match your key's line: an anthropic-enterprise key may send anthropic-enterprise/claude-*, an aws-bedrock-enterprise key may send aws-bedrock-enterprise/claude-*, and a key on any other line is refused either enterprise prefix.

Availability is evaluated per key and request shape, so /models is authoritative.

Claude model ids by line

The table shows every line's public id for each reviewed model. A single key's /models returns only its own line's column.

ModelAnthropicAnthropic EnterpriseAWS BedrockAWS Bedrock Enterprise
Fable 5anthropic/claude-fable-5anthropic-enterprise/claude-fable-5aws-bedrock/claude-fable-5aws-bedrock-enterprise/claude-fable-5
Fable 5.1anthropic/claude-fable-5.1anthropic-enterprise/claude-fable-5.1aws-bedrock/claude-fable-5.1aws-bedrock-enterprise/claude-fable-5.1
Sonnet 5.5anthropic/claude-sonnet-5.5anthropic-enterprise/claude-sonnet-5.5aws-bedrock/claude-sonnet-5.5aws-bedrock-enterprise/claude-sonnet-5.5
Sonnet 5anthropic/claude-sonnet-5anthropic-enterprise/claude-sonnet-5aws-bedrock/claude-sonnet-5aws-bedrock-enterprise/claude-sonnet-5
Opus 5.5anthropic/claude-opus-5.5anthropic-enterprise/claude-opus-5.5aws-bedrock/claude-opus-5.5aws-bedrock-enterprise/claude-opus-5.5
Opus 5anthropic/claude-opus-5anthropic-enterprise/claude-opus-5aws-bedrock/claude-opus-5aws-bedrock-enterprise/claude-opus-5
Opus 4.8anthropic/claude-opus-4.8anthropic-enterprise/claude-opus-4.8aws-bedrock/claude-opus-4.8aws-bedrock-enterprise/claude-opus-4.8
Opus 4.7anthropic/claude-opus-4.7anthropic-enterprise/claude-opus-4.7aws-bedrock/claude-opus-4.7aws-bedrock-enterprise/claude-opus-4.7
Opus 4.6anthropic/claude-opus-4.6anthropic-enterprise/claude-opus-4.6aws-bedrock/claude-opus-4.6aws-bedrock-enterprise/claude-opus-4.6
Opus 4.5anthropic/claude-opus-4.5anthropic-enterprise/claude-opus-4.5aws-bedrock/claude-opus-4.5aws-bedrock-enterprise/claude-opus-4.5
Sonnet 4.6anthropic/claude-sonnet-4.6anthropic-enterprise/claude-sonnet-4.6aws-bedrock/claude-sonnet-4.6aws-bedrock-enterprise/claude-sonnet-4.6
Sonnet 4.5anthropic/claude-sonnet-4.5anthropic-enterprise/claude-sonnet-4.5aws-bedrock/claude-sonnet-4.5aws-bedrock-enterprise/claude-sonnet-4.5
Haiku 5.5anthropic/claude-haiku-5.5anthropic-enterprise/claude-haiku-5.5aws-bedrock/claude-haiku-5.5aws-bedrock-enterprise/claude-haiku-5.5
Haiku 4.5anthropic/claude-haiku-4.5anthropic-enterprise/claude-haiku-4.5aws-bedrock/claude-haiku-4.5aws-bedrock-enterprise/claude-haiku-4.5

Legacy unprefixed Claude ids remain accepted during migration and follow the key's line, but new integrations should use the prefixed ids returned by /models.

Extended thinking

Use the same Anthropic-compatible request fields your client already sends.

ModelRecommended thinking shape
claude-sonnet-5thinking: { "type": "adaptive" }; omit manual budget_tokens
claude-opus-4-8thinking: { "type": "adaptive" }
claude-opus-4-7thinking: { "type": "adaptive" }
claude-opus-4-6thinking: { "type": "adaptive" } or legacy manual thinking
claude-sonnet-4-6thinking: { "type": "adaptive" } or legacy manual thinking
claude-sonnet-4-5Standard Anthropic-compatible thinking fields when enabled for your key
claude-opus-4-5-20251101Standard Anthropic-compatible thinking fields when enabled for your key

For claude-sonnet-5, claude-opus-4-8, and claude-opus-4-7, adaptive thinking is the supported mode. Send thinking: { "type": "adaptive" } or omit the field to use the model default. Do not send legacy thinking: { "type": "enabled", "budget_tokens": ... } or thinking: { "type": "disabled" } for adaptive-only Claude models; Quotaflow rejects those request shapes with a customer-terminal 400. Streaming responses preserve the Anthropic-compatible SSE event shape.

Route-aware request transport

Quotaflow owns the provider transport selected by your key and model namespace. You do not need to add anthropic-version to a Quotaflow request. Anthropic SDKs may still send anthropic-version: 2023-06-01; it is accepted as compatibility metadata, while Quotaflow constructs the actual provider request itself.

For anthropic/*, send beta opt-ins in the native anthropic-beta header. For aws-bedrock/* and aws-bedrock-enterprise/*, Quotaflow also accepts the Bedrock InvokeModel body forms "anthropic_version": "bedrock-2023-05-31" and "anthropic_beta": ["..."]. Those body fields are optional at the Quotaflow gateway. If present, the version must use the Bedrock value; body and header beta tokens are merged and deduplicated before dispatch. Bedrock body transport fields are not reinterpreted on an anthropic/* route. The selected customer namespace controls this adaptation even when the managed supplier pool contains different Claude resource origins.

The retired context-1m-* token is accepted for client compatibility but is not forwarded upstream and does not select or purchase a 1M context service. New integrations should remove that retired token. The effective context limit is determined by the requested model, request size, and availability for your key; Quotaflow never silently substitutes a smaller context tier because of this header.

Sampling controls on adaptive-only Claude models

For claude-sonnet-5, claude-opus-4-8, and claude-opus-4-7, do not send non-default temperature, top_p, or top_k. Those models use adaptive behavior instead of explicit sampling controls. Quotaflow strips those fields where possible before forwarding, but clients should omit them to match the model contract. Use prompting plus thinking: { "type": "adaptive" } for depth control.

Output configuration

Top-level output_config is an accepted request field. Quotaflow recognizes output_config.format.type=json_schema as a structured-output request and routes it only to supply with positive capability evidence. Other output_config members, including effort, remain provider-defined passthrough fields. An admitted field is forwarded; support is still model- and customer-line-specific, so an unsupported combination returns a customer-terminal 400 in the selected anthropic/* or aws-bedrock/* error vocabulary. In particular, AWS documents structured output for supported Claude models through Bedrock Runtime InvokeModel/Converse, not the Bedrock Anthropic Messages endpoint.

Streaming usage

Keep the usage reported in message_start and apply the cumulative usage in

message_delta. The opening output count is not the final output count, and

an opening zero is not proof that the request was free. Track

input_tokens, cache_creation_input_tokens, cache_read_input_tokens, and

output_tokens separately.

A stream is complete only after message_stop. If the connection closes

inside a content block, its tool input and final usage may be incomplete.

Do not treat that interruption as a successful, zero-cost response. An

estimated usage record in the console is distinct from an upstream-reported

final reading; a disconnected client cannot receive a final frame afterward.

Errors and request IDs

Non-streaming errors use the Anthropic-compatible envelope. The request-id response header and body request_id contain the same neutral Quotaflow gateway identifier on both projections. Quotaflow does not synthesize an AWS infrastructure request id:

{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "Invalid request"
  },
  "request_id": "req_..."
}

Quotaflow returns the standard error types for their matching HTTP status: invalid_request_error (400 and other unmapped 4xx), authentication_error (401), billing_error (402), permission_error (403), not_found_error (404), conflict_error (409), request_too_large (413), rate_limit_error (429), api_error (500-class service failures), timeout_error (504), and overloaded_error (529). Internal route, account, provider, credential, and upstream transport classifications are never returned as error types.

A request containing an empty text block ({"type":"text","text":""}) may return 400 with messages: text content blocks must be non-empty. Remove empty text blocks from the message history while preserving tool calls and their matching tool results. This specific validation message is preserved in both HTTP errors and terminal streaming error events.

One api_error names its cause. When a request asked for manual thinking (thinking.type: "enabled") and every model answer Quotaflow received was an empty thinking block with no answer text, Quotaflow refuses to deliver that answer, charges nothing, and returns 500 api_error with the message The model returned an empty thinking block and no answer text, and no usable answer was produced; nothing was charged for this request. Retrying later, or without manual thinking, is the usual remedy.

After a streaming response has started, an error is emitted as an Anthropic-compatible SSE event. Its data contains only the documented type and error fields; use the neutral request-id header for gateway correlation.

event: error
data: {"type":"error","error":{"type":"api_error","message":"The service is temporarily unavailable. Please try again later."}}

Fast mode routing

Send the optional X-QuotaFlow-Routing: fast header to start a new conversation on the capacity predicted to give the first answer soonest, choosing the most economical option among those within 15 % of the fastest. It changes routing order only: the model, every request parameter, the response and the price are unchanged, the header is never forwarded upstream, later turns of a conversation stay where their prompt cache is, and any other value is ignored. See Fast mode routing.

Curl

curl https://api.quotaflow.ai/v1/messages \
  -H "x-api-key: $QUOTAFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5",
    "max_tokens": 128,
    "messages": [
      { "role": "user", "content": "Return only: connected" }
    ]
  }'

Adaptive thinking curl

curl https://api.quotaflow.ai/v1/messages \
  -H "x-api-key: $QUOTAFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.8",
    "max_tokens": 1024,
    "thinking": { "type": "adaptive" },
    "messages": [
      { "role": "user", "content": "Solve this carefully, then give the final answer." }
    ]
  }'

SDK environment pattern

export ANTHROPIC_AUTH_TOKEN="$QUOTAFLOW_API_KEY"
export ANTHROPIC_BASE_URL="https://api.quotaflow.ai"

Quotaflow preserves the Anthropic-compatible request and response shape for downstream clients.