Api Reference

Chat Completion

Edit this page

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

Whether to stream the response.

Response

Returns a standard OpenAI chat completion object or stream.

Example

1curl -X POST https://api.betterdata.io/v1/chat/completions \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -d '{
4 "model": "gpt-4",
5 "messages": [{"role": "user", "content": "Find me some cool shirts"}]
6 }'