# Chat completions

Generate a model's response through a single OpenAI-compatible endpoint. Supports synchronous mode, streaming via `Server-Sent Events`, function calling, a guaranteed `JSON` response, and working with images.

Scope: `vibe:ai`

## Operations

- [Create a chat completion](./chat/completions.md) — `POST /v1/chat/completions`

## Capabilities

- [Streaming](./chat/streaming.md) — the response arrives as `Server-Sent Events` as it is generated
- [Guaranteed JSON response](./chat/json.md) — the `json_object` and `json_schema` modes
- [Function calling](./chat/tools.md) — the model asks to call your function and receives the result
- [Image analysis](./chat/vision.md) — passing graphics inside a message
- [Rate limits](./chat/rate-limits.md) — two buckets, codes `429` and `503`, a retry recipe

## Typical scenario

1. Get data from CRM: [`GET /v1/deals/:id`](/docs/entities/deals/get).
2. Generate the model's response: [`POST /v1/chat/completions`](./chat/completions.md).
3. Write the result to the deal timeline: [`POST /v1/timeline-logs`](/docs/timeline-logs).

## See also

- [AI Router](/docs/ai)
- [Models](/docs/ai/models)
- [Model lifecycle](/docs/ai/models/lifecycle)
