> ## Documentation Index
> Fetch the complete documentation index at: https://betterdatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Completion

> OpenAI-compatible chat completion endpoint with automatic tool injection

This endpoint follows the OpenAI Chat Completions format but automatically injects your gateway's commerce tools into the request before sending it to the underlying LLM.

## Request Body

Includes all standard OpenAI fields (`model`, `messages`, `temperature`, etc.).

<ParamField body="stream" type="boolean" default="false">
  Whether to stream the response.
</ParamField>

## Response

Returns a standard OpenAI chat completion object or stream.

## Example

```bash theme={null}
curl -X POST https://api.betterdata.io/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4",
    "messages": [{"role": "user", "content": "Find me some cool shirts"}]
  }'
```
