Text modelsAdvanced usersUpdated
POST/v1/messages

API console

POST/v1/messages
View keys

Requests use the API key you enter and follow standard API billing.

Claude Sonnet 5.5

Request ID claude-sonnet-5-5

Protocols

Authentication

Requests require an API key from API key management. For JSON requests, set Content-Type: application/json.

  • Anthropic Messages · x-api-key: YOUR_API_KEY

Request parameters

POST /v1/messages

FieldTypeRequiredDescription
modelstringRequiredSet the model ID to claude-sonnet-5-5.
messagesobject[]RequiredSend user and assistant messages in order. Put system instructions in the top-level system field.
messages[].contentstring / object[]RequiredThe message body. Use plain text or an array of content blocks defined by the protocol.
messages[].content[]objectConditionalUse a type: image content block and put image data in source. Accepted formats depend on the endpoint.
systemstring / object[]OptionalSystem instructions as text or an array of text blocks.
max_tokensintegerRequiredCaps output tokens. The accepted limit depends on the model and endpoint.
streambooleanOptionaltrue requests an SSE stream. false requests a JSON response. Available modes depend on the endpoint.
thinking.typestringOptionalUse adaptive or between_tools. The latter limits reasoning to the intervals between tool calls.
output_config.effortstringConditionalRequested reasoning effort. Available levels and whether reasoning can be disabled depend on the model and endpoint.
toolsobject[]ConditionalTool definitions available to the model. Tool types and parameter formats depend on the protocol and endpoint.
tool_choiceobjectConditionalUse type: auto for ordinary tools. This model does not support forcing ordinary tool calls with any or tool.

POST /v1/messages/count_tokens

FieldTypeRequiredDescription
modelstringRequiredSet the model ID to claude-sonnet-5-5.
messagesobject[]RequiredSend user and assistant messages in order. Put system instructions in the top-level system field.
messages[].contentstring / object[]RequiredThe message body. Use plain text or an array of content blocks defined by the protocol.
messages[].content[]objectConditionalUse a type: image content block and put image data in source. Accepted formats depend on the endpoint.
systemstring / object[]OptionalSystem instructions as text or an array of text blocks.
toolsobject[]ConditionalTool definitions to include in the input token count. Send the same tools as in the Messages request.

Request examples

Set your API key in the local ICODEEASY_API_KEY environment variable and choose an endpoint that accepts direct HTTP calls. For endpoints that require a specific client, follow that client’s setup guide.

Anthropic Messages

bash
curl -sS 'https://api.icodeeasy.cc/v1/messages' \
  -H "x-api-key: $ICODEEASY_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'anthropic-version: 2023-06-01' \
  --data '{
  "model": "claude-sonnet-5-5",
  "max_tokens": 256,
  "messages": [
    {
      "role": "user",
      "content": "Explain how a rainbow forms in one sentence."
    }
  ]
}'

Count Tokens

bash
curl -sS 'https://api.icodeeasy.cc/v1/messages/count_tokens' \
  -H "x-api-key: $ICODEEASY_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'anthropic-version: 2023-06-01' \
  --data '{
  "model": "claude-sonnet-5-5",
  "messages": [
    {
      "role": "user",
      "content": "Explain how a rainbow forms in one sentence."
    }
  ]
}'

Read the response

  • Anthropic Messages · Read blocks of type text in content[]. In a stream, process SSE content block events in order. JSON · SSE
  • Count Tokens · Read the input token count from input_tokens.

Full integration guide

Capabilities and limits

  • streaming · Supported
  • tool_calling · Supported
  • image_input · Conditional — Depends on the compatible endpoint and request format
  • video_input · Not supported

Compatibility aliases and retired redirects

  • claude-sonnet-4-5, claude-sonnet-4-5-20250514, claude-sonnet-4-5-20250929, claude-sonnet-4-6 → claude-sonnet-5-5 (Retired redirect)

Model Capability Catalog · View pricing