# Claude Haiku 5.5 API (https://wanapi.app/docs/claude-haiku-5-5)





This reference covers **Claude Haiku 5.5** and its own Messages parameters. Use `claude-haiku-5-5` with `POST https://api.wanapi.app/v1/messages`. [Compare Claude models](/docs/claude-api).

## Model settings [#model-settings]

| Setting                            | Claude Haiku 5.5                  |
| ---------------------------------- | --------------------------------- |
| Model ID                           | `claude-haiku-5-5`                |
| Maximum synchronous output         | 128000 tokens, including thinking |
| Thinking modes                     | Adaptive or disabled              |
| Default effort                     | `medium`                          |
| Forced tool calls (`any` / `tool`) | Supported                         |

## Connect and send a request [#connect-and-send-a-request]

Create a key in [API key settings](/settings/apikeys). One API key works across all models and groups. Keep it in your server environment as `WAN_API_KEY`. Send `anthropic-version: 2023-06-01`; add `anthropic-beta` only for features that require it.

```bash
curl https://api.wanapi.app/v1/messages \
  -H "x-api-key: $WAN_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-haiku-5-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Explain the purpose of a database index in three sentences."}]
  }'
```

```python
import os
import anthropic

client = anthropic.Anthropic(
    api_key=os.environ["WAN_API_KEY"],
    base_url="https://api.wanapi.app",
)
message = client.messages.create(
    model="claude-haiku-5-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain the purpose of a database index in three sentences."}],
)
print("".join(block.text for block in message.content if block.type == "text"))
```

## Current API coverage [#current-api-coverage]

The table below describes this model's native contract. Wan API currently forwards requests through a compatibility layer. **Use a positive `max_tokens` value**: the gateway currently replaces `0` with a generation budget, so it cannot be used for cache-only prewarming here.

The current gateway does not forward `diagnostics`, `compaction`, `fallbacks`, `fallback_credit_token` or `thread`. It also filters `speed`, `service_tier` and `inference_geo` in the current channel configuration. These fields are documented below to explain the model's contract, but they are not available through this connection yet. A successful response does not mean an ignored field took effect. Beta features that need these fields share the same limitation.

## Parameters [#parameters]

| Field                   | Required | Contract                                                                                                                              |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `model`                 | Yes      | `claude-haiku-5-5`.                                                                                                                   |
| `max_tokens`            | Yes      | Integer 0–128000, including thinking. No API default.                                                                                 |
| `messages`              | Yes      | 1–100000 messages with a role and string or content-block array. See conversation rules below.                                        |
| `system`                | No       | String or array of text blocks. Not null.                                                                                             |
| `thinking`              | No       | Adaptive by default, or disabled. No manual budget and no between-tools mode.                                                         |
| `output_config`         | No       | Object with `effort`, `format` and optional beta `task_budget`.                                                                       |
| `stop_sequences`        | No       | Array of stopping strings.                                                                                                            |
| `stream`                | No       | Boolean; false by default.                                                                                                            |
| `temperature`           | No       | Omit. Discarded here; the official compatibility value is 1.                                                                          |
| `top_p`                 | No       | Omit. Discarded here; the official compatibility value is 0.99.                                                                       |
| `top_k`                 | No       | Unsupported and discarded.                                                                                                            |
| `tools`                 | No       | Array of client tools or official server tool declarations.                                                                           |
| `tool_choice`           | No       | `auto`, `none`, `any`, or named `tool`. Forced tools are supported.                                                                   |
| `metadata`              | No       | Object; optional `user_id` is a string of at most 512 characters or null.                                                             |
| `cache_control`         | No       | Null or `{"type":"ephemeral","ttl":"5m"}`; TTL also accepts `1h`. Default TTL is 5m.                                                  |
| `container`             | No       | Null, container ID string, or object with optional ID and up to 20 skills.                                                            |
| `context_management`    | No       | Null or an object containing official context edits; beta headers apply.                                                              |
| `mcp_servers`           | No       | Array of at most 20 URL servers; requires a matching MCP beta header.                                                                 |
| `service_tier`          | No       | `auto` or `standard_only`. Haiku has no Priority Tier capacity.                                                                       |
| `inference_geo`         | No       | `global`, `us`, or null. Omission uses the account default; inspect reported usage before assuming a region.                          |
| `diagnostics`           | No       | Null or object; `previous_message_id` is null or a string of at most 256 characters.                                                  |
| `compaction`            | No       | Null or `{"type":"summarize","instructions":"..."}`. Instructions are optional, nullable and at most 16384 characters.                |
| `fallbacks`             | No       | Null or `default` with the corresponding beta. Haiku has no automatic fallback models; explicit lists are invalid.                    |
| `fallback_credit_token` | No       | Null, a token string, or `{token,mode}`. The API must verify eligibility and validity; do not assume any model is an eligible target. |
| `speed`                 | No       | `standard` or null. Fast mode is unsupported.                                                                                         |

## Thinking and tools [#thinking-and-tools]

The default is adaptive thinking with **medium** effort and omitted thinking text. Effort accepts `low`, `medium`, `high`, `xhigh`, `max`, or null to use the default.

```json
{
  "thinking": {"type": "adaptive", "display": "summarized"},
  "output_config": {"effort": "medium"}
}
```

To disable thinking, use `{"type":"disabled"}` with low, medium or high effort. Do not include `display` or `block_binding` in disabled mode. `enabled`, `budget_tokens`, `between_tools`, and disabled thinking at xhigh/max are invalid.

Adaptive `display` accepts `omitted`, `summarized`, or null. The generic beta value `updates` requires `thinking-display-updates-2026-08-18`; Anthropic does not currently establish readable progress updates for Haiku, so do not depend on that output.

Optional `thinking.block_binding` requires `thinking-binding-controls-2026-08-01`. It is null or an object whose `prefix_mismatch_behavior` is `error`, `drop_block`, or null. Keep earlier conversation turns and complete thinking blocks unchanged when replaying history. Thinking signatures are bound to the account that produced them or an account linked to it.

`output_config.task_budget` is null or `{ "type": "tokens", "total": 20000 }` with optional integer/null `remaining`. It requires `task-budgets-2026-03-13`; `total` must be at least 20000. No additional `remaining` range is imposed here.

### Tools and structured output [#tools-and-structured-output]

Client tools require a name of 1–128 letters, digits, underscores or hyphens, and an `input_schema` with `type: "object"`. Use `tool_choice: {"type":"any"}` or `{"type":"tool","name":"lookup"}` to force a declared tool. With adaptive thinking, a forced tool response begins at the tool call without a thinking block.

`disable_parallel_tool_use` is an optional boolean for auto, any and tool choices; it is not a field of none. Send the tool result back with the original `tool_use_id`. Your application executes client tools.

```json
{
  "tools": [{
    "name": "lookup",
    "description": "Look up a product by SKU.",
    "input_schema": {
      "type": "object",
      "properties": {"sku": {"type": "string"}},
      "required": ["sku"],
      "additionalProperties": false
    }
  }],
  "tool_choice": {"type": "tool", "name": "lookup"}
}
```

Structured responses use `output_config.format: {"type":"json_schema","schema":{...}}`. Follow Anthropic's supported JSON Schema subset, including `additionalProperties: false` on objects. A valid shape does not guarantee factually correct values. Strict tools and structured output have schema-wide limits; see the [official structured-output reference](https://platform.claude.com/docs/en/build-with-claude/structured-outputs).

Computer use requires `computer_toolset_20260801`; the old computer tool versions are invalid. Browser use has its own `browser_toolset_20260801`. Declaring a tool does not verify that a complete server-tool session works. Review the tool's official guide and any beta requirements before using it.

## Media input [#media-input]

For images and PDFs, use publicly accessible HTTP(S) URLs in a user message's `content` blocks. Host your files yourself; this integration does not provide a Files API or uploads. Example image input:

```json
{"role":"user","content":[
  {"type":"image","source":{"type":"url","url":"https://example.com/chart.png"}},
  {"type":"text","text":"What does this chart show?"}
]}
```

Use a `document` block for a PDF. Keep tool-use IDs, complete thinking blocks and signatures unchanged when continuing a conversation. Your application executes client tools and returns their results; declaring a tool does not execute it.

## Pricing [#pricing]

USD per 1 million tokens

Current rates include each group’s multiplier. Prices are cached for up to 2 minutes.

One API key works across all models and groups. Default marks the first eligible group in the automatic routing order; the request is billed at the rates of the group actually selected.

### Claude Haiku 5.5

`claude-haiku-5-5`

| Billable tokens | claude · Default · ≤ 100,000 input tokens | claude · Default · > 100,000 input tokens |
| --- | ---: | ---: |
| Input (uncached) | $0.05 | $0.25 |
| Output | $0.25 | $1.25 |
| Cache read | $0.005 | $0.025 |
| Cache write · 5 minutes | $0.0625 | $0.3125 |
| Cache write · 1 hour | $0.1 | $0.5 |

The threshold uses: Uncached input tokens. The selected band applies to the whole request, not only the tokens above the threshold.

— means no verified quote is available; it does not mean free.

Cache rates apply only when the response reports the corresponding cache usage. Do not count cached tokens again as uncached input.

Multiply each billable token count by its matching rate and divide the total by 1,000,000. Thinking tokens are included in output tokens, not charged a second time. Cache reads, 5-minute writes and 1-hour writes have separate rates. For length-based pricing, choose the applicable band before calculating the request cost.

## Response and streaming [#response-and-streaming]

A completed message includes `id`, `type`, `role`, `model`, `content`, `stop_reason` and `usage`. Read text blocks from `content`; the first block may instead be thinking or a tool call. This example is illustrative:

```json
{
  "id": "msg_example",
  "type": "message",
  "role": "assistant",
  "model": "claude-haiku-5-5",
  "content": [{"type": "text", "text": "A database index helps locate rows without scanning the whole table."}],
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 24, "output_tokens": 18}
}
```

Set `stream: true` for SSE and use `curl -N`. Handle `message_start`, `content_block_start`, `content_block_delta`, `content_block_stop`, `message_delta` and `message_stop`, plus `ping` and stream errors. Read final usage rather than treating every chunk as a complete response.

## OpenAI-compatible formats [#openai-compatible-formats]

The same model ID works with `POST /v1/chat/completions` and `POST /v1/responses`. Use `Authorization: Bearer YOUR_API_KEY` and the OpenAI SDK base URL `https://api.wanapi.app/v1`. Chat Completions uses `messages`; Responses uses `input`. Their fields are converted to Messages, so use `/v1/messages` for the native parameters documented above.

```bash
curl https://api.wanapi.app/v1/chat/completions \
  -H "Authorization: Bearer $WAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-haiku-5-5","max_tokens":256,"messages":[{"role":"user","content":"Reply with OK."}]}'
```

## Usage logs and errors [#usage-logs-and-errors]

[LLM logs](/usage) show completed calls from the last 7 days, with the model, input tokens, output tokens and cost. Refresh after a call and filter by `claude-haiku-5-5`. Use [Task logs](/tasks) for images and videos.

Inspect the HTTP status and `error` object when a request fails. Check the key, [balance](/docs/balance), model ID and supported parameter combinations. A refusal or output-limit stop is different from an HTTP error. If a request or stream is interrupted, check the logs before retrying: a new request can incur another charge.

## Model references [#model-references]

* [Haiku 5.5 model overview](https://platform.claude.com/docs/en/models/haiku-5-5/overview)
* [Haiku 5.5 migration guide](https://platform.claude.com/docs/en/models/haiku-5-5/migration-guide)
* [Messages reference](https://platform.claude.com/docs/en/api/messages/create)
* [Beta Messages reference](https://platform.claude.com/docs/en/api/beta/messages/create)
* [Thinking](https://platform.claude.com/docs/en/build-with-claude/thinking), [effort](https://platform.claude.com/docs/en/build-with-claude/effort), [task budgets](https://platform.claude.com/docs/en/build-with-claude/task-budgets)
* [On-demand compaction](https://platform.claude.com/docs/en/build-with-claude/compaction-on-demand), [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing)
* [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching), [vision](https://platform.claude.com/docs/en/build-with-claude/vision), [PDF support](https://platform.claude.com/docs/en/build-with-claude/pdf-support)
