{"openapi":"3.1.0","info":{"title":"CHUA ONE Public Inference API","version":"2026-11-23","description":"Public, project-key-scoped CHUA ONE inference endpoints. Model-specific support and current prices are published in the model market."},"servers":[{"url":"https://chuaone.si"}],"tags":[{"name":"Models"},{"name":"Text"},{"name":"Images"},{"name":"Videos"}],"paths":{"/v1/models":{"get":{"tags":["Models"],"operationId":"listModels","summary":"List models visible to the project key","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Model list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"},"example":{"object":"list","data":[{"id":"published-model-slug","object":"model","created":0,"owned_by":"chua-token-hub"}]}}}},"401":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"403":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"503":{"description":"Request error. Inspect the HTTP status and returned error envelope."}}}},"/v1/chat/completions":{"post":{"tags":["Text"],"operationId":"createChatCompletion","summary":"Create an OpenAI-compatible chat completion","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Completion JSON or server-sent event stream","headers":{"X-CHUA-Request-ID":{"description":"Recorded CHUA ONE request receipt when available.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"},"example":{"id":"chatcmpl_receipt","object":"chat.completion","model":"published-model-slug","choices":[{"index":0,"message":{"role":"assistant","content":"Example response."},"finish_reason":"stop"}],"usage":{"prompt_tokens":8,"completion_tokens":3,"total_tokens":11}}}}},"400":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"401":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"403":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"409":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"429":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"500":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"502":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"503":{"description":"Request error. Inspect the HTTP status and returned error envelope."}}}},"/v1/responses":{"post":{"tags":["Text"],"operationId":"createResponse","summary":"Create a Responses-compatible response","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Recommended. CHUA ONE derives a stable fallback for supported native clients when omitted."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}}},"responses":{"200":{"description":"Response JSON or Responses-compatible event stream","headers":{"X-CHUA-Request-ID":{"description":"Recorded CHUA ONE request receipt when available.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseObject"},"example":{"id":"resp_receipt","object":"response","status":"completed","model":"published-model-slug","output":[{"type":"message","role":"assistant","content":[{"type":"output_text","text":"Example response.","annotations":[]}]}],"usage":{"input_tokens":8,"output_tokens":3,"total_tokens":11}}}}},"400":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"401":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"403":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"409":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"429":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"500":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"502":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"503":{"description":"Request error. Inspect the HTTP status and returned error envelope."}}}},"/v1/messages":{"post":{"tags":["Text"],"operationId":"createMessage","summary":"Create an Anthropic-compatible message","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"anthropic-version","in":"header","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Recommended. CHUA ONE derives a stable fallback for compatible clients when omitted."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagesRequest"}}}},"responses":{"200":{"description":"Message JSON or Anthropic-compatible event stream","headers":{"X-CHUA-Request-ID":{"description":"Recorded CHUA ONE request receipt when available.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageObject"},"example":{"id":"msg_receipt","type":"message","role":"assistant","model":"published-model-slug","content":[{"type":"text","text":"Example response."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":8,"output_tokens":3}}}}},"400":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"401":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"403":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"409":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"429":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"500":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"502":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"503":{"description":"Request error. Inspect the HTTP status and returned error envelope."}}}},"/v1/images/generations":{"post":{"tags":["Images"],"operationId":"createImage","summary":"Generate one image","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageRequest"}}}},"responses":{"200":{"description":"One Base64 image and confirmed usage","headers":{"X-CHUA-Request-ID":{"description":"Recorded CHUA ONE request receipt when available.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageResult"},"example":{"created":1790000000,"data":[{"b64_json":"<base64-image>"}],"size":"1024x1024","usage":{"input_tokens":12,"output_tokens":4096,"total_tokens":4108}}}}},"400":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"401":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"403":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"409":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"429":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"500":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"502":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"503":{"description":"Request error. Inspect the HTTP status and returned error envelope."}}}},"/v1/videos/generations":{"post":{"tags":["Videos"],"operationId":"createVideo","summary":"Create an asynchronous video task","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoRequest"}}}},"responses":{"202":{"description":"Task accepted with reservation","headers":{"X-CHUA-Request-ID":{"description":"Recorded CHUA ONE request receipt when available.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoAccepted"},"example":{"id":"00000000-0000-4000-8000-000000000000","model":"published-video-model-slug","status":"queued","reserved_micros":100000,"currency":"USD"}}}},"400":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"401":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"403":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"409":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"429":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"500":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"502":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"503":{"description":"Request error. Inspect the HTTP status and returned error envelope."}}}},"/v1/videos/{id}":{"get":{"tags":["Videos"],"operationId":"getVideo","summary":"Read an existing video task","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current task state, delivery, usage, and settled charge when available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoStatus"},"example":{"id":"00000000-0000-4000-8000-000000000000","model":"published-video-model-slug","status":"succeeded","charged_micros":95000,"currency":"USD","content":{"video_url":"https://supplier.example/video.mp4"},"usage":{"output_seconds":5},"delivery_note":"Time-limited supplier URL; save the video promptly."}}}},"401":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"403":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"404":{"description":"Request error. Inspect the HTTP status and returned error envelope."},"503":{"description":"Request error. Inspect the HTTP status and returned error envelope."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"CHUA ONE project API key"},"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"ModelList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","required":["id","object","created","owned_by"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"created":{"const":0},"owned_by":{"const":"chua-token-hub"}}}}}},"TokenUsage":{"type":"object","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","required":["id","object","model","choices","usage"],"properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","required":["index","message"],"properties":{"index":{"type":"integer"},"message":{"type":"object","required":["role"],"properties":{"role":{"const":"assistant"},"content":{"type":["string","null"]},"tool_calls":{"type":"array","items":{"type":"object"}}}},"finish_reason":{"type":["string","null"]}}}},"usage":{"$ref":"#/components/schemas/TokenUsage"}}},"ResponseObject":{"type":"object","required":["id","object","status","output","usage"],"properties":{"id":{"type":"string"},"object":{"const":"response"},"status":{"type":"string","enum":["completed","incomplete"]},"model":{"type":"string"},"output":{"type":"array","items":{"type":"object"}},"usage":{"type":"object","required":["input_tokens","output_tokens","total_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0}}},"incomplete_details":{"type":"object"}}},"MessageObject":{"type":"object","required":["id","type","role","model","content","usage"],"properties":{"id":{"type":"string"},"type":{"const":"message"},"role":{"const":"assistant"},"model":{"type":"string"},"content":{"type":"array","items":{"type":"object"}},"stop_reason":{"type":["string","null"]},"stop_sequence":{"type":["string","null"]},"usage":{"type":"object","required":["input_tokens","output_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"cache_read_input_tokens":{"type":"integer","minimum":0},"cache_creation_input_tokens":{"type":"integer","minimum":0}}}}},"ImageResult":{"type":"object","required":["data","size","usage"],"properties":{"created":{"type":"integer"},"data":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","required":["b64_json"],"properties":{"b64_json":{"type":"string","contentEncoding":"base64"}}}},"size":{"type":"string"},"usage":{"type":"object","required":["input_tokens","output_tokens","total_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"output_tokens_details":{"type":"object"}}}}},"VideoAccepted":{"type":"object","required":["id","model","status","reserved_micros","currency"],"properties":{"id":{"type":"string","format":"uuid"},"model":{"type":"string"},"status":{"const":"queued"},"reserved_micros":{"type":"integer","minimum":0},"currency":{"type":"string"}}},"VideoStatus":{"type":"object","required":["id","model","status","charged_micros","currency"],"properties":{"id":{"type":"string","format":"uuid"},"model":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","review"]},"charged_micros":{"type":"integer","minimum":0},"charged_atomic":{"type":"string","pattern":"^[0-9]+$"},"currency":{"type":"string"},"content":{"type":"object","required":["video_url"],"properties":{"video_url":{"type":"string","format":"uri"}}},"usage":{"type":"object","properties":{"output_seconds":{"type":"integer","minimum":0},"completion_tokens":{"type":"integer","minimum":0}}},"delivery_note":{"type":"string"}}},"ChatRequest":{"type":"object","additionalProperties":false,"required":["model","messages","max_tokens"],"properties":{"model":{"type":"string","minLength":1,"maxLength":255},"messages":{"type":"array","minItems":1,"maxItems":128,"items":{"type":"object","additionalProperties":false,"required":["role"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"oneOf":[{"type":"string","maxLength":500000},{"type":"null"},{"type":"array","minItems":1,"maxItems":32,"items":{"type":"object"}}]},"tool_call_id":{"type":"string","maxLength":200},"tool_calls":{"type":"array","maxItems":64,"items":{"type":"object"}}}}},"max_tokens":{"type":"integer","minimum":1,"maximum":131072},"stream":{"type":"boolean","default":false},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"tools":{"type":"array","maxItems":64,"items":{"type":"object"}},"tool_choice":{},"response_format":{},"free_terms_version":{"type":"string","maxLength":80}}},"ResponsesRequest":{"type":"object","additionalProperties":false,"required":["model","input"],"properties":{"model":{"type":"string","minLength":1},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"instructions":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"max_output_tokens":{"type":"integer","minimum":1,"maximum":131072,"default":1024},"stream":{"type":"boolean","default":false},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"tools":{"type":"array","maxItems":128,"items":{"type":"object"}},"tool_choice":{},"text":{"type":"object"},"store":{"const":false},"parallel_tool_calls":{"const":true},"reasoning":{"type":"object"},"include":{},"prompt_cache_key":{"type":"string","minLength":1,"maxLength":255},"client_metadata":{"type":"object"}}},"MessagesRequest":{"type":"object","additionalProperties":false,"required":["model","messages","max_tokens"],"properties":{"model":{"type":"string","minLength":1},"messages":{"type":"array","minItems":1,"items":{"type":"object"}},"max_tokens":{"type":"integer","minimum":1,"maximum":131072},"system":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"stream":{"type":"boolean","default":false},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"tools":{"type":"array","items":{"type":"object"}},"tool_choice":{},"metadata":{"type":"object"},"thinking":{"type":"object"},"context_management":{"type":"object"},"output_config":{"type":"object"}}},"ImageRequest":{"type":"object","additionalProperties":false,"required":["model","prompt"],"properties":{"model":{"type":"string","description":"Published image model slug."},"prompt":{"type":"string","minLength":1,"maxLength":800},"n":{"const":1,"default":1},"size":{"type":"string","enum":["1024x1024","2048x2048","auto"],"description":"Must equal the selected model specification."},"quality":{"type":"string","enum":["low","standard"],"description":"Must equal the selected model specification."}}},"VideoRequest":{"type":"object","additionalProperties":false,"required":["model","prompt"],"description":"Conditional requirements are model-specific: HappyHorse requires duration 3 and 720p; Wan requires duration 5 and 480p; Seedance/Dreamina routes require duration 4, 480p, ratio 16:9, and generate_audio false. image_url is route-dependent.","properties":{"model":{"type":"string","description":"Published video model slug."},"prompt":{"type":"string","minLength":1,"maxLength":800},"duration":{"type":"integer","enum":[3,4,5],"description":"Exact value is model-specific."},"resolution":{"type":"string","enum":["480p","720p"],"description":"Exact value is model-specific."},"ratio":{"const":"16:9"},"generate_audio":{"const":false},"image_url":{"type":"string","format":"uri","pattern":"^https://","maxLength":4096,"description":"Required only by supported image-to-video routes; public HTTPS URL."}}}}}}