{"openapi":"3.1.0","info":{"title":"Adola Inference API","version":"1.2.1","description":"OpenAI-compatible chat completions with model selection, streaming, usage, and billing metadata."},"servers":[{"url":"https://api.adola.app"}],"paths":{"/v1/catalog":{"get":{"summary":"Read the public model and price catalog","operationId":"getCatalog","security":[],"responses":{"200":{"description":"Current public model catalog and pricing version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"503":{"description":"Model catalog temporarily unavailable.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models":{"get":{"summary":"List supported models","operationId":"listModels","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/RequestId"}],"responses":{"200":{"description":"Current model catalog.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}},"401":{"description":"Missing bearer key.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid or revoked bearer key.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Project rate limit exceeded.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Authentication service unavailable.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chat/completions":{"post":{"summary":"Create a chat completion","description":"Send OpenAI-style messages. Set stream=true for OpenAI-compatible SSE deltas and a final usage event.","operationId":"chatCompletions","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/RequestId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"Chat completion with standard usage and Adola billing status.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"},"X-Adola-Metering-Status":{"$ref":"#/components/headers/MeteringStatus"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Unsupported chat option.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing bearer key.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Workspace quota exceeded or billing disabled.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid or revoked bearer key.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Malformed JSON, invalid fields, unsupported model, or request too large.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Project rate limit exceeded.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Inference service returned an invalid response.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Inference service unavailable.","headers":{"X-Request-ID":{"$ref":"#/components/headers/RequestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Adola project API key"}},"parameters":{"RequestId":{"name":"X-Request-ID","in":"header","required":false,"description":"Optional correlation id. Values longer than 128 characters are replaced.","schema":{"type":"string","maxLength":128}}},"headers":{"RequestId":{"description":"Accepted or generated request correlation id.","schema":{"type":"string"}},"MeteringStatus":{"description":"Whether usage recording succeeded.","schema":{"type":"string","enum":["persisted","degraded","not_applicable"]}}},"schemas":{"Model":{"type":"object","required":["id","name","context_length","input_price_per_mtok","output_price_per_mtok","minimum_request_charge_usd"],"properties":{"id":{"type":"string","enum":["gpt-oss-120b","qwen3-30b","llama-3.3-70b","deepseek-v4-flash"]},"name":{"type":"string"},"context_length":{"type":"integer"},"input_price_per_mtok":{"type":"number"},"output_price_per_mtok":{"type":"number"},"minimum_request_charge_usd":{"type":"number","description":"Minimum charge in USD for a successfully metered request using this model."}}},"CatalogModel":{"allOf":[{"$ref":"#/components/schemas/Model"},{"type":"object","required":["blurb","is_default"],"properties":{"blurb":{"type":"string"},"is_default":{"type":"boolean"}}}]},"Catalog":{"type":"object","required":["pricing_version","collection_threshold_cents","models"],"properties":{"pricing_version":{"type":"integer","example":4},"collection_threshold_cents":{"type":"integer","minimum":1,"example":500},"models":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModel"}}}},"Message":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool","function"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object","additionalProperties":true}}]},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":true}}},"additionalProperties":true},"ChatCompletionRequest":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","default":"gpt-oss-120b"},"messages":{"type":"array","minItems":1,"maxItems":256,"items":{"$ref":"#/components/schemas/Message"}},"max_tokens":{"type":"integer","minimum":1,"maximum":16384,"default":512},"temperature":{"type":"number","minimum":0,"maximum":2,"default":0},"stream":{"type":"boolean","default":false}},"additionalProperties":true},"Usage":{"type":"object","required":["prompt_tokens","completion_tokens","total_tokens"],"properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}},"Metering":{"type":"object","required":["persisted","status"],"properties":{"persisted":{"type":"boolean"},"status":{"type":"string","enum":["persisted","degraded","not_applicable"]}}},"Billing":{"type":"object","required":["input_price_per_mtok","output_price_per_mtok","minimum_request_charge_usd","minimum_applied","request_cost_usd"],"properties":{"input_price_per_mtok":{"type":"number","example":0.14},"output_price_per_mtok":{"type":"number","example":0.57},"minimum_request_charge_usd":{"type":"number","description":"The selected model's successful-request minimum in USD.","example":0.001},"minimum_applied":{"type":"boolean","description":"Whether the request minimum determined the final request cost.","example":true},"request_cost_usd":{"type":"number","description":"The greater of the token subtotal and the selected model's request minimum.","example":0.001}}},"AdolaMetadata":{"type":"object","required":["billing","metering"],"properties":{"billing":{"$ref":"#/components/schemas/Billing"},"metering":{"$ref":"#/components/schemas/Metering"}}},"ChatCompletionResponse":{"type":"object","required":["id","object","created","model","choices","usage","adola"],"properties":{"id":{"type":"string"},"object":{"type":"string"},"created":{"type":"integer"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","additionalProperties":true}},"usage":{"$ref":"#/components/schemas/Usage"},"adola":{"$ref":"#/components/schemas/AdolaMetadata"}}},"Error":{"type":"object","required":["detail"],"properties":{"detail":{"oneOf":[{"type":"string"},{"type":"array","items":{"$ref":"#/components/schemas/ValidationIssue"}}]}}},"ValidationIssue":{"type":"object","required":["type","loc","msg"],"properties":{"type":{"type":"string"},"loc":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"type":"string"},"input":{},"ctx":{"type":"object","additionalProperties":true}},"additionalProperties":true}}}}