> ## 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 (v1)

> Create or continue a v1 conversation.

Create or continue a v1 conversation.

### Request body

`ConversationRequestV1`

<ParamField body="message" type="string,null" />

<ParamField body="messages" type="MessageV1[],null" />

<ParamField body="conversation_id" type="string,null" />

<ParamField body="model" type="string,null" />

<ParamField body="temperature" type="number,null" />

<ParamField body="max_tokens" type="integer,null" />

### Response

`ConversationResponseV1`

<ResponseField name="conversation_id" type="string" required />

<ResponseField name="response" type="string" required />

<ResponseField name="tokens_used" type="integer" required />

<ResponseField name="processing_time_ms" type="integer" required />

### Status codes

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

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'http://localhost:8000/api/v1/conversations' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "message": "Two-person tent, green — replacement for damaged pole set.",
    "messages": [
      {
        "role": "system",
        "content": "Two-person tent, green — replacement for damaged pole set."
      }
    ],
    "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "model": "string",
    "temperature": 1.5,
    "max_tokens": 1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "response": "string",
    "tokens_used": 1,
    "processing_time_ms": 250
  }
  ```
</ResponseExample>
