{"openapi":"3.1.0","info":{"title":"ModelOne API","version":"1.0.0","summary":"Text chat completions for the ModelOne model allowlist.","description":"Bearer authentication with a ModelOne API key. Completions stay disabled until the server enables inference. Prices and model ids come from the server allowlist."},"servers":[{"url":"https://modelone.app/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Models"},{"name":"Chat"}],"paths":{"/models":{"get":{"operationId":"listModels","tags":["Models"],"summary":"List allowlisted models","responses":{"200":{"description":"The allowlist and whether inference calls are enabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/chat/completions":{"post":{"operationId":"createChatCompletion","tags":["Chat"],"summary":"Create a text chat completion","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"},"example":{"model":"openai/gpt-4.1-mini","messages":[{"role":"user","content":"Reply with one short sentence."}],"max_tokens":64,"stream":false}}}},"responses":{"200":{"description":"A JSON completion, or text/event-stream when stream is true.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A ModelOne API key from the account keys page. Send it only from a server."}},"responses":{"Error":{"description":"A ModelOne error object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"ChatRequest":{"type":"object","additionalProperties":false,"required":["model","messages"],"properties":{"model":{"type":"string","description":"An id returned by GET /models.","examples":["openai/gpt-4.1-mini"]},"messages":{"type":"array","minItems":1,"maxItems":32,"items":{"$ref":"#/components/schemas/Message"}},"max_tokens":{"type":"integer","minimum":1,"description":"Billable output cap for this request, including reasoning tokens when a model produces them. Defaults to 1024 or the model cap, whichever is lower."},"stream":{"type":"boolean","description":"When true, the response is Server-Sent Events."}}},"Message":{"type":"object","additionalProperties":false,"required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string","minLength":1,"maxLength":8000}}},"ChatCompletion":{"type":"object","required":["id","object","model","choices","modelone"],"properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"created":{"type":"integer"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object"}},"usage":{"type":["object","null"]},"modelone":{"$ref":"#/components/schemas/Settlement"}}},"Settlement":{"type":"object","required":["settlement"],"properties":{"settlement":{"type":"string","enum":["settled","unknown"]},"settled_microusd":{"type":["string","null"]},"reserved_microusd":{"type":"string"},"available_microusd":{"type":["string","null"]}}},"ModelList":{"type":"object","required":["object","inference_enabled","data"],"properties":{"object":{"const":"list"},"inference_enabled":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}},"Model":{"type":"object","required":["id","object","context_length","max_output_tokens"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"owned_by":{"type":"string","enum":["openai","anthropic"]},"context_length":{"type":"integer"},"max_output_tokens":{"type":"integer"},"pricing":{"type":"object"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","code"],"properties":{"message":{"type":"string"},"type":{"type":"string","enum":["invalid_request_error","rate_limit_error"]},"code":{"type":"string","enum":["disabled","invalid","unauthorized","forbidden","quota","limited","upstream","storage"]}}}}}}},"x-modelone-request-fields":["model","messages","max_tokens","stream"]}