Skip to main content
POST /v1/chat/completions is an OpenAI-compatible chat endpoint with memory built in. On every request Anona retrieves the most relevant memories from the space, injects them into the prompt, and stores the exchange back, so the conversation stays grounded in what came before without any extra calls. Point an existing OpenAI-compatible client at the Anona base URL and pick a space.

Request

Fields Anona does not model (top_p, n, stop, presence_penalty and the rest of the OpenAI request) are forwarded to the provider unchanged.

Memory tunables

Every knob can be set in the body or as a header. The header form exists so a stock client can set them once in default_headers and leave every call site alone; when both are present, the body wins. A header that cannot be parsed returns 400 invalid_tunable naming the header.

Space defaults

The same knobs can be stored on the space, so they apply to every proxied call without touching a call site. Resolution is per field, in this order:
space_id is not a settable default: it is the key the defaults are stored under. A null means unset, not “off”: that field falls through to the platform default, so a space can configure one knob and inherit the rest. These endpoints are free, cost no credits, and remain available when an organization has run out of credits, because configuration should never be the thing you cannot change.

Response

OpenAI-shaped, plus two Anona fields.
The same two values are also returned as the X-Anona-Memories-Injected and X-Anona-Space-Id response headers, which is how you read them on a stream. The user turn and the assistant reply are both stored back into space_id automatically, unless auto_record is false.

Streaming

Send "stream": true and the reply arrives as server-sent events in the standard OpenAI chunk format, terminated by data: [DONE].
Memory recall happens before the model is called, so injection is unaffected by streaming. The first chunk carries the memories_injected and space_id fields alongside the usual chunk payload, and both are on the response headers from the start. The turn is recorded and billed after the last token, using the token counts from the final chunk. If the connection drops mid-stream, whatever the model already produced is still recorded and still billed, from an estimate of the text that was sent, since the counts travel in a chunk that never arrived. Token counts reach you only if you ask for them, as on OpenAI: set "stream_options": {"include_usage": true} and the stream ends with a usage chunk. Billing does not depend on it.
Errors raised before the first token (an unavailable model, an unreachable provider) come back as a normal JSON error with a real status code. Once the stream has started the status is already sent, so a later failure ends the stream early instead.

Other request shapes

All three run the identical memory wrapper and accept the same tunables.
You never supply an LLM key. Anona runs the model for you, model is a hint, and billing is metered in Anona credits rather than by the underlying provider.