Skip to main content
POST
/
v1
/
chat
/
completions
Chat Completion
curl --request POST \
  --url https://api.example.com/v1/chat/completions \
  --header 'Content-Type: application/json' \
  --data '{
  "stream": true
}'
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.).
stream
boolean
default:"false"
Whether to stream the response.

Response

Returns a standard OpenAI chat completion object or stream.

Example

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"}]
  }'