ドキュメント

Native Claude Format

Anthropic Claude Messages API requests. Requires the anthropic-version header.

FieldValue
Base URLhttps://token.easyapi.com/v1
AuthenticationAuthorization: Bearer `API_KEY`
Example modelclaude-3-opus-20240229
FormatAnthropic Messages compatible
BillingPay as you go
Note: Requests must include anthropic-version (e.g. 2023-06-01). Auth via Authorization: Bearer or x-api-key.

Example model

Examples below use claude-3-opus-20240229 (Claude 3 Opus). Replace model and adjust size, quality, etc. per console docs when switching models.

Create message

POSThttps://token.easyapi.com/v1/messages

Create a chat response using the Anthropic Claude Messages API format. Full path: POST /v1/messages.

Request parameters

NameInTypeRequiredDescription
AuthorizationheaderstringYesEasyAPI API Key. Format: Bearer `API_KEY`
Content-TypeheaderstringYesRequest body format, always application/json
anthropic-versionheaderstringYesAnthropic API version, required, e.g. 2023-06-01
x-api-keyheaderstringNoAnthropic API Key (optional; Bearer Token also works)

Request body

NameTypeRequiredDescription
modelstringYesModel ID, e.g. claude-3-opus-20240229
messagesarray<object>YesConversation messages, each with role and content
max_tokensintegerYesMax output tokens, must be ≥ 1
systemstring | array<object>NoSystem prompt as string or content block array
temperaturenumberNoSampling temperature, range 0–1
top_pnumberNoNucleus sampling parameter
top_kintegerNoSample only from the top K tokens
streambooleanNoEnable streaming responses
stop_sequencesarray<string>NoCustom stop sequences
toolsarray<object>NoTool definitions the model may call
tool_choiceobjectNoTool selection strategy
thinkingobjectNoExtended thinking config (for supported models)
metadataobjectNoRequest metadata

Example

{
  "model": "claude-3-opus-20240229",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "max_tokens": 1024
}

Response example

{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "Hello! How can I help you today?"
    }
  ],
  "model": "claude-3-opus-20240229",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 10,
    "output_tokens": 20,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0
  }
}