# POST /v1/messages

> CreateMessage

- `operationId`: `V1MessagesCreateMessage`
- Group: [Inference API](https://sference.com/docs/api-reference/inference-api.md)
- API spec (machine-readable): https://sference.com/openapi.json
- HTML version: https://sference.com/docs/api-reference/inference-api/V1MessagesCreateMessage

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `beta` | query | boolean \| null | no | — |

## Request body (required)

Content type `application/json`. Schema: `AnthropicMessagesCreateRequest`

| Field | Type | Required | Constraints | Description |
| --- | --- | --- | --- | --- |
| `model` | string | yes | — | — |
| `max_tokens` | integer | yes | — | — |
| `messages` | array<AnthropicMessage> | yes | — | — |
| `system` | string \| array<AnthropicTextBlock> \| array<object> \| null | no | — | — |
| `stop_sequences` | array<string> \| null | no | — | — |
| `stream` | boolean | no | default `false` | — |
| `temperature` | number \| null | no | — | — |
| `top_p` | number \| null | no | — | — |
| `top_k` | integer \| null | no | — | — |
| `tools` | array<object> \| null | no | — | — |
| `tool_choice` | object \| string \| null | no | — | — |
| `thinking` | object \| null | no | — | — |
| `enable_thinking` | boolean \| null | no | — | — |

## Responses

### `200` — Request fulfilled, document follows

Schema: `object`

### `400` — Bad request syntax or unsupported method

Schema: `object`

| Field | Type | Required | Constraints | Description |
| --- | --- | --- | --- | --- |
| `status_code` | integer | yes | — | — |
| `detail` | string | yes | — | — |
| `extra` | null \| object \| array | no | — | — |

Source: https://sference.com/docs/api-reference/inference-api/V1MessagesCreateMessage
