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 Haiku 4.5

Request ID claude-haiku-4-5-20251001

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-haiku-4-5-20251001.
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.
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.
temperaturenumberConditionalControls sampling randomness. Accepted values and whether the field takes effect depend on the model and endpoint.
top_pnumberConditionalLimits sampling candidates by cumulative probability. Use when the model and endpoint support it.

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-haiku-4-5-20251001",
  "max_tokens": 256,
  "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

Full integration guide

Model Capability Catalog · View pricing