メインコンテンツへスキップ
POST
/
v1
/
messages
Messages レスポンスを作成
curl --request POST \
  --url https://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
  }
}

承認

Authorization
string
header
必須

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

ボディ

application/json
model
string
必須
:

"minimax-m3"

messages
object[]
必須
max_tokens
integer
必須

生成する最大トークン数(必須)。

必須範囲: x >= 1
system

システムプロンプト。

temperature
number

ランダム性(0〜1)。

必須範囲: 0 <= x <= 1
top_p
number
必須範囲: 0 <= x <= 1
top_k
integer

各トークンで確率が最も高い上位 K 個の候補のみからサンプリングします。

stop_sequences
string[]

カスタムの停止シーケンス。

tools
object[]

モデルが呼び出せるツール。各ツールは name、description、input_schema(JSON Schema)を含みます。

tool_choice
object

ツール選択: { type: 'auto' } | { type: 'any' } | { type: 'tool', name }。

stream
boolean

true の場合、Anthropic SSE イベントストリームで返却します(message_start / content_block_delta / message_delta / message_stop)。

レスポンス

Anthropic 互換の Messages レスポンス。

id
string
必須
type
string
必須
:

"message"

role
string
必須
:

"assistant"

content
object[]
必須
model
string
必須
usage
object