{"openapi":"3.1.0","info":{"title":"Classai Router API","version":"1.0.0","description":"OpenAI-compatible API for chat models, text-to-speech, images and videos on one key and one prepaid credit balance. Failed requests are not charged. MCP server: https://router.classai.id/mcp. Human docs: https://router.classai.id/docs."},"servers":[{"url":"https://router.classai.id/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"sk_live_… key from the dashboard"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]}}}}},"Video":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"video"},"model":{"type":"string"},"status":{"enum":["in_progress","completed","failed"]},"url":{"type":"string","description":"Signed download link, valid 24 h (when completed)"},"error":{"type":"object","properties":{"message":{"type":"string"}}}}}}},"paths":{"/chat/completions":{"post":{"summary":"Chat completion (OpenAI format)","operationId":"createChatCompletion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"type":"object"}},"stream":{"type":"boolean"},"max_tokens":{"type":"integer"},"temperature":{"type":"number"},"tools":{"type":"array"}}}}}},"responses":{"200":{"description":"Completion (or SSE stream when stream: true)"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/models":{"get":{"summary":"Chat models for this key","operationId":"listModels","responses":{"200":{"description":"OpenAI model list"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages":{"post":{"summary":"Message (Anthropic Messages format) — the same models and billing as /chat/completions; tool use, images and streaming supported","operationId":"createMessage","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages","max_tokens"],"properties":{"model":{"type":"string"},"system":{},"messages":{"type":"array","items":{"type":"object"}},"max_tokens":{"type":"integer"},"stream":{"type":"boolean"},"tools":{"type":"array"}}}}}},"responses":{"200":{"description":"Anthropic message (or SSE stream when stream: true)"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/responses":{"post":{"summary":"Response (OpenAI Responses format, stateless): input + function tools; previous_response_id and built-in tools are not supported","operationId":"createResponse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"input":{},"instructions":{"type":"string"},"stream":{"type":"boolean"},"tools":{"type":"array"}}}}}},"responses":{"200":{"description":"Response object (or SSE stream)"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/account":{"get":{"summary":"The key's account: live credit balance, running packages — never billed","operationId":"getAccount","responses":{"200":{"description":"{ user, key, limits: { plan, requestsPerMinutePerKey, requestsPerMinutePerAccount }, balance: { credits, label, idr }, … }"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audio/speech":{"post":{"summary":"Text to speech","operationId":"createSpeech","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input","voice"],"properties":{"model":{"type":"string","enum":["voxcpm2","dots-tts","elevenlabs-v4","elevenlabs-v4-turbo","elevenlabs-flash","elevenlabs-v2","openai-tts","openai-tts-hd"]},"input":{"type":"string"},"voice":{"type":"string","description":"From GET /audio/voices?model=…, or clone:<id>"},"response_format":{"enum":["mp3","wav"],"default":"mp3"},"speed":{"type":"number","minimum":0.7,"maximum":1.2},"style":{"enum":["natural","narasi","iklan","santai","berita","edukasi"]},"normalize":{"type":"boolean","description":"false = no automatic Indonesian spelling"}}}}}},"responses":{"200":{"description":"Audio file","content":{"audio/mpeg":{},"audio/wav":{}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audio/voices":{"get":{"summary":"Voice engines, or one engine's voices (your clones: cloned true)","operationId":"listVoices","parameters":[{"name":"model","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"List"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Clone a voice (needs a consent recording by the voice's owner)","operationId":"createVoice","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","consent","agree","name","model"],"properties":{"file":{"type":"string","format":"binary","description":"Voice sample: WAV, MP3, M4A or WebM, 3–60 s (whole request ≤ 10 MB)"},"consent":{"type":"string","format":"binary","description":"The voice's owner reading: \"I, <name>, the owner of this voice, allow Classai to create an AI voice from my voice for the account <account email> on <date>.\""},"agree":{"const":"true","description":"The voice is yours, or you have its owner's permission"},"name":{"type":"string","minLength":2,"maxLength":60},"model":{"type":"string","enum":["voxcpm2","dots-tts","elevenlabs-v4","elevenlabs-v4-turbo","elevenlabs-flash","elevenlabs-v2"]},"owner":{"type":"string","description":"Name of the voice's owner (default: account name)"},"transcript":{"type":"string","description":"What is said in the sample (optional, improves some engines)"}}}},"application/json":{"schema":{"type":"object","required":["audio","consent_audio","agree","name","model"],"properties":{"audio":{"type":"string","description":"data:audio/…;base64,…"},"consent_audio":{"type":"string"},"agree":{"type":"boolean"},"name":{"type":"string"},"model":{"type":"string"},"owner":{"type":"string"},"transcript":{"type":"string"}}}}}},"responses":{"200":{"description":"{object: voice, id: clone:<id>, name, model, created_at, sample_seconds, clone_fee_rp}"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audio/voices/{id}":{"delete":{"summary":"Delete one of your cloned voices","operationId":"deleteVoice","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"clone:<id>"}],"responses":{"200":{"description":"{object: voice, id, deleted: true}"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/images/generations":{"post":{"summary":"Generate or edit images (synchronous, 5 s – 4 min)","operationId":"createImage","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","enum":["nano-banana-pro","nano-banana-2.1","nano-banana-2","nano-banana-2-lite","nano-banana","gpt-image-2.5-flare","gpt-image-2.5-sunburst","gpt-image-2","gpt-image-1.5","chatgpt-image","gpt-image-1","gpt-image-1-mini","gpt-image-2.5","mai-image-2.6","mai-image-2.6-flash","seedream-5-pro","seedream-5","seedream-5-flash","seedream-4.5","seedream-4","flux-2-max","flux-2-pro","flux-2-flex","flux-2-klein","flux-1-dev","flux-kontext-max","flux-kontext-pro"]},"prompt":{"type":"string","maxLength":4000},"aspect_ratio":{"enum":["1:1","4:5","3:4","2:3","9:16","4:3","3:2","16:9","21:9"]},"size":{"type":"string","description":"Alternative to aspect_ratio, e.g. 1024x1536"},"resolution":{"enum":["1K","2K","3K","4K"]},"quality":{"enum":["low","medium","high"],"description":"Official OpenAI models only (gpt-image-*, chatgpt-image); default medium"},"n":{"type":"integer","minimum":1,"maximum":4},"image":{"type":"array","items":{"type":"string"},"description":"Reference images: https URLs or data URIs (≤ 10 MB each); flux-kontext-* need exactly one"},"response_format":{"enum":["b64_json","url"],"default":"b64_json"}}}}}},"responses":{"200":{"description":"{created, data: [{b64_json?, url}]}"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/images/edits":{"post":{"summary":"Edit images (OpenAI multipart)","operationId":"editImage","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["model","prompt","image"],"properties":{"model":{"type":"string","enum":["nano-banana-pro","nano-banana-2.1","nano-banana-2","nano-banana-2-lite","nano-banana","gpt-image-2.5-flare","gpt-image-2.5-sunburst","gpt-image-2","gpt-image-1.5","chatgpt-image","gpt-image-1","gpt-image-1-mini","gpt-image-2.5","mai-image-2.6","mai-image-2.6-flash","seedream-5-pro","seedream-5","seedream-5-flash","seedream-4.5","seedream-4","flux-2-max","flux-2-pro","flux-2-flex","flux-2-klein","flux-kontext-max","flux-kontext-pro"]},"prompt":{"type":"string"},"image":{"type":"string","format":"binary"},"size":{"type":"string"},"quality":{"enum":["low","medium","high"]},"response_format":{"enum":["b64_json","url"]}}}}}},"responses":{"200":{"description":"{created, data: [...]}"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/videos":{"post":{"summary":"Start a video (poll GET /videos/{id})","operationId":"createVideo","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","enum":["veo-3.1-fast","veo-3.1","seedance-2.5","seedance-2.0","seedance-2.0-fast","seedance-2.0-mini","wan-3.0","wan-3.0-prime","wan-2.7","happyhorse-1.1","minimax-h3","oxygen-1.0"]},"prompt":{"type":"string","maxLength":4000},"aspect_ratio":{"enum":["16:9","9:16","1:1","4:3","3:4","21:9"]},"resolution":{"enum":["480p","720p","768p","1080p"]},"seconds":{"type":["integer","string"],"description":"Veo: 4, 6 or 8. Others: whole seconds within the model's range (GET /media/models seconds_range)."},"input_reference":{"type":"string","description":"Start image: https URL or data URI (or a multipart file)"}}}}}},"responses":{"200":{"description":"Task","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/videos/{id}":{"get":{"summary":"Video status","operationId":"getVideo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Video","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/videos/{id}/content":{"get":{"summary":"Download the MP4","operationId":"getVideoContent","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"MP4","content":{"video/mp4":{}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/models":{"get":{"summary":"Image & video models with prices","operationId":"listMediaModels","responses":{"200":{"description":"List"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/embeddings":{"post":{"summary":"Create embeddings (OpenAI format)","operationId":"createEmbedding","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","enum":["text-embedding-3-small","text-embedding-3-large","text-embedding-ada-002","bge-m3"]},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"},"maxItems":2048}]},"dimensions":{"type":"integer","description":"text-embedding-3-* only"},"encoding_format":{"enum":["float","base64"],"default":"float"}}}}}},"responses":{"200":{"description":"{object: list, data: [{object: embedding, index, embedding}], model, usage}"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rerank":{"post":{"summary":"Rerank documents against a query","operationId":"createRerank","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","query","documents"],"properties":{"model":{"type":"string","enum":["bge-reranker-v2-m3"]},"query":{"type":"string"},"documents":{"type":"array","items":{"type":"string"},"maxItems":1000},"top_n":{"type":"integer","minimum":0,"description":"0 or omitted = all"}}}}}},"responses":{"200":{"description":"{results: [{index, relevance_score, document: {text}}], usage}"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/moderations":{"post":{"summary":"Classify text for harmful content (OpenAI format)","operationId":"createModeration","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"model":{"type":"string","enum":["omni-moderation-latest"],"default":"omni-moderation-latest"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}}}}}},"responses":{"200":{"description":"{id, model, results: [{flagged, categories, category_scores}], usage}"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}