{"openapi":"3.1.0","info":{"title":"Beatrice API","version":"0.1.0","description":"Beatrice API. Routes under /v1 are compatible with the OpenAI format."},"components":{"schemas":{}},"paths":{"/v1/models":{"get":{"summary":"List available models","tags":["models"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","required":["id","object","created","owned_by"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["model"]},"created":{"type":"integer"},"owned_by":{"type":"string"}}}}}}}}}}}},"/v1/models/{model}":{"get":{"summary":"Retrieve a model","tags":["models"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"model","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","required":["id","object","created","owned_by"],"properties":{"id":{"type":"string"},"object":{"type":"string","enum":["model"]},"created":{"type":"integer"},"owned_by":{"type":"string"}}}}}}}}},"/v1/chat/completions":{"post":{"summary":"Create a chat completion (OpenAI compatible, streaming supported)","tags":["chat"],"description":"OpenAI chat completions format. The answer may carry `reasoning_content` next to `content`; usage counts reasoning in `completion_tokens`. A red-line refusal is a normal answer with `finish_reason: \"content_filter\"`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","minLength":1,"description":"Model id, e.g. beatrice-flash (GET /v1/models)"},"messages":{"type":"array","items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","minLength":1,"description":"system, developer, user, assistant or tool"},"content":{"description":"Text, or an array of content parts as in the OpenAI format"}},"additionalProperties":true},"minItems":1,"description":"The conversation so far"},"stream":{"type":"boolean","description":"Send the answer as server-sent events"},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean","description":"Add a final chunk with token usage"}},"additionalProperties":true},"max_tokens":{"type":"integer","minimum":1,"description":"Output limit, reasoning included; default 8192"},"max_completion_tokens":{"type":"integer","minimum":1,"description":"Same as max_tokens (newer OpenAI name)"},"n":{"type":"integer","minimum":1,"description":"Only 1 is supported"},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1}},"additionalProperties":true,"description":"Also forwarded: stop, presence_penalty, frequency_penalty, seed, response_format, tools, tool_choice, parallel_tool_calls, logprobs, top_logprobs, reasoning_effort. Other fields are ignored."}}},"description":"Also forwarded: stop, presence_penalty, frequency_penalty, seed, response_format, tools, tool_choice, parallel_tool_calls, logprobs, top_logprobs, reasoning_effort. Other fields are ignored."},"responses":{"200":{"description":"Default Response"}}}}},"servers":[{"url":"https://api.beatriceai.it"}]}