メインコンテンツへスキップ
クライアントが既に Anthropic Messages 形式を使用している場合は、/v1/messages を呼び出します。
curl https://apiany.ai/v1/messages \
  -H "Authorization: Bearer $APIANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m3",
    "max_tokens": 512,
    "messages": [
      { "role": "user", "content": "API ドキュメントのセクションタイトルを3つ作成してください。" }
    ]
  }'
APIAny.AI はリクエストを処理し、Anthropic 互換のレスポンスを返します。

ツール呼び出し

tools(それぞれ namedescriptioninput_schema を含む)でツールを宣言し、 tool_choice で選択を制御します。複数ターンの tool_use / tool_result コンテンツブロックに対応しています。
{
  "model": "minimax-m3",
  "max_tokens": 512,
  "tools": [
    {
      "name": "get_weather",
      "description": "現在の天気を取得する",
      "input_schema": {
        "type": "object",
        "properties": { "location": { "type": "string" } },
        "required": ["location"]
      }
    }
  ],
  "tool_choice": { "type": "auto" },
  "messages": [{ "role": "user", "content": "ニューヨークの天気は?" }]
}

ストリーミング

stream: true を設定すると Anthropic の SSE イベントストリームで返ります: message_startcontent_block_startcontent_block_deltacontent_block_stopmessage_deltamessage_stop

パラメータ

対応:modelmessagesmax_tokens(必須)、systemtemperaturetop_ptop_kstop_sequencestoolstool_choicestream