{"openapi":"3.1.0","info":{"title":"FullsendAI API","version":"1.0.0","summary":"OpenAI- and Anthropic-compatible LLM API, hosted in the US.","description":"One key for every model. OpenAI-compatible chat completions, embeddings and model list; the Anthropic Messages API; Cohere/Jina-style reranking. Prices are per 1M tokens, in US dollars, charged from the account's plan allowance and then its prepaid balance. Every response carries an `x-request-id` header."},"servers":[{"url":"https://fullsendai.com/v1"}],"externalDocs":{"description":"Documentation","url":"https://fullsendai.com/docs"},"security":[{"bearer":[]},{"apiKey":[]}],"tags":[{"name":"OpenAI-compatible","description":"Works with OpenAI's SDKs: set the base URL and key."},{"name":"Anthropic-compatible","description":"Works with Anthropic's SDKs and Claude Code: set the base URL (without /v1) and key."},{"name":"Account"}],"paths":{"/chat/completions":{"post":{"tags":["OpenAI-compatible"],"operationId":"createChatCompletion","summary":"Create a chat completion","description":"OpenAI's chat completions. Other OpenAI parameters (`response_format`, `seed`, `logprobs`, …) are passed to the model as sent, except `service_tier` and `prompt_cache_options`, which are ignored. Input read from the prompt cache is reported as `usage.prompt_tokens_details.cached_tokens` and billed at the model's cached-input price.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"The completion, or with `stream: true` a stream of `chat.completion.chunk` events ending in `data: [DONE]` (the last chunk before it carries `usage`).","headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}},"x-ratelimit-limit-requests":{"description":"Requests a minute allowed (the tighter of the key's and the account's limits).","schema":{"type":"string"}},"x-ratelimit-remaining-requests":{"description":"Requests left this minute.","schema":{"type":"string"}},"x-ratelimit-reset-requests":{"description":"Seconds until the minute resets, like `42s`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"type":"string","description":"Server-sent events, each `data: <ChatCompletionChunk JSON>`."}}}},"400":{"description":"The request is malformed, or the model can't take it (the message says why).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"402":{"description":"The balance is empty and the plan allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"403":{"description":"The account is suspended, or the key may not call this model or from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"404":{"description":"No such model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"429":{"description":"A rate limit, the key's monthly limit or the project's budget was reached. Retry-After says when to retry a rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"502":{"description":"The model provider couldn't be reached or failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"503":{"description":"The model is overloaded. Retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"504":{"description":"The model didn't start answering in time.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}}},"/responses":{"post":{"tags":["OpenAI-compatible"],"operationId":"createResponse","summary":"Create a response (OpenAI Responses API)","description":"OpenAI's Responses API on every model, for Codex CLI and the OpenAI Agents SDK. Stateless: send the whole conversation in `input` with `store: false`; `previous_response_id` isn't supported. `instructions` and developer messages lead the conversation; function, namespaced and freeform (custom) tools work, with their calls and outputs sent back in `input`; OpenAI's hosted tools (web search, file search) are left out. `reasoning.effort` sets the model's reasoning level, and its reasoning comes back as `reasoning` items with a summary.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"instructions":{"type":"string"},"tools":{"type":"array","items":{"type":"object"}},"stream":{"type":"boolean"},"max_output_tokens":{"type":"integer"},"reasoning":{"type":"object"}}}}}},"responses":{"200":{"description":"The response, or with `stream: true` the Responses event stream (response.created, response.output_item.*, response.output_text.delta, response.function_call_arguments.delta, response.completed).","headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}},"x-ratelimit-limit-requests":{"description":"Requests a minute allowed (the tighter of the key's and the account's limits).","schema":{"type":"string"}},"x-ratelimit-remaining-requests":{"description":"Requests left this minute.","schema":{"type":"string"}},"x-ratelimit-reset-requests":{"description":"Seconds until the minute resets, like `42s`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"The request is malformed, or the model can't take it (the message says why).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"402":{"description":"The balance is empty and the plan allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"403":{"description":"The account is suspended, or the key may not call this model or from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"404":{"description":"No such model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"429":{"description":"A rate limit, the key's monthly limit or the project's budget was reached. Retry-After says when to retry a rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"502":{"description":"The model provider couldn't be reached or failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"503":{"description":"The model is overloaded. Retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}}},"/messages":{"post":{"tags":["Anthropic-compatible"],"operationId":"createMessage","summary":"Create a message (Anthropic Messages API)","description":"Anthropic's Messages API on every model. `cache_control` on system and content blocks is passed to the provider; extended `thinking` maps to the model's reasoning level (a budget under 4,096 tokens is low, under 16,384 medium, otherwise high) and the reasoning comes back as `thinking` blocks. PDF `document` blocks (base64) work on models that read PDFs; others answer 400. Cached input is reported as `usage.cache_read_input_tokens`.","parameters":[{"name":"anthropic-version","in":"header","required":false,"schema":{"type":"string","example":"2023-06-01"}},{"name":"x-api-key","in":"header","required":false,"schema":{"type":"string"},"description":"The key, Anthropic-style (or `Authorization: Bearer`)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRequest"}}}},"responses":{"200":{"description":"The message, or with `stream: true` Anthropic's event stream (message_start, content_block_*, message_delta, message_stop).","headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}},"x-ratelimit-limit-requests":{"description":"Requests a minute allowed (the tighter of the key's and the account's limits).","schema":{"type":"string"}},"x-ratelimit-remaining-requests":{"description":"Requests left this minute.","schema":{"type":"string"}},"x-ratelimit-reset-requests":{"description":"Seconds until the minute resets, like `42s`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"The request is malformed, or the model can't take it (the message says why).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"402":{"description":"The balance is empty and the plan allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"403":{"description":"The account is suspended, or the key may not call this model or from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"404":{"description":"No such model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"429":{"description":"A rate limit, the key's monthly limit or the project's budget was reached. Retry-After says when to retry a rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"502":{"description":"The model provider couldn't be reached or failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"503":{"description":"The model is overloaded. Retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}}},"/messages/count_tokens":{"post":{"tags":["Anthropic-compatible"],"operationId":"countTokens","summary":"Estimate a request's input tokens","description":"An estimate (about four characters a token) for tools that ask before sending.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageRequest"}}}},"responses":{"200":{"description":"The estimate.","content":{"application/json":{"schema":{"type":"object","required":["input_tokens"],"properties":{"input_tokens":{"type":"integer"}}}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"400":{"description":"The request is malformed, or the model can't take it (the message says why).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}}},"/models":{"get":{"tags":["OpenAI-compatible","Anthropic-compatible"],"operationId":"listModels","summary":"List models","description":"The live models this key may call, every kind unless `kind` narrows it. With an `anthropic-version` header the list comes in Anthropic's shape and holds chat models only.","parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["chat","embedding","rerank"]}}],"responses":{"200":{"description":"The models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"403":{"description":"The account is suspended, or the key may not call this model or from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}}},"/embeddings":{"post":{"tags":["OpenAI-compatible"],"operationId":"createEmbeddings","summary":"Create embeddings","description":"OpenAI's embeddings, on embedding models (`kind: embedding` in /models). Billed per input token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingRequest"}}}},"responses":{"200":{"description":"One embedding per input, in order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingList"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}},"x-ratelimit-limit-requests":{"description":"Requests a minute allowed (the tighter of the key's and the account's limits).","schema":{"type":"string"}},"x-ratelimit-remaining-requests":{"description":"Requests left this minute.","schema":{"type":"string"}},"x-ratelimit-reset-requests":{"description":"Seconds until the minute resets, like `42s`.","schema":{"type":"string"}}}},"400":{"description":"The request is malformed, or the model can't take it (the message says why).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"402":{"description":"The balance is empty and the plan allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"403":{"description":"The account is suspended, or the key may not call this model or from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"404":{"description":"No such model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"429":{"description":"A rate limit, the key's monthly limit or the project's budget was reached. Retry-After says when to retry a rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"502":{"description":"The model provider couldn't be reached or failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"503":{"description":"The model is overloaded. Retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}}},"/rerank":{"post":{"tags":["OpenAI-compatible"],"operationId":"rerank","summary":"Rerank documents against a query","description":"Cohere- and Jina-style reranking on reranker models (`kind: rerank` in /models). Results come most relevant first. Billed per input token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerankRequest"}}}},"responses":{"200":{"description":"The ranking.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerankResponse"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}},"x-ratelimit-limit-requests":{"description":"Requests a minute allowed (the tighter of the key's and the account's limits).","schema":{"type":"string"}},"x-ratelimit-remaining-requests":{"description":"Requests left this minute.","schema":{"type":"string"}},"x-ratelimit-reset-requests":{"description":"Seconds until the minute resets, like `42s`.","schema":{"type":"string"}}}},"400":{"description":"The request is malformed, or the model can't take it (the message says why).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"402":{"description":"The balance is empty and the plan allowance is used up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"403":{"description":"The account is suspended, or the key may not call this model or from this address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"404":{"description":"No such model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"429":{"description":"A rate limit, the key's monthly limit or the project's budget was reached. Retry-After says when to retry a rate limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"502":{"description":"The model provider couldn't be reached or failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"503":{"description":"The model is overloaded. Retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}}},"/key":{"get":{"tags":["Account"],"operationId":"getKey","summary":"The calling key","description":"The key's label, limits and locks, and the balance of the account it bills. Money is in US dollars. `strip_claude_prompt` is whether Claude Code's own agent instructions are left out of its requests on this key (set by `npx fullsendai connect` on the key it makes for Claude Code).","responses":{"200":{"description":"The key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInfo"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}},"patch":{"tags":["Account"],"operationId":"updateKey","summary":"Update the key's tool settings","description":"Today one setting: `strip_claude_prompt` — whether Claude Code's own agent instructions are left out of its main requests on this key (true) or sent as usual (false, the default). Its environment, subagents, skills, MCP instructions and CLAUDE.md are always sent. What `npx fullsendai connect` sets on the key it makes for Claude Code.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"strip_claude_prompt":{"type":"boolean","description":"true leaves Claude Code's own agent instructions out of its requests on this key; false sends them."}}}}}},"responses":{"200":{"description":"The key as it now stands.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyInfo"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"400":{"description":"The request is malformed, or the model can't take it (the message says why).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}},"401":{"description":"No key, or the key is invalid, revoked, expired or in an archived project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"x-request-id":{"description":"Our id for this call (`req_…`). Quote it to support; it's also in error bodies.","schema":{"type":"string"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer fs_live_…`"},"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"`x-api-key: fs_live_…` (Anthropic style)."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string","examples":["invalid_api_key","insufficient_quota","model_not_found","rate_limit_exceeded","invalid_model_kind"]},"request_id":{"type":"string","description":"The call's x-request-id."}}}}},"AnthropicError":{"type":"object","required":["type","error"],"properties":{"type":{"const":"error"},"error":{"type":"object","required":["type","message"],"properties":{"type":{"type":"string"},"message":{"type":"string"}}},"request_id":{"type":"string"}}},"ContentPart":{"oneOf":[{"type":"object","required":["type","text"],"properties":{"type":{"const":"text"},"text":{"type":"string"},"cache_control":{"$ref":"#/components/schemas/CacheControl"}}},{"type":"object","required":["type","image_url"],"properties":{"type":{"const":"image_url"},"image_url":{"type":"object","required":["url"],"properties":{"url":{"type":"string"},"detail":{"type":"string"}}}}},{"type":"object","required":["type","file"],"properties":{"type":{"const":"file"},"file":{"type":"object","properties":{"filename":{"type":"string"},"file_data":{"type":"string","description":"A data: URL."}}}}}]},"CacheControl":{"type":"object","required":["type"],"properties":{"type":{"const":"ephemeral"},"ttl":{"type":"string"}}},"ChatMessage":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ContentPart"}},{"type":"null"}]},"name":{"type":"string"},"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/ToolCall"}},"tool_call_id":{"type":"string"}}},"ToolCall":{"type":"object","required":["id","type","function"],"properties":{"id":{"type":"string"},"type":{"const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"},"arguments":{"type":"string"}}}}},"ChatCompletionRequest":{"type":"object","required":["model","messages"],"additionalProperties":true,"properties":{"model":{"type":"string","description":"A model id from /models (`kind: chat`)."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"stream":{"type":"boolean"},"stream_options":{"type":"object","description":"`include_usage` is always on."},"max_tokens":{"type":"integer","description":"Capped at the model's output limit, which applies when it's left out."},"max_completion_tokens":{"type":"integer"},"temperature":{"type":"number"},"top_p":{"type":"number"},"stop":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"tools":{"type":"array","items":{"type":"object","properties":{"type":{"const":"function"},"function":{"type":"object"}}}},"tool_choice":{"oneOf":[{"type":"string","enum":["none","auto","required"]},{"type":"object"}]},"reasoning_effort":{"type":"string","examples":["none","low","medium","high"],"description":"On models with `reasoning: true`; the reasoning comes back as `reasoning_content`."}}},"Usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"prompt_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer","description":"Input read from the prompt cache, billed at the cached-input price."}}}}},"ChatCompletion":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"created":{"type":"integer"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"object","properties":{"role":{"const":"assistant"},"content":{"type":["string","null"]},"reasoning_content":{"type":["string","null"]},"tool_calls":{"type":"array","items":{"$ref":"#/components/schemas/ToolCall"}}}},"finish_reason":{"type":["string","null"]}}}},"usage":{"$ref":"#/components/schemas/Usage"}}},"MessageRequest":{"type":"object","required":["model","max_tokens","messages"],"properties":{"model":{"type":"string"},"max_tokens":{"type":"integer","minimum":1},"system":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/AnthropicBlock"}}]},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/AnthropicBlock"}}]}}}},"temperature":{"type":"number"},"top_p":{"type":"number"},"stop_sequences":{"type":"array","items":{"type":"string"}},"stream":{"type":"boolean"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"input_schema":{"type":"object"}}}},"tool_choice":{"type":"object","properties":{"type":{"type":"string","enum":["auto","any","tool","none"]},"name":{"type":"string"}}},"thinking":{"oneOf":[{"type":"object","required":["type"],"properties":{"type":{"const":"enabled"},"budget_tokens":{"type":"integer"}}},{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["adaptive","disabled"]}}}]}}},"AnthropicBlock":{"type":"object","required":["type"],"description":"text, image (base64 or url), document (base64 PDF, text or content), tool_use, tool_result or thinking. Any block may carry cache_control.","properties":{"type":{"type":"string","enum":["text","image","document","tool_use","tool_result","thinking"]},"text":{"type":"string"},"source":{"type":"object"},"cache_control":{"$ref":"#/components/schemas/CacheControl"}}},"Message":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"message"},"role":{"const":"assistant"},"model":{"type":"string"},"content":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"const":"thinking"},"thinking":{"type":"string"},"signature":{"type":"string"}}},{"type":"object","properties":{"type":{"const":"text"},"text":{"type":"string"}}},{"type":"object","properties":{"type":{"const":"tool_use"},"id":{"type":"string"},"name":{"type":"string"},"input":{"type":"object"}}}]}},"stop_reason":{"type":"string","enum":["end_turn","max_tokens","tool_use","stop_sequence"]},"stop_sequence":{"type":["string","null"]},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer","description":"Input not read from the cache."},"output_tokens":{"type":"integer"},"cache_read_input_tokens":{"type":"integer"},"cache_creation_input_tokens":{"type":"integer"}}}}},"Model":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"model"},"created":{"type":"integer"},"owned_by":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["chat","embedding","rerank"]},"icon":{"type":"string"},"context_length":{"type":["integer","null"]},"max_output_tokens":{"type":"integer"},"images":{"type":"boolean"},"reasoning":{"type":"boolean"},"pricing":{"type":"object","description":"US dollars per 1M tokens.","properties":{"input":{"type":"number"},"output":{"type":"number"},"cached_input":{"type":["number","null"],"description":"For input read from the prompt cache; null bills it as input."}}},"grade":{"type":"object","properties":{"tier":{"type":"string","enum":["gray","yellow","lime","green"]},"composite":{"type":["number","null"]}}}}},"ModelList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}},"EmbeddingRequest":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":2048},{"type":"array","items":{"type":"integer"}},{"type":"array","items":{"type":"array","items":{"type":"integer"}},"maxItems":2048}]},"encoding_format":{"type":"string","enum":["float","base64"]},"dimensions":{"type":"integer","minimum":1,"description":"Passed to models that can shorten their embeddings."}}},"EmbeddingList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"const":"embedding"},"index":{"type":"integer"},"embedding":{"oneOf":[{"type":"array","items":{"type":"number"}},{"type":"string","description":"base64 of float32s"}]}}}},"model":{"type":"string"},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"RerankRequest":{"type":"object","required":["model","query","documents"],"properties":{"model":{"type":"string"},"query":{"type":"string"},"documents":{"type":"array","minItems":1,"maxItems":1000,"items":{"oneOf":[{"type":"string"},{"type":"object","required":["text"],"properties":{"text":{"type":"string"}}}]}},"top_n":{"type":"integer","minimum":1},"return_documents":{"type":"boolean","default":false}}},"RerankResponse":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"results":{"type":"array","items":{"type":"object","required":["index","relevance_score"],"properties":{"index":{"type":"integer"},"relevance_score":{"type":"number"},"document":{"type":"object","properties":{"text":{"type":"string"}}}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"KeyInfo":{"type":"object","properties":{"data":{"type":"object","properties":{"label":{"type":"string"},"key":{"type":"string","description":"Masked, like `fs_live_8f2a…a7e5`."},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"balance":{"type":"number","description":"The account's prepaid balance."},"plan_allowance_remaining":{"type":"number","description":"What's left of this month's plan allowance, spent before the balance."},"limit":{"type":["number","null"],"description":"The key's monthly spending limit."},"usage":{"type":"number","description":"What the key has spent this month."},"limit_remaining":{"type":["number","null"]},"limit_reset":{"const":"monthly"},"rate_limit":{"type":"object","properties":{"requests":{"type":["integer","null"],"description":"Per model per minute for this key; null uses each model's limit."},"interval":{"const":"60s"},"account_requests":{"type":"integer","description":"Per minute across all the account's keys."}}},"allowed_models":{"type":["array","null"],"items":{"type":"string"}},"strip_claude_prompt":{"type":"boolean","description":"Whether Claude Code's own agent instructions are left out of its requests on this key."},"project":{"type":["object","null"],"properties":{"id":{"type":"integer"},"name":{"type":"string"}}}}}}}}}}