Skip to main content
POST
Create a message
Creates a Claude model response using the Anthropic-compatible Messages API. This endpoint mirrors the Anthropic /v1/messages specification, routed through the AIsa gateway at https://api.aisa.one/v1/messages. Use this endpoint when you want to call Claude models (claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5-20251001, etc.) with Anthropic’s native request format — including extended thinking, tool use, and prompt caching. If you prefer OpenAI-style chat completions, the same Claude models are also available via the OpenAI Chat endpoint. Authentication uses your AIsa API key as a Bearer token. See the model catalog for the full list of supported Claude variants and context windows, and pricing for per-token rates.

Authorizations

Authorization
string
header
required

Your AIsa API key as a Bearer token.

Body

application/json
model
string
required

Claude model identifier. Examples: claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5-20251001.

Example:

"claude-sonnet-4-6"

max_tokens
integer
required

Maximum number of tokens to generate before stopping.

Example:

1024

messages
object[]
required

Conversation turns.

Example:
system

System prompt. String or array of text blocks.

temperature
number<float>
default:1

Randomness. 0 = deterministic, 1 = creative.

Required range: 0 <= x <= 1
top_p
number<float>

Nucleus sampling. Use instead of temperature.

top_k
integer

Only sample from the top K options for each token.

stop_sequences
string[]

Custom sequences that stop generation.

stream
boolean
default:false

Enable SSE streaming.

tools
object[]

Tools the model may use.

tool_choice
object

How the model uses tools.

thinking
object

Enable extended thinking for complex reasoning.

metadata
object
service_tier
enum<string>
default:auto
Available options:
auto,
standard_only

Response

Successful response

id
string
Example:

"msg_024e7cf42f5d47cfa6982b5ff8b55642"

type
string
Example:

"message"

role
string
Example:

"assistant"

content
object[]

Response content blocks (text, tool_use, thinking, etc.).

model
string
Example:

"claude-sonnet-4-6"

stop_reason
enum<string>
Available options:
end_turn,
stop_sequence,
max_tokens,
tool_use
stop_sequence
string | null
usage
object