{"openapi":"3.1.0","info":{"title":"Anthypa API","version":"1.0.0","description":"OpenAI-compatible API for Anthypa (anthypa.com). Create an API key in your account dashboard, then use it as a Bearer token. Base URL: https://anthypa.com/api/v1","contact":{"url":"https://anthypa.com"}},"servers":[{"url":"https://anthypa.com/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key created at https://anthypa.com/account (prefix ah-). Requires an active paid plan (chat-lite or higher)."}},"schemas":{"ChatMessage":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}}},"ChatCompletionRequest":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"Model id. See GET /models for the live list.","examples":["gpt-5.6-sol","claude-opus-5","gemini-3.1-pro"]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"max_tokens":{"type":"integer","description":"Upper bound on generated tokens."},"temperature":{"type":"number","minimum":0,"maximum":2},"stream":{"type":"boolean","default":false,"description":"SSE streaming in OpenAI chunk format."}}},"ChatCompletionResponse":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"chat.completion"},"created":{"type":"integer"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"$ref":"#/components/schemas/ChatMessage"},"finish_reason":{"type":"string"}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"Model":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","const":"model"},"owned_by":{"type":"string"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string","examples":["invalid_request_error","authentication_error","rate_limit_error"]},"code":{"type":"string"}}}}}}},"paths":{"/chat/completions":{"post":{"summary":"Create a chat completion","description":"OpenAI-compatible chat completions. Token usage is metered against your plan's API quota.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"},"examples":{"simple":{"value":{"model":"gpt-5.6-sol","messages":[{"role":"user","content":"Hello!"}],"max_tokens":100}}}}}},"responses":{"200":{"description":"Completion result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionResponse"}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream of OpenAI-format chunks when stream=true"}}}},"401":{"description":"Missing/invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Plan quota exhausted or API access locked (free plan)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/models":{"get":{"summary":"List available models","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of model ids available to your plan","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}}}},"401":{"description":"Missing/invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"tags":[{"name":"chat","description":"Chat completions (OpenAI-compatible)"},{"name":"models","description":"Model catalog"}]}