{"openapi":"3.1.0","info":{"title":"API Many API","version":"1.0.0","summary":"One API key for language, image, video, audio and embedding models.","description":"OpenAI- and Anthropic-compatible text endpoints plus asynchronous media tasks. Requests reserve their maximum cost and settle at actual usage; failed requests are not charged.","termsOfService":"https://apimany.com/terms","contact":{"name":"API Many support","url":"https://apimany.com/contact","email":"support@apimany.com"}},"servers":[{"url":"https://apimany.com/v1"}],"externalDocs":{"description":"Documentation","url":"https://apimany.com/docs"},"security":[{"BearerAuth":[]}],"tags":[{"name":"Text"},{"name":"Media"},{"name":"Audio"},{"name":"Account"},{"name":"Models"}],"paths":{"/chat/completions":{"post":{"summary":"Create a chat completion","description":"OpenAI-compatible chat. Supports stream, tools, response_format and image inputs.","tags":["Text"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"}}},"example":{"model":"claude-sonnet-5-5","messages":[{"role":"user","content":"Hello"}],"stream":false}}}},"responses":{"200":{"description":"A completion, or text/event-stream chunks when stream is true.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/messages":{"post":{"summary":"Create a message (Anthropic)","description":"Anthropic Messages API for Claude models. anthropic-version and anthropic-beta headers are forwarded.","tags":["Text"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"}}},"example":{"model":"claude-opus-5-5","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}}}},"responses":{"200":{"description":"JSON response, or text/event-stream when stream is true.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/messages/count_tokens":{"post":{"summary":"Count tokens (Anthropic)","description":"Free token count for a Messages request.","tags":["Text"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"}}},"example":{"model":"claude-sonnet-5-5","messages":[{"role":"user","content":"Hello"}]}}}},"responses":{"200":{"description":"JSON response, or text/event-stream when stream is true.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/responses":{"post":{"summary":"Create a response","description":"OpenAI Responses API.","tags":["Text"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"}}},"example":{"model":"gpt-6.1-sol","input":"Hello"}}}},"responses":{"200":{"description":"JSON response, or text/event-stream when stream is true.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/embeddings":{"post":{"summary":"Create embeddings","description":"OpenAI-compatible embeddings.","tags":["Text"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"}}},"example":{"model":"text-embedding-3-small","input":"Hello"}}}},"responses":{"200":{"description":"JSON response, or text/event-stream when stream is true.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/moderations":{"post":{"summary":"Classify content","description":"OpenAI-compatible moderation.","tags":["Text"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"}}},"example":{"model":"omni-moderation-latest","input":"Hello"}}}},"responses":{"200":{"description":"JSON response, or text/event-stream when stream is true.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/images/generations":{"post":{"summary":"Generate an image","tags":["Media"],"description":"Submits an asynchronous job. Model-specific fields are listed by GET /models/{id}. Returns immediately with a task; poll GET /tasks/{id} or pass callback_url.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"},"prompt":{"type":"string"},"callback_url":{"type":"string","format":"uri"}}},"example":{"model":"gpt-image-2","prompt":"A watercolor fox","size":"1:1","resolution":"1k"}}}},"responses":{"200":{"description":"Task created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/videos/generations":{"post":{"summary":"Generate a video","tags":["Media"],"description":"Submits an asynchronous job. Model-specific fields are listed by GET /models/{id}. Returns immediately with a task; poll GET /tasks/{id} or pass callback_url.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"},"prompt":{"type":"string"},"callback_url":{"type":"string","format":"uri"}}},"example":{"model":"seedance-2.5","prompt":"A paper boat in the rain","resolution":"720p","duration":5}}}},"responses":{"200":{"description":"Task created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/music/generations":{"post":{"summary":"Generate music","tags":["Media"],"description":"Submits an asynchronous job. Model-specific fields are listed by GET /models/{id}. Returns immediately with a task; poll GET /tasks/{id} or pass callback_url.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"},"prompt":{"type":"string"},"callback_url":{"type":"string","format":"uri"}}},"example":{"model":"suno","prompt":"Lo-fi piano with rain","custom":false}}}},"responses":{"200":{"description":"Task created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/tasks/{id}":{"get":{"summary":"Get a media task","tags":["Media"],"parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"data":{"$ref":"#/components/schemas/Task"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/audio/transcriptions":{"post":{"summary":"Transcribe audio","tags":["Audio"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["model","file"],"properties":{"model":{"type":"string"},"file":{"type":"string","format":"binary"},"response_format":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/models":{"get":{"summary":"List models with pricing","tags":["Models"],"security":[],"parameters":[{"name":"kind","in":"query","schema":{"type":"string","enum":["chat","image","video","audio","embedding","moderation"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}}}}}}},"/models/{id}":{"get":{"summary":"Get one model with its parameters","tags":["Models"],"security":[],"parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/records":{"get":{"summary":"List call records","tags":["Account"],"parameters":[{"name":"limit","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"string"}},{"name":"model","in":"query","schema":{"type":"string"}},{"name":"kind","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"api_key_id","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Record"}},"total":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/records/{id}":{"get":{"summary":"Get a call record","tags":["Account"],"parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/account/balance":{"get":{"summary":"Get your balance","tags":["Account"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"balance_usd":{"type":"number"},"debt_usd":{"type":"number"},"currency":{"const":"usd"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/jobs":{"post":{"summary":"Create a job (deprecated)","deprecated":true,"tags":["Media"],"description":"Legacy prompt-only media jobs. Use /images/generations or /videos/generations.","responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key from the console."}},"parameters":{"Id":{"name":"id","in":"path","required":true,"schema":{"type":"string"}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Makes retries safe: a repeated key returns the original record."}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"ChatCompletion":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"object"},"finish_reason":{"type":["string","null"],"enum":["stop","length","tool_calls","content_filter",null]}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":"string"}}}}},"Model":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"vendor":{"type":"string"},"type":{"type":"string"},"endpoint":{"type":"string"},"context_window":{"type":["integer","null"]},"pricing":{"type":"object"},"parameters":{"type":"array","items":{"type":"object"}}}},"Task":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","failed"]},"progress":{"type":"integer"},"cost_usd":{"type":["number","null"]},"reserved_usd":{"type":"number"},"result":{"type":["object","null"]},"error":{"type":["object","null"]}}},"Record":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"kind":{"type":"string"},"endpoint":{"type":"string"},"status":{"type":"string"},"usage":{"type":"object"},"cost_usd":{"type":["number","null"]},"outputs":{"type":"array","items":{"type":"object"}},"created_at":{"type":"string","format":"date-time"}}}}}}