{"openapi": "3.1.0", "info": {"title": "Dyadic Anthropic-Compatible API", "version": "1.2.0", "description": "Anthropic's Messages API on Dyadic: point an Anthropic SDK (or any client of Anthropic's API, Claude Code included)\nat `https://api.dyadic.app/anthropic` with a Dyadic API key, sent as `x-api-key` or `Authorization: Bearer`. Requests run on\nthe key's agents, limits, credits, activity log and Black Box, answered by the model chosen for this API in Admin > Models.\n`anthropic-version` and `anthropic-beta` may be sent; neither is needed, and neither changes how a request runs.\n\nA `model` is one of the key's agents (`iris`, `iris-think`) or any Claude model name, which runs `iris` when the key has it,\nelse the key's first agent; the name asked for is the name answered with. Thinking (`adaptive` by `output_config.effort`,\n`enabled` by `budget_tokens`, `disabled`) is shown with the signature its model gave, empty when it gives none. Prompt caching\n(`cache_control`), structured output (`output_config.format`), stop sequences, images and PDFs (base64, an https URL or a\nFiles API id) are supported.\n\nServer tools run on Dyadic's own: `web_search` and `web_fetch` (with `max_uses`; the key's agent tools switch),\n`code_execution` (Python and bash in Dyadic's containers; the key's Code Interpreter switch) and remote MCP servers\n(`mcp_servers`; the key's MCP switch). Anthropic's client tools (`bash`, the text editor, `memory`) are the application's\nto run; they and tool search (`tool_search_tool_regex_*`, `tool_search_tool_bm25_*`) reach Claude on Anthropic as Anthropic\ndefines them, and another model as functions. With tool search, every tool goes to Claude on Anthropic, the deferred ones\n(`defer_loading`) still deferred: Claude searches them there, and a tool it finds comes back as its `tool_use`, without\nAnthropic's `server_tool_use` and `tool_search_tool_result` blocks. A tool the conversation has called loads up front, as\ndeferred tools do for another model. Without Anthropic's tool search, deferred tools load as other tools do (a large set on\ndemand, through Dyadic's own tool loading), and a custom search's `tool_reference` results are read as the names of the\ntools found. Refused with 400, never ignored: domain limits on web search and fetch, Anthropic's skills, the computer and\nbrowser toolsets and any other tool type.\n\nErrors have Anthropic's shape (`{\"type\": \"error\", \"error\": {\"type\", \"message\"}}`) and statuses: 400 invalid_request_error,\n401 authentication_error, 402 billing_error (credits or a key limit), 403 permission_error, 404 not_found_error,\n413 request_too_large, 415 invalid_request_error (a body that isn't JSON, or a file that isn't multipart), 429\nrate_limit_error (with `retry-after`), 5xx api_error. Every response carries `X-Request-Id`; a message that ran also carries\n`request-id`, its `dyadic.request_id`.\n\nThe REST base ends in `/anthropic/v1`; the Anthropic SDK base ends in `/anthropic` because it appends `/v1`.\nClosing a local stream is not proof of provider cancellation or final cost. Handle the terminal message event\nand inspect retained batch state before retrying an interrupted request. This is the documented compatible subset,\nnot a promise that every feature of a later Anthropic client is implemented.\n"}, "servers": [{"url": "https://api.dyadic.app/anthropic/v1"}], "components": {"schemas": {"Error": {"type": "object", "properties": {"type": {"const": "error"}, "error": {"type": "object", "properties": {"type": {"type": "string"}, "message": {"type": "string"}}}, "request_id": {"type": "string", "description": "A run's error."}}}, "ContentBlock": {"type": "object", "description": "A content block. A user turn: text, image, document or tool_result (its content text, images or a custom tool search's tool_reference blocks); an image or document is base64 data, an https URL or a Files API file_id, and a document a PDF or plain text. An assistant turn and the answer: text, tool_use, thinking, redacted_thinking, server_tool_use, web_search_tool_result, web_fetch_tool_result, code_execution_tool_result, bash_code_execution_tool_result, mcp_tool_use or mcp_tool_result (an assistant turn may also carry text_editor_code_execution_tool_result and tool_search_tool_result).", "properties": {"type": {"type": "string"}}, "required": ["type"]}, "MessageParam": {"type": "object", "required": ["role", "content"], "properties": {"role": {"enum": ["user", "assistant", "system", "developer"], "description": "system or developer: a later system prompt, never the first message."}, "content": {"oneOf": [{"type": "string"}, {"type": "array", "items": {"$ref": "#/components/schemas/ContentBlock"}}]}}}, "Tool": {"type": "object", "description": "A custom tool ({name, description, input_schema}; type custom or left out), a server tool (web_search_*, web_fetch_*, code_execution_*), a client tool Anthropic defines (bash_*, text_editor_*, memory_*) or tool search (tool_search_tool_regex_*, tool_search_tool_bm25_*), each Anthropic's dated version. Any other type is refused. Custom and client tools need the key's function calling switch.", "properties": {"type": {"type": "string"}, "name": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,64}$"}, "description": {"type": "string"}, "input_schema": {"type": "object"}, "strict": {"type": "boolean"}, "defer_loading": {"type": "boolean", "description": "A custom tool that tool search finds, instead of loading up front (Claude on Anthropic)."}, "cache_control": {"type": "object"}, "max_uses": {"type": "integer", "minimum": 1, "description": "web_search and web_fetch."}, "max_characters": {"type": "integer", "description": "text_editor_*."}}}, "MessageRequest": {"type": "object", "required": ["model", "max_tokens", "messages"], "properties": {"model": {"type": "string", "description": "One of the key's agents (a dyadic/ prefix is allowed), or a Claude model name."}, "max_tokens": {"type": "integer", "minimum": 1, "description": "Capped at the key's output limit, and at 32,000."}, "messages": {"type": "array", "minItems": 1, "items": {"$ref": "#/components/schemas/MessageParam"}}, "system": {"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "object", "required": ["type", "text"], "properties": {"type": {"const": "text"}, "text": {"type": "string"}, "cache_control": {"type": "object"}}}}]}, "stream": {"type": "boolean"}, "stop_sequences": {"type": "array", "maxItems": 4, "items": {"type": "string", "minLength": 1, "maxLength": 200}}, "temperature": {"type": "number", "minimum": 0, "maximum": 1, "default": 1, "description": "Not sent to a Claude model that refuses it (nor are top_p and top_k)."}, "top_p": {"type": "number", "minimum": 0, "maximum": 1}, "top_k": {"type": "integer", "minimum": 0, "maximum": 1000}, "thinking": {"type": "object", "required": ["type"], "properties": {"type": {"enum": ["adaptive", "enabled", "between_tools", "disabled"], "description": "between_tools runs as adaptive."}, "budget_tokens": {"type": "integer", "minimum": 1024, "description": "enabled: required, and less than max_tokens."}}}, "output_config": {"type": "object", "properties": {"effort": {"enum": ["low", "medium", "high", "xhigh", "max"], "description": "max runs as xhigh."}, "format": {"type": "object", "required": ["type", "schema"], "properties": {"type": {"const": "json_schema"}, "schema": {"type": "object"}}}}}, "tools": {"type": "array", "items": {"$ref": "#/components/schemas/Tool"}}, "tool_choice": {"type": "object", "required": ["type"], "properties": {"type": {"enum": ["auto", "any", "tool", "none"]}, "name": {"type": "string", "description": "tool: the tool's name, one of tools."}, "disable_parallel_tool_use": {"type": "boolean"}}}, "mcp_servers": {"type": "array", "items": {"type": "object", "required": ["type", "url", "name"], "properties": {"type": {"const": "url"}, "url": {"type": "string"}, "name": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,64}$"}, "authorization_token": {"type": "string"}, "tool_configuration": {"type": "object", "properties": {"enabled": {"type": "boolean"}, "allowed_tools": {"type": "array", "items": {"type": "string"}}}}}}}, "container": {"oneOf": [{"type": "string"}, {"type": "object", "properties": {"id": {"type": "string"}}}], "description": "A container id, for code_execution; Anthropic's skills are refused."}, "cache_control": {"type": "object", "description": "Marks the request's last block."}, "metadata": {"type": "object", "properties": {"user_id": {"type": "string"}}}, "dyadic": {"type": "object", "additionalProperties": false, "properties": {"approval_mode": {"type": "string", "enum": ["ask", "edits", "auto", "bypass", "autonomous", "custom"], "default": "ask"}, "permission_profile_id": {"type": "string", "format": "uuid", "description": "Owned saved profile. Requires Custom; omission uses the account selection."}, "pog": {"oneOf": [{"type": "boolean"}, {"type": "object"}], "description": "Predictive Operation Graph settings."}}}, "pog": {"oneOf": [{"type": "boolean"}, {"type": "object"}], "description": "Predictive Operation Graph settings (or dyadic.pog)."}}}, "CountTokensRequest": {"type": "object", "required": ["model", "messages"], "properties": {"model": {"type": "string"}, "messages": {"type": "array", "minItems": 1, "items": {"$ref": "#/components/schemas/MessageParam"}}, "system": {"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "object", "required": ["type", "text"], "properties": {"type": {"const": "text"}, "text": {"type": "string"}, "cache_control": {"type": "object"}}}}]}, "tools": {"type": "array", "items": {"$ref": "#/components/schemas/Tool"}}, "tool_choice": {"type": "object", "required": ["type"], "properties": {"type": {"enum": ["auto", "any", "tool", "none"]}, "name": {"type": "string", "description": "tool: the tool's name, one of tools."}, "disable_parallel_tool_use": {"type": "boolean"}}}, "thinking": {"type": "object", "required": ["type"], "properties": {"type": {"enum": ["adaptive", "enabled", "between_tools", "disabled"], "description": "between_tools runs as adaptive."}, "budget_tokens": {"type": "integer", "minimum": 1024, "description": "enabled: required, and less than max_tokens."}}}, "output_config": {"type": "object", "properties": {"effort": {"enum": ["low", "medium", "high", "xhigh", "max"], "description": "max runs as xhigh."}}}}}, "Usage": {"type": "object", "properties": {"input_tokens": {"type": "integer"}, "output_tokens": {"type": "integer"}, "cache_creation_input_tokens": {"type": "integer"}, "cache_read_input_tokens": {"type": "integer"}, "server_tool_use": {"type": "object", "description": "When the request had web_search or web_fetch.", "properties": {"web_search_requests": {"type": "integer"}, "web_fetch_requests": {"type": "integer"}}}}}, "Message": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"const": "message"}, "role": {"const": "assistant"}, "model": {"type": "string", "description": "The name the request asked for."}, "content": {"type": "array", "items": {"$ref": "#/components/schemas/ContentBlock"}}, "stop_reason": {"enum": ["end_turn", "max_tokens", "stop_sequence", "tool_use", "refusal"]}, "stop_sequence": {"type": ["string", "null"]}, "usage": {"$ref": "#/components/schemas/Usage"}, "container": {"type": "object", "description": "When code ran.", "properties": {"id": {"type": "string"}, "expires_at": {"type": "string"}}}, "dyadic": {"type": "object", "properties": {"credits": {"type": ["number", "null"]}, "credits_final": {"type": "boolean", "description": "False while the cost is estimated."}, "request_id": {"type": "string"}, "log_id": {"type": ["string", "null"], "description": "The activity log's row."}, "permissions": {"type": "object", "properties": {"requested_mode": {"type": "string"}, "effective_mode": {"type": "string"}, "profile_id": {"type": "string", "format": "uuid"}, "snapshot_id": {"type": "string", "format": "uuid"}}, "description": "When the request chose an approval mode other than ask."}, "pog": {"type": "object"}}}}}, "Model": {"type": "object", "properties": {"type": {"const": "model"}, "id": {"type": "string"}, "display_name": {"type": "string"}, "created_at": {"type": "string"}, "lifecycle": {"const": "active"}}}, "ModelList": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Model"}}, "has_more": {"const": false}, "first_id": {"type": ["string", "null"]}, "last_id": {"type": ["string", "null"]}}}, "File": {"type": "object", "properties": {"type": {"const": "file"}, "id": {"type": "string"}, "filename": {"type": "string"}, "mime_type": {"type": "string"}, "size_bytes": {"type": "integer"}, "created_at": {"type": "string"}, "downloadable": {"const": true}}}, "FileList": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/File"}}, "has_more": {"type": "boolean"}, "first_id": {"type": ["string", "null"]}, "last_id": {"type": ["string", "null"]}}}, "BatchRequest": {"type": "object", "required": ["requests"], "properties": {"requests": {"type": "array", "minItems": 1, "maxItems": 5000, "items": {"type": "object", "required": ["custom_id", "params"], "properties": {"custom_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,64}$", "description": "Unique in the batch."}, "params": {"$ref": "#/components/schemas/MessageRequest", "description": "A Messages request, not streamed."}}}}}}, "MessageBatch": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"const": "message_batch"}, "processing_status": {"enum": ["in_progress", "canceling", "ended"]}, "request_counts": {"type": "object", "properties": {"processing": {"type": "integer"}, "succeeded": {"type": "integer"}, "errored": {"type": "integer"}, "canceled": {"type": "integer"}, "expired": {"type": "integer"}}}, "created_at": {"type": "string"}, "expires_at": {"type": "string"}, "ended_at": {"type": ["string", "null"]}, "cancel_initiated_at": {"type": ["string", "null"]}, "archived_at": {"type": "null"}, "results_url": {"type": ["string", "null"]}}}, "BatchList": {"type": "object", "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/MessageBatch"}}, "has_more": {"type": "boolean"}, "first_id": {"type": ["string", "null"]}, "last_id": {"type": ["string", "null"]}}}}, "securitySchemes": {"apiKey": {"type": "apiKey", "in": "header", "name": "x-api-key"}, "bearer": {"type": "http", "scheme": "bearer"}}}, "security": [{"apiKey": []}, {"bearer": []}], "paths": {"/messages": {"post": {"tags": ["Messages"], "operationId": "createMessage", "summary": "Create a message", "responses": {"200": {"description": "With stream: true, Anthropic's Server-Sent Events: message_start, content_block_start, content_block_delta (text_delta, thinking_delta, signature_delta, input_json_delta), content_block_stop, message_delta (stop_reason, usage and dyadic), message_stop, ping, error; pog.* events when the request sets pog. A failure before the stream opens is an ordinary error response.", "headers": {"request-id": {"description": "The run's id (dyadic.request_id).", "schema": {"type": "string"}}, "X-Dyadic-Credits": {"description": "Credits charged, when not streamed.", "schema": {"type": "string"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Message"}}, "text/event-stream": {"schema": {"type": "string"}}}}, "400": {"description": "invalid_request_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "402": {"description": "billing_error: out of credits or over a key limit", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "request_too_large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "invalid_request_error: send JSON (multipart/form-data for a file)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "5XX": {"description": "api_error: Dyadic or the model's provider failed, or no model is chosen for this API", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageRequest"}}}}}}, "/messages/count_tokens": {"post": {"tags": ["Messages"], "operationId": "countTokens", "summary": "Count a request's input tokens", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"input_tokens": {"type": "integer"}}}}}}, "400": {"description": "invalid_request_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "request_too_large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "invalid_request_error: send JSON (multipart/form-data for a file)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "5XX": {"description": "api_error: Dyadic or the model's provider failed, or no model is chosen for this API", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Free. Counted by Anthropic when this API's model is a Claude model; otherwise, or when Anthropic can't count it, estimated (header X-Dyadic-Estimated: true). The request's own content: an agent's persona and context, when the key adds them, come on top.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CountTokensRequest"}}}}}}, "/models": {"get": {"tags": ["Models"], "operationId": "listModels", "summary": "List the key's models", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ModelList"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "The key's agents, and each one's -think model when the key may think. One page."}}, "/models/{model}": {"get": {"tags": ["Models"], "operationId": "getModel", "summary": "Get a model", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Model"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "parameters": [{"name": "model", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A model id from the list."}]}}, "/files": {"post": {"tags": ["Files"], "operationId": "uploadFile", "summary": "Upload a file", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/File"}}}}, "400": {"description": "invalid_request_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "402": {"description": "billing_error: out of credits or over a key limit", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "request_too_large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "invalid_request_error: send JSON (multipart/form-data for a file)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Up to 20 MB; an image must be PNG, JPEG, WebP or GIF. Kept with the account's API files, the ones the OpenAI-compatible API lists. Needs the key's Files switch.", "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"type": "object", "properties": {"file": {"type": "string", "format": "binary"}}, "required": ["file"]}}}}}, "get": {"tags": ["Files"], "operationId": "listFiles", "summary": "List files", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FileList"}}}}, "400": {"description": "invalid_request_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Newest first: the account's API files, the OpenAI-compatible API's and batches' included.", "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 1000, "default": 20}, "description": "How many, 1 to 1000."}, {"name": "after_id", "in": "query", "schema": {"type": "string"}, "description": "The next page: older than this id."}, {"name": "before_id", "in": "query", "schema": {"type": "string"}, "description": "The page before: newer than this id."}]}}, "/files/{file_id}": {"get": {"tags": ["Files"], "operationId": "getFile", "summary": "Get a file's metadata", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/File"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "parameters": [{"name": "file_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A file id."}]}, "delete": {"tags": ["Files"], "operationId": "deleteFile", "summary": "Delete a file", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"const": "file_deleted"}}}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "parameters": [{"name": "file_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A file id."}]}}, "/files/{file_id}/content": {"get": {"tags": ["Files"], "operationId": "downloadFile", "summary": "Download a file", "responses": {"200": {"description": "The file, as an attachment: its own type, or application/octet-stream for one a browser could run (HTML, SVG, XML, programs).", "content": {"*/*": {"schema": {"type": "string", "format": "binary"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "parameters": [{"name": "file_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A file id."}]}}, "/messages/batches": {"post": {"tags": ["Message Batches"], "operationId": "createBatch", "summary": "Create a message batch", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageBatch"}}}}, "400": {"description": "invalid_request_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "402": {"description": "billing_error: out of credits or over a key limit", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "request_too_large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "invalid_request_error: send JSON (multipart/form-data for a file)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Up to 5,000 requests, each run on Dyadic's batch runner as a [`POST /messages`](https://dyadic.app/developers/api/#anthropic/tag/messages/POST/messages) call and checked when it runs (a refused one is an errored result). Up to 4 unfinished batches an account (429 beyond). Needs the key's Files switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BatchRequest"}}}}}, "get": {"tags": ["Message Batches"], "operationId": "listBatches", "summary": "List message batches", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BatchList"}}}}, "400": {"description": "invalid_request_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 1000, "default": 20}, "description": "How many, 1 to 1000."}, {"name": "after_id", "in": "query", "schema": {"type": "string"}, "description": "The next page: older than this id."}, {"name": "before_id", "in": "query", "schema": {"type": "string"}, "description": "The page before: newer than this id."}]}}, "/messages/batches/{batch_id}": {"get": {"tags": ["Message Batches"], "operationId": "getBatch", "summary": "Get a message batch", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageBatch"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "parameters": [{"name": "batch_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A batch id."}]}, "delete": {"tags": ["Message Batches"], "operationId": "deleteBatch", "summary": "Delete an ended message batch", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"const": "message_batch_deleted"}}}}}}, "400": {"description": "invalid_request_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "400 until it has ended: cancel it first.", "parameters": [{"name": "batch_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A batch id."}]}}, "/messages/batches/{batch_id}/cancel": {"post": {"tags": ["Message Batches"], "operationId": "cancelBatch", "summary": "Cancel a message batch", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MessageBatch"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "A batch still in progress starts canceling; any other is answered as it is.", "parameters": [{"name": "batch_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A batch id."}]}}, "/messages/batches/{batch_id}/results": {"get": {"tags": ["Message Batches"], "operationId": "getBatchResults", "summary": "Get an ended batch's results", "responses": {"200": {"description": "One JSON line per request, in order: {custom_id, result: {type: succeeded, message} | {type: errored, error} | {type: canceled} | {type: expired}}", "content": {"application/x-jsonl": {"schema": {"type": "string"}}}}, "400": {"description": "invalid_request_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "authentication_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "permission_error: a paused key, an address, account or switch that doesn't allow it, or an agent the key can't use", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "not_found_error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "rate_limit_error: the key's or account's requests a minute, or the key's requests at once (retry-after)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "400 until processing_status is ended.", "parameters": [{"name": "batch_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A batch id."}]}}}}