{"openapi":"3.1.0","info":{"title":"API Many API","version":"0.2.0-public-beta","summary":"Non-streaming text chat and asynchronous image/video jobs.","description":"Public beta. Five authenticated endpoints cover model discovery, text-only chat, and prompt-only image/video jobs. GET /models lists enabled models and current customer rates; website catalog entries are not a callable endpoint list. Chat streaming, tools, embeddings, audio and other OpenAI API surfaces are not supported. Media jobs use the API Many job contract, not the OpenAI image or video endpoints. Availability is best-effort and can change after discovery.","termsOfService":"https://apimany.com/terms","contact":{"name":"API Many support","url":"https://apimany.com/support","email":"support@apimany.com"},"x-private-beta":false,"x-public-beta":true},"servers":[{"url":"https://apimany.com/v1","description":"API Many public beta"}],"externalDocs":{"description":"API Many developer documentation","url":"https://apimany.com/docs"},"security":[{"BearerAuth":[]}],"tags":[{"name":"Models","description":"Callable model discovery. Website catalog entries may not be callable."},{"name":"Chat","description":"Non-streaming, text-only chat completions."},{"name":"Media","description":"Asynchronous prompt-only image and video jobs with authenticated result downloads."}],"paths":{"/models":{"get":{"operationId":"listModels","tags":["Models"],"summary":"List callable models","description":"Returns models enabled for this public-beta account. This is an access catalog, not an instantaneous availability guarantee; availability can change after this response.","responses":{"200":{"description":"Callable models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/AccountSuspended"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"}}}},"/chat/completions":{"post":{"operationId":"createChatCompletion","tags":["Chat"],"summary":"Create a non-streaming chat completion","description":"Accepts text messages and returns one completed JSON response. stream=true is not supported and returns an OpenAI-shaped error. Requests with an uncertain outcome stop for reconciliation instead of being submitted again.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"A unique key for safely repeating the same logical request. Successful response replay is retained for 24 hours; the key remains bound to its original payload after that body expires. Reusing a key with different request content is rejected.","schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"description":"Send uncompressed application/json. The complete request body is limited to 1,100,000 bytes and is read only after API-key authentication and rate limiting.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"A completed, non-streaming chat response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientBalance"},"403":{"$ref":"#/components/responses/AccountSuspended"},"404":{"$ref":"#/components/responses/ModelNotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/ServerError"},"502":{"$ref":"#/components/responses/RequestFailure"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/jobs":{"post":{"operationId":"createMediaJob","tags":["Media"],"summary":"Create an image or video job","description":"Reserves the published fixed job price and returns immediately. Only model and prompt are accepted; use an enabled media_job model from GET /models. The same idempotency key and payload return the original job without a new submission or charge, even when new generation is disabled. An uncertain outcome remains reserved for review; do not create a replacement job.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique per logical media job; persist it before submission. Reuse only with the same model and prompt.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"description":"Uncompressed application/json; complete body at most 50,000 bytes, prompt at most 8,000 UTF-8 bytes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJobRequest"},"examples":{"image":{"summary":"One 512 × 512 image","value":{"model":"bfl/flux-schnell","prompt":"A blue ceramic cup on a white table."}},"video":{"summary":"One 480p, 81-frame video at 16 fps without audio","value":{"model":"alibaba/wan-2.2-a14b-fast","prompt":"Steam rising gently from a cup beside a sunlit window."}}}}}},"responses":{"200":{"description":"The existing job for this idempotency key and payload. No new submission or charge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJob"}}},"headers":{"Location":{"schema":{"type":"string"}}}},"202":{"description":"New job accepted. Poll the Location resource; acceptance is not completion.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJob"}}},"headers":{"Location":{"description":"Relative URL of this API Many job.","schema":{"type":"string"}}}},"400":{"description":"Invalid model, prompt or idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"401":{"description":"Missing, invalid or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"402":{"description":"Insufficient available USD balance or spending is frozen.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"403":{"description":"The account is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"404":{"description":"Unknown media model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"409":{"description":"The idempotency key belongs to different request content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"413":{"description":"The request exceeds the body limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"415":{"description":"Use uncompressed application/json.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"429":{"description":"Rate limit or outstanding-job limit reached. Wait before polling or submitting more work.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"503":{"description":"Media generation is unavailable or this model is not enabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}}}}},"/jobs/{id}":{"get":{"operationId":"getMediaJob","tags":["Media"],"summary":"Read your media job","parameters":[{"name":"id","in":"path","required":true,"description":"The API Many job ID returned when the job was accepted.","schema":{"type":"string","format":"uuid"}}],"description":"Returns the current job receipt. Poll with a delay while queued or running. output is empty until successful content is available and becomes empty after its 24-hour retention period. A receipt can remain accessible after new generation is disabled.","responses":{"200":{"description":"The authenticated account’s job receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaJob"}}}},"401":{"description":"Use a valid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"403":{"description":"The account is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"404":{"description":"The job was not found for this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"503":{"description":"Job lookup is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}}}}},"/jobs/{id}/content":{"get":{"operationId":"getMediaContent","tags":["Media"],"summary":"Download your completed media","parameters":[{"name":"id","in":"path","required":true,"description":"The API Many job ID returned when the job was accepted.","schema":{"type":"string","format":"uuid"}}],"description":"Requires an active API key belonging to the job owner. Downloads one file directly from API Many, with no redirect. Content expires 24 hours after successful settlement (completed_at); download it before then. Range/resume support is not promised.","responses":{"200":{"description":"One completed image or MP4 video attachment. Response is private and not cacheable.","headers":{"Content-Disposition":{"schema":{"type":"string"},"description":"An attachment with a generic result filename."},"Cache-Control":{"schema":{"type":"string","const":"private, no-store, max-age=0"}}},"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Use a valid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"403":{"description":"The account is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"404":{"description":"Content is not available for this account, is not completed, or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}},"503":{"description":"The media download is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaError"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Create a key in the API Many dashboard. Keep it in server-side secret storage."}},"schemas":{"Model":{"oneOf":[{"$ref":"#/components/schemas/ChatModel"},{"$ref":"#/components/schemas/MediaModel"}]},"ChatModel":{"type":"object","additionalProperties":false,"required":["id","object","created","owned_by","operation","context_window","max_input_tokens","max_output_tokens","pricing"],"properties":{"id":{"type":"string","description":"Stable public model ID used in chat requests."},"object":{"type":"string","const":"model"},"created":{"type":"integer","description":"Unix timestamp for this public catalog definition."},"owned_by":{"type":"string","description":"Model-family owner identifier; this identifies the model brand only."},"operation":{"type":"string","const":"chat.completions","description":"Stable public operation contract implemented by this model."},"context_window":{"type":"integer","minimum":1},"max_input_tokens":{"type":"integer","minimum":1},"max_output_tokens":{"type":"integer","minimum":1},"pricing":{"type":"object","additionalProperties":false,"required":["currency","billing_unit","input_usd_per_million_tokens","output_usd_per_million_tokens","version"],"description":"The published customer input and output rates for this model.","properties":{"currency":{"type":"string","const":"USD"},"billing_unit":{"type":"string","const":"1M_tokens"},"input_usd_per_million_tokens":{"type":"number","minimum":0,"multipleOf":0.000001},"output_usd_per_million_tokens":{"type":"number","minimum":0,"multipleOf":0.000001},"version":{"type":"string","pattern":"^[0-9a-f]{16}$","description":"Identifies the public model and customer price contract. Internal configuration changes do not affect this version."}}}}},"MediaModel":{"type":"object","additionalProperties":false,"required":["id","object","created","owned_by","operation","input","output","pricing"],"properties":{"id":{"type":"string","description":"Public media model ID; submit to POST /jobs."},"object":{"type":"string","const":"model"},"created":{"type":"integer"},"owned_by":{"type":"string","description":"Model brand only."},"operation":{"type":"string","const":"media_job"},"input":{"type":"object","additionalProperties":false,"required":["prompt"],"properties":{"prompt":{"type":"boolean","const":true}}},"output":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","count","width","height"],"properties":{"kind":{"type":"string","const":"image"},"count":{"type":"integer","const":1},"width":{"type":"integer","const":512},"height":{"type":"integer","const":512}}},{"type":"object","additionalProperties":false,"required":["kind","count","resolution","aspect_ratio","frames","frames_per_second","audio"],"properties":{"kind":{"type":"string","const":"video"},"count":{"type":"integer","const":1},"resolution":{"type":"string","const":"480p"},"aspect_ratio":{"type":"string","const":"16:9","description":"Model-compatible dimensions approximate 16:9."},"frames":{"type":"integer","const":81},"frames_per_second":{"type":"integer","const":16},"audio":{"type":"boolean","const":false}}}]},"pricing":{"type":"object","additionalProperties":false,"required":["currency","billing_unit","credits","usd","version"],"properties":{"currency":{"type":"string","const":"usd"},"billing_unit":{"type":"string","const":"job"},"credits":{"type":"integer","minimum":1},"usd":{"type":"number","minimum":0},"version":{"type":"string","pattern":"^[0-9a-f]{16}$","description":"Identifies the public model and customer price contract."}}}}},"MediaJobRequest":{"type":"object","additionalProperties":false,"required":["model","prompt"],"properties":{"model":{"type":"string","minLength":2,"maxLength":128,"pattern":"^[a-z0-9][a-z0-9._/-]{1,127}$","description":"Use an enabled media_job model from GET /models."},"prompt":{"type":"string","minLength":1,"maxLength":8000,"description":"Non-blank text, at most 8,000 UTF-8 bytes. No control characters except tab, line feed and carriage return. Dimensions, duration, input images and other options are not accepted."}}},"MediaJob":{"type":"object","additionalProperties":false,"required":["id","object","model","status","cost","output","error","created_at","completed_at"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"apimany.job"},"model":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","reconciliation_required","canceled"]},"cost":{"type":"object","additionalProperties":false,"required":["usd","reserved_usd","currency","credits","reserved_credits"],"properties":{"usd":{"type":["number","null"],"minimum":0},"reserved_usd":{"type":"number","minimum":0},"currency":{"type":"string","const":"usd"},"credits":{"type":["integer","null"],"minimum":0,"description":"Final billed credits, or null while unsettled."},"reserved_credits":{"type":"integer","minimum":1,"description":"Original reservation amount; retained in the receipt after settlement."}}},"output":{"type":"array","maxItems":1,"description":"Empty until content is available, and empty after content expires.","items":{"type":"object","additionalProperties":false,"required":["url","mime_type"],"properties":{"url":{"type":"string","pattern":"^/v1/jobs/[0-9a-f-]{36}/content$","description":"Relative authenticated API Many download URL; never a public signed link."},"mime_type":{"type":"string","enum":["image/jpeg","image/webp","video/mp4"]}}}},"error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/MediaErrorDetail"}]},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time","description":"For a successful job, content expires 24 hours after this timestamp."}}},"MediaErrorDetail":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"MediaError":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"$ref":"#/components/schemas/MediaErrorDetail"}}},"ModelList":{"type":"object","additionalProperties":false,"required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}},"ChatMessage":{"type":"object","additionalProperties":false,"required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string","description":"Text content. Multimodal content arrays are not supported."},"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]{1,64}$"}}},"ChatCompletionRequest":{"type":"object","additionalProperties":false,"required":["model","messages"],"properties":{"model":{"type":"string","description":"Use a chat.completions ID returned by GET /models.","examples":["openai/gpt-5.4-mini"]},"messages":{"type":"array","minItems":1,"maxItems":200,"description":"The combined UTF-8 message content is limited by the gateway.","items":{"$ref":"#/components/schemas/ChatMessage"}},"stream":{"type":"boolean","const":false,"default":false,"description":"Streaming is not supported. Omit this field or send false; true is rejected."},"max_tokens":{"type":"integer","minimum":1,"description":"Maximum output tokens; the upper bound is model-specific."},"max_completion_tokens":{"type":"integer","minimum":1,"description":"Alias for max_tokens. If both are sent, their values must match."},"temperature":{"type":"number","minimum":0,"maximum":2,"description":"Optional; support depends on the model. Omit for the minimal portable request."},"top_p":{"type":"number","minimum":0,"maximum":1,"description":"Optional; support depends on the model."},"presence_penalty":{"type":"number","minimum":-2,"maximum":2},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2},"stop":{"oneOf":[{"type":"string","maxLength":200},{"type":"array","minItems":1,"maxItems":4,"items":{"type":"string","maxLength":200}}]},"seed":{"type":"integer"},"user":{"type":"string","maxLength":256},"n":{"type":"integer","const":1,"default":1}}},"AssistantMessage":{"type":"object","additionalProperties":false,"required":["role","content"],"properties":{"role":{"type":"string","const":"assistant"},"content":{"type":["string","null"]},"refusal":{"type":["string","null"]}}},"ChatChoice":{"type":"object","additionalProperties":false,"required":["index","message","finish_reason"],"properties":{"index":{"type":"integer","const":0},"message":{"$ref":"#/components/schemas/AssistantMessage"},"finish_reason":{"type":["string","null"],"enum":["stop","length","content_filter",null]}}},"Usage":{"type":"object","additionalProperties":false,"required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0}}},"ChatCompletion":{"type":"object","additionalProperties":false,"required":["id","object","created","model","choices"],"properties":{"id":{"type":"string","description":"API Many completion identifier, stable for idempotent replay.","pattern":"^chatcmpl-apimany-"},"object":{"type":"string","const":"chat.completion"},"created":{"type":"integer"},"model":{"type":"string","description":"The stable API Many public model ID."},"choices":{"type":"array","minItems":1,"maxItems":1,"items":{"$ref":"#/components/schemas/ChatChoice"}},"usage":{"$ref":"#/components/schemas/Usage"}}},"Error":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"object","additionalProperties":false,"required":["message","type","param","code"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":"string"}}}}}},"responses":{"BadRequest":{"description":"Invalid or unsupported request. This includes stream=true.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"The API key is missing, invalid, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"AccountSuspended":{"description":"The account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InsufficientBalance":{"description":"The account cannot reserve enough USD balance for the request ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ModelNotFound":{"description":"The model does not exist or is not enabled for this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"The idempotency key was reused with different request content or the existing request cannot be replayed yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RequestTooLarge":{"description":"The combined UTF-8 message content exceeds the gateway limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UnsupportedMediaType":{"description":"The body is not uncompressed application/json.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"The account or service is rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServerError":{"description":"The gateway could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RequestFailure":{"description":"The request failed, or its outcome is uncertain and is being reconciled instead of submitted again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"The requested model is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}