Skip to content

Create Anthropic Message

client.messages.create(params)
POST/v1/messages

Create a message through SandBase's Anthropic-compatible Messages endpoint.

Request body

MessageCreateParams
stringmodelrequired

Anthropic-compatible model identifier.

object[]messagesrequired

User and assistant messages containing text or typed content blocks.

integermax_tokensrequired

Maximum number of output tokens.

Optional<string | object[]>system

Top-level system instruction.

Optional<number>temperature

Sampling temperature from 0 to 1.

Default: 1

Optional<number>top_p

Nucleus sampling threshold.

Optional<integer>top_k

Limit sampling to the top K tokens.

Optional<string[]>stop_sequences

Custom sequences that stop generation.

Optional<boolean>stream

Return Anthropic-style Server-Sent Events.

Default: false

Optional<object>metadata

Request metadata, including an optional user_id.

Optional<object[]>tools

Tool definitions available to the model.

Optional<object>tool_choice

Controls tool selection behavior.

Optional<object>thinking

Extended thinking configuration for supported models.

Authentication

Use x-api-key or Authorization: Bearer. When both are provided, x-api-key takes precedence.

Compatibility

Content blocks, tool use, thinking, and streaming follow the Anthropic-compatible schema. Availability depends on the selected model.

Errors

400

Invalid request body or unsupported feature.

401

Missing or invalid API key.

404

Model not found or unavailable.

429

Rate limit exceeded.