> ## Documentation Index
> Fetch the complete documentation index at: https://docs.co-mind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 5. Chat completions

> Send a stateless, OpenAI-compatible chat request and get a completion back.

Chat completions are stateless — the platform doesn't remember prior turns. You send the full conversation in `messages[]` on every request; the server returns a single completion. Same shape as the OpenAI Chat Completions API, so existing tooling works.

## Send a chat request

```bash theme={null}
curl -X POST {BASE_URL}/v1/chat/completions \
  -H "Authorization: Bearer $PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "'$CHAT_MODEL'",
    "messages": [
      {"role": "user", "content": "In one sentence, what is retrieval-augmented generation?"}
    ]
  }'
```

```json theme={null}
{
  "id": "chatcmpl-xyz",
  "object": "chat.completion",
  "created": 1756820000,
  "model": "llama3.2:3b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Retrieval-augmented generation combines a language model with a search step over external documents so answers can cite fresh, domain-specific sources."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 18, "completion_tokens": 34, "total_tokens": 52 }
}
```

## Follow-up turns

For a multi-turn conversation, append each assistant response to `messages[]` and send the whole thing again:

```json theme={null}
{
  "model": "llama3.2:3b",
  "messages": [
    {"role": "user", "content": "In one sentence, what is retrieval-augmented generation?"},
    {"role": "assistant", "content": "Retrieval-augmented generation combines..."},
    {"role": "user", "content": "Give me a concrete example."}
  ]
}
```

## Streaming

Add `"stream": true` to receive Server-Sent Events instead of one JSON response. Frames arrive as `data: {...}` lines and end with `data: [DONE]`.

<Tip>
  For chat grounded in your documents rather than raw model knowledge, use the knowledge base chat endpoint in the next section.
</Tip>

Next: [Knowledge bases →](/guides/api-walkthrough/knowledge-bases)
