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

# Chat Completions (OpenAI Compatible)

> Successful Response

### Request body

`OpenAIChatCompletionRequest`

**model** `string` *required*

Model identifier

**messages** `OpenAIChatMessage[]` *required*

Chat messages

**max\_tokens** `integer,null`

Max tokens to generate

**temperature** `number,null`

Sampling temperature

**top\_p** `number,null`

Top-p sampling

**stream** `boolean`

Stream partial responses

**stop** `string`

Stop sequence(s)

**tools** `object[],null`

Tool definitions

**tool\_choice** `string`

Tool choice

### Response

`OpenAIChatCompletionResponse`

**id** `string` *required*

**object** `string` *required*

**created** `integer` *required*

**model** `string` *required*

**choices** `object[]` *required*

**usage** `object,null`

### Status codes

| Code | Meaning |
| - | - |
| `200` | Successful Response |
| `401` | Authentication required |
| `422` | Validation Error |
| `429` | Rate limit exceeded |

```bash cURL theme={null}
curl --request POST \
  --url 'http://localhost:8000/v1/chat/completions' \
  --header "Authorization: Bearer $STATESET_AGENTS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "string",
  "messages": [
    {
      "role": "system",
      "content": "Two-person tent, green — replacement for damaged pole set.",
      "name": "Two-Person Tent",
      "tool_call_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "tool_calls": []
    }
  ],
  "max_tokens": 1,
  "temperature": 1.5,
  "top_p": 1.5,
  "stream": false,
  "stop": "string",
  "tools": [
    {}
  ],
  "tool_choice": "string"
}'
```

```json 200 theme={null}
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "object": "string",
  "created": 1,
  "model": "string",
  "choices": [
    {}
  ],
  "usage": {}
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.