{"openapi":"3.1.0","info":{"title":"ElderAI ATLAS API","version":"1.0.0","description":"OpenAI-compatible API for ATLAS Code (atlas-code-1-preview), ElderAI’s coding model. ATLAS Code is in preview and unlocks once your account email is verified: GET /models lists the models your key can use."},"servers":[{"url":"https://elderai.cloud/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/models":{"get":{"operationId":"listModels","summary":"List available ATLAS models","responses":{"200":{"description":"Model list"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/chat/completions":{"post":{"operationId":"createChatCompletion","summary":"Create a chat completion (OpenAI-compatible)","parameters":[{"$ref":"#/components/parameters/OptionalIdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"ATLAS chat completion or event stream (chat-completions compatible)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/Unavailable"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"ATLAS API key"}},"parameters":{"OptionalIdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional for chat. When sent, retrying identical input with the same key never bills twice. When omitted, the server generates one per request (no client replay protection).","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{8,200}$"}}},"schemas":{"ChatRequest":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","examples":["atlas-code-1-preview"],"description":"A model id returned by GET /models for your key, for example atlas-code-1-preview (ATLAS Code preview; unlocked once your account email is verified)."},"messages":{"type":"array","minItems":1,"items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"type":"string"},"name":{"type":"string"},"tool_call_id":{"type":"string"}}}},"stream":{"type":"boolean","default":false},"temperature":{"type":"number","minimum":0,"maximum":2},"max_tokens":{"type":"integer","minimum":1},"response_format":{"oneOf":[{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["text","json_object"]}}},{"type":"object","required":["type","json_schema"],"properties":{"type":{"type":"string","const":"json_schema"},"json_schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"schema":{"type":"object"},"strict":{"type":"boolean"}}}}}],"description":"JSON mode or JSON Schema structured output. Output is validated server-side; json_schema is non-streaming only."},"user":{"type":"string"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"request_id":{"type":"string"}},"required":["error"]}},"responses":{"BadRequest":{"description":"Malformed request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"PaymentRequired":{"description":"Insufficient ATLAS Credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Account, plan, project, or policy does not permit this operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource does not exist or is not owned by this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Idempotency conflict or request pending reconciliation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"PayloadTooLarge":{"description":"Request exceeds the documented payload limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ValidationError":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Rate or concurrency limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"}},"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalError":{"description":"Unexpected ATLAS error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"ATLAS capability is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}