Skip to main content
POST
/
v1
/
messages
Create message
curl --request POST \
  --url https://api.apiany.ai/v1/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "minimax-m3",
  "max_tokens": 512,
  "messages": [
    {
      "role": "user",
      "content": "Draft three API documentation section titles."
    }
  ]
}
'
{
  "id": "<string>",
  "type": "message",
  "role": "assistant",
  "content": [
    {}
  ],
  "model": "<string>",
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "input_tokens": 123,
    "output_tokens": 123,
    "cached_input_tokens": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required
Example:

"minimax-m3"

messages
object[]
required
max_tokens
integer
required

Maximum tokens to generate (required).

Required range: x >= 1
system

System prompt.

temperature
number

Amount of randomness injected into the response (0–1).

Required range: 0 <= x <= 1
top_p
number
Required range: 0 <= x <= 1
top_k
integer

Only sample from the top K options for each token.

stop_sequences
string[]

Custom sequences that stop generation.

tools
object[]

Tools the model may call; each has name, description and input_schema (JSON Schema).

tool_choice
object

Tool selection: { type: 'auto' } | { type: 'any' } | { type: 'tool', name }.

stream
boolean

If true, responses are streamed as Anthropic SSE events (message_start, content_block_delta, message_delta, message_stop).

Response

Anthropic-compatible message response.

id
string
required
type
string
required
Example:

"message"

role
string
required
Example:

"assistant"

content
object[]
required
model
string
required
usage
object