コンテンツにスキップ
無料で登録
API リファレンス

Anthropic Messages API をテストする

BetterToken の Anthropic 互換 Messages API をテストします。x-api-key、anthropic-version、POST /v1/messages を使用します。

POST /v1/messages

この Endpoint は、Claude Code、Anthropic SDK、Anthropic Messages API を使用するアプリケーションに使用します。

Playground でテストする

右側の Playground で、x-api-key フィールドに API Key を入力し、anthropic-version は 2023-06-01 のままにして、利用可能な Claude プロバイダーのモデルを選び、リクエストを送信します。

関連する Endpoint

POST/v1/messages

承認

x-api-keystringheader必須

ヘッダー

anthropic-versionstringデフォルト: 2023-06-01必須

The Anthropic API version header.

例:"2023-06-01"

ボディ application/json

modelstring必須

A model ID currently available in the model plaza. Check the model plaza for the latest options.

例:"YOUR_MODEL_ID"
max_tokensintegerデフォルト: 1024必須

The maximum number of tokens to generate in the response.

必須範囲: x >= 1

例:1024
messagesobject[]必須

Messages in Anthropic format. Each item should contain role and content.

Minimum array length: 1

Show child attributes
messages[].rolestring必須
例:"user"
messages[].contentstring必須
例:"Hello"

レスポンス

200The Anthropic Messages result from the selected model.
400Invalid request format or parameters.
401The BetterToken API Key is missing or invalid.
402The account has insufficient credit or balance.
429The request exceeded a rate or concurrency limit, or the upstream service is busy.
500The gateway or upstream service returned an error.