{"openapi":"3.1.0","info":{"title":"codex-api","version":"1.0.0","description":"An OpenAI-compatible chat completions API. Use it exactly as you would use https://api.openai.com/v1 — same shapes, same client libraries. Differences: no tool/function calling, sampling parameters are ignored, and unknown model names fall back to the default (gpt-5.6-sol) rather than being refused. Full notes at https://codex.sprigloop.ai/llms.txt"},"servers":[{"url":"https://codex.sprigloop.ai/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your provisioned API key."}},"schemas":{"Message":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant"]},"content":{"description":"A string, or an array of content parts ({type:\"text\"} / {type:\"image_url\"}).","oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]}}},"Usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"prompt_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer"}}},"completion_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"integer"}}}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":["string","null"]}}}}}}},"paths":{"/chat/completions":{"post":{"operationId":"createChatCompletion","summary":"Create a chat completion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","default":"gpt-5.6-sol","description":"Optionally suffixed with an effort, e.g. \"model:high\"."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"stream":{"type":"boolean","default":false},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}}},"reasoning_effort":{"type":"string","enum":["low","medium","high","xhigh","max"]},"response_format":{"type":"object","description":"text | json_object | json_schema"}}}}}},"responses":{"200":{"description":"A completion, or an SSE stream of chat.completion.chunk frames when stream=true.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["chat.completion"]},"created":{"type":"integer"},"model":{"type":"string","description":"The model that actually ran."},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}},"finish_reason":{"type":"string"}}}},"usage":{"$ref":"#/components/schemas/Usage"}}}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Malformed, or a refused parameter (tools, n>1).","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":["string","null"]}}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":["string","null"]}}}}}}}},"429":{"description":"At capacity. Honour Retry-After.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":["string","null"]}}}}}}}},"500":{"description":"The turn failed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":["string","null"]}}}}}}}}}}},"/completions":{"post":{"operationId":"createCompletion","summary":"Legacy text completion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"model":{"type":"string","default":"gpt-5.6-sol"},"prompt":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"stream":{"type":"boolean"}}}}}},"responses":{"200":{"description":"A text completion."},"400":{"description":"Malformed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":["string","null"]}}}}}}}}}}},"/models":{"get":{"operationId":"listModels","summary":"List available models","responses":{"200":{"description":"The model list."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":["string","null"]}}}}}}}}}}},"/models/{model}":{"get":{"operationId":"retrieveModel","summary":"Retrieve one model","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The model."},"404":{"description":"No such model.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":["string","null"]},"code":{"type":["string","null"]}}}}}}}}}}}}}