# Create a message

URL: https://docs.router.ezat.io/zh/reference/api/createMessage

> Sends a conversation to a model and returns its reply, in Anthropic's Messages format. Set `"stream": true` to receive the reply as Server-Sent Events.

The gateway checks `model`, `max_tokens`, `messages` and `stream`. Every other field (`system`, `tools`, `thinking`, `output_config`, `cache_control` and the rest) is passed to the model unchanged, and the model checks it as Anthropic's API would. Two exceptions:

- The gateway removes prompt-cache breakpoints (`cache_control`) for models whose `capabilities.promptCaching` is `false` in `GET /api/models`, because their cache is never read back. Those requests are billed as plain input instead of a cache write.
- The `anthropic-version` header is accepted but not used.

The response's `model` (and `message.model` in `message_start`) is the name you sent, not the canonical id.


## POST /v1/messages

Sends a conversation to a model and returns its reply, in Anthropic's Messages format. Set `"stream": true` to receive the reply as Server-Sent Events.

The gateway checks `model`, `max_tokens`, `messages` and `stream`. Every other field (`system`, `tools`, `thinking`, `output_config`, `cache_control` and the rest) is passed to the model unchanged, and the model checks it as Anthropic's API would. Two exceptions:

- The gateway removes prompt-cache breakpoints (`cache_control`) for models whose `capabilities.promptCaching` is `false` in `GET /api/models`, because their cache is never read back. Those requests are billed as plain input instead of a cache write.
- The `anthropic-version` header is accepted but not used.

The response's `model` (and `message.model` in `message_start`) is the name you sent, not the canonical id.


Full request and response schemas: https://docs.router.ezat.io/openapi.yaml