Skip to main content
POST
/
messages
Create a message
curl --request POST \
  --url https://api.aisa.one/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "claude-sonnet-4-6",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Hello, Claude"
    }
  ],
  "system": "<string>",
  "temperature": 1,
  "top_p": 123,
  "top_k": 123,
  "stop_sequences": [
    "<string>"
  ],
  "stream": false,
  "tools": [
    {
      "name": "<string>",
      "input_schema": {},
      "description": "<string>",
      "type": "custom"
    }
  ],
  "tool_choice": {
    "type": "auto",
    "name": "<string>",
    "disable_parallel_tool_use": false
  },
  "thinking": {
    "type": "enabled",
    "budget_tokens": 10000,
    "display": "summarized"
  },
  "metadata": {
    "user_id": "<string>"
  },
  "service_tier": "auto"
}
'
{
  "id": "msg_024e7cf42f5d47cfa6982b5ff8b55642",
  "type": "message",
  "role": "assistant",
  "content": [
    {}
  ],
  "model": "claude-sonnet-4-6",
  "stop_reason": "end_turn",
  "stop_sequence": "<string>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "cache_creation_input_tokens": 123,
    "cache_read_input_tokens": 123
  }
}
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:
[
{
"role": "user",
"content": "Hello, Claude"
}
]
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