{"openapi":"3.1.0","info":{"title":"Avernic API","version":"1.0.0","description":"OpenAI-compatible API for the Avernic proprietary models. Change the base URL and the key; the rest of your code does not change.","license":{"name":"Proprietary. The engine is open source; the models are not."}},"servers":[{"url":"/v1"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Message":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"type":["string","array","null"],"description":"Text, or an array of content parts for multimodal input."},"name":{"type":"string"},"tool_call_id":{"type":"string"}}},"Usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"cached_tokens":{"type":"integer","description":"Avernic extension: prompt tokens served from the prefix cache."}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}},"security":[{"bearerAuth":[]}],"paths":{"/models":{"get":{"summary":"List models","operationId":"listModels","responses":{"200":{"description":"The catalogue this deployment can serve","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string"},"data":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"404":{"description":"Unknown model or endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"503":{"description":"No inference backend attached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}}}}},"/models/{model}":{"get":{"summary":"Retrieve a model","parameters":[{"name":"model","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The model"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"404":{"description":"Unknown model or endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"503":{"description":"No inference backend attached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}}}}},"/chat/completions":{"post":{"summary":"Create a chat completion","operationId":"createChatCompletion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"A namespaced model ID."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"max_tokens":{"type":"integer","minimum":1},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"top_k":{"type":"integer","description":"Avernic extension. Top-k truncation before nucleus sampling."},"stop":{"type":["string","array"]},"stream":{"type":"boolean","default":false},"seed":{"type":"integer"},"response_format":{"type":"object"},"tools":{"type":"array","items":{"type":"object"}},"tool_choice":{},"reasoning":{"type":"object","description":"Avernic extension. Reasoning budget for reasoning models.","properties":{"effort":{"type":"string","enum":["low","medium","high"]},"max_tokens":{"type":"integer"}}},"cache":{"type":"object","description":"Avernic extension. Prefix cache retention window.","properties":{"retain":{"type":"string","enum":["1h","24h","7d"]}}},"user":{"type":"string"}}}}}},"responses":{"200":{"description":"A chat completion, or an SSE stream when stream is true","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object"}},"usage":{"$ref":"#/components/schemas/Usage"}}}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"404":{"description":"Unknown model or endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"503":{"description":"No inference backend attached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}}}}},"/embeddings":{"post":{"summary":"Create embeddings","operationId":"createEmbedding","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"input":{"type":["string","array"]},"dimensions":{"type":"integer","description":"Matryoshka truncation, honoured server-side."},"encoding_format":{"type":"string","enum":["float","base64"]}}}}}},"responses":{"200":{"description":"Embeddings"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"404":{"description":"Unknown model or endpoint","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}},"503":{"description":"No inference backend attached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"required":["message","type","code","param"]}}}}}}}}},"/status":{"get":{"summary":"Deployment health","security":[],"responses":{"200":{"description":"Health of the attached inference backend"}}}}}}