POST https://api.naga.ac/v1/messages accepts the Anthropic Messages format and serves every chat model in the catalog, whichever company made it. Point the Anthropic SDK at https://api.naga.ac, without /v1. The key works as x-api-key, the SDK default, or as Authorization: Bearer.
Fields, headers and errors
Claude Sonnet 5.5 and the other Claude 5 models think by default, as in Anthropic’s API. Socontent can open with a thinking block whose text is empty. Read the answer from the text blocks, as the examples above do, rather than from content[0].
max_tokens is required, as in the official API. A system message in the middle of the conversation may hold text only, and any other block in it fails with 400. The anthropic-version and anthropic-beta headers have no effect, so you can leave them out.
Errors use Anthropic’s error types by status: authentication_error for 401, billing_error for 402, not_found_error for 404, rate_limit_error for 429. See Errors.
Structured output
output_config.format with {"type": "json_schema", "schema": {...}} asks for JSON that matches the schema. The JSON comes back in the first text block. See Structured outputs.
Prompt caching
cache_control works at the top level and on tools, system text blocks and message blocks, as in the official API. The usage of the response reports the write in cache_creation_input_tokens and the read in cache_read_input_tokens. See Prompt caching.
NagaAI additions
routingin the body and thex-naga-routing-strategyheader, see Routing.fallbacks, the models to try whenmodelcan’t answer, in Anthropic’s shape, see Fallback models.imageblocks in the response from models that draw.search_context_sizeandexternal_web_accesson the web search tool, see Web search.
Ignored and refused fields
service_tier,container,mcp_servers,context_management,inference_geoandthinking.display.is_errorontool_resultblocks. Say that the tool failed in the result text.- Audio blocks fail with
400. POST /v1/messages/count_tokensand the batches API return404.