---
title: "Create a message"
method: POST
path: "/messages"
tags: ["Anthropic Messages"]
---

# Create a message

`POST /messages`

## Request

- Base URL: `https://api.openscale.so/anthropic/v1`
- URL: `https://api.openscale.so/anthropic/v1/messages`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

The Anthropic Messages API: system prompts, multi-turn messages with text, image, `tool_use` and `tool_result` blocks, client tools and `tool_choice`, extended thinking, `stop_sequences` and streaming with the standard event sequence. Any `claude-*` model name runs DeepSeek V4.1 Flash, and the reply echoes the name you sent. Thinking (`thinking.type` `enabled` or `adaptive`, or `output_config.effort`) turns reasoning on; it comes back as `thinking` blocks. Anthropic server tools are ignored. Usage reports `cache_read_input_tokens` for prompt tokens billed at the cached rate. Errors use the Anthropic shape.

## Request body

- object
  - `model` string, required: A model id from `GET /v1/models`, or any `claude-*` name.
  - `max_tokens` integer, required
  - `system` union
    - string
    - object[]
  - `messages` object[], required
  - `tools` object[]
  - `tool_choice` object
  - `thinking` object
  - `temperature` number
  - `stop_sequences` string[]
  - `stream` boolean

## Response `200`

The message, or an SSE stream when `stream` is true: message_start, content_block_start, content_block_delta, content_block_stop, message_delta and message_stop.

## Other responses

- `400`: Invalid request. A prompt that does not fit says `prompt is too long`.
- `401`: Missing or invalid API key.
- `402`: Empty balance, or the key reached its spend limit.
- `429`: Rate limit crossed or model at capacity.
- `529`: The model is temporarily overloaded.

---

[API](https://skmtc.dev/openscale/apis/openscale-api.md) - [All operations](https://skmtc.dev/openscale/apis/openscale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openscale/apis/openscale-api/revisions/587e72b44932?raw)
