> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# claude-haiku-5-5

> 通过 AnyFast 调用 Claude Haiku 5.5 Messages API。

<Note>
  实测 `claude-haiku-5-5` 请求的响应 `model` 为 `"claude-haiku-5.5"`，并带有额外的 `request_id` 和 `billing` 字段。关闭思维时请省略 `output_config.effort`；同时传 low 返回强度冲突 `400`。
</Note>


## OpenAPI

````yaml zh/api-reference/model-api/anthropic/openapi/claude-haiku-5-5/openapi.yaml POST /v1/messages
openapi: 3.1.0
info:
  title: Claude Haiku 5.5
  description: >-
    通过 AnyFast 调用 Anthropic Claude Haiku 5.5。模型具备 1M Token 上下文，最大支持 128K 输出
    Token，默认启用自适应思维。
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/messages:
    post:
      summary: 创建消息
      description: >
        发送文本、图片、历史 Assistant 消息和工具结果。Claude Haiku 5.5 可返回文本、Thinking 和工具调用内容块。


        自适应思维默认开启。使用 `output_config.effort` 控制深度；在 high 或以下强度可用
        `thinking.type=disabled`。强制工具调用可用，但不会先返回思维块。
      operationId: createMessageClaudeHaiku55Zh
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - max_tokens
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - claude-haiku-5-5
                  description: 模型 ID。
                  example: claude-haiku-5-5
                messages:
                  type: array
                  minItems: 1
                  description: >-
                    对话消息。多轮对话中应原样回传 Assistant 内容块，包括 Thinking 块。不要预填最后一条
                    Assistant 回答。
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - assistant
                        description: 消息作者。
                      content:
                        oneOf:
                          - type: string
                          - type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - text
                                    - image
                                    - tool_result
                                    - thinking
                                    - tool_use
                                text:
                                  type: string
                                source:
                                  type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - base64
                                        - url
                                    media_type:
                                      type: string
                                    data:
                                      type: string
                                    url:
                                      type: string
                                      format: uri
                                tool_use_id:
                                  type: string
                                content:
                                  oneOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: object
                                is_error:
                                  type: boolean
                                thinking:
                                  type: string
                                signature:
                                  type: string
                                id:
                                  type: string
                                name:
                                  type: string
                                input:
                                  type: object
                                  additionalProperties: true
                        description: 文本或内容块数组。
                  example:
                    - role: user
                      content: 找出这份迁移计划中风险最高的几个假设。
                max_tokens:
                  type: integer
                  minimum: 1
                  maximum: 128000
                  description: Thinking 与可见回答合计允许使用的最大输出 Token 数。
                  example: 4096
                system:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - text
                          text:
                            type: string
                  description: 系统提示词。回传 Haiku 5.5 Thinking 块时，应保持系统提示词不变。
                metadata:
                  type: object
                  properties:
                    user_id:
                      type: string
                      description: 与请求关联的外部用户标识。
                  description: 请求元数据。
                stop_sequences:
                  type: array
                  items:
                    type: string
                  description: 触发停止生成的自定义文本序列。
                stream:
                  type: boolean
                  default: false
                  description: 是否通过 SSE 流式返回消息事件。
                tools:
                  type: array
                  description: 模型可使用的工具定义。回传 Haiku 5.5 Thinking 块时，应保持此数组不变。
                  items:
                    type: object
                    required:
                      - name
                      - input_schema
                    properties:
                      name:
                        type: string
                        description: 工具名称。
                      description:
                        type: string
                        description: 工具的用途和使用时机。
                      input_schema:
                        type: object
                        description: 工具输入的 JSON Schema。
                        additionalProperties: true
                tool_choice:
                  type: object
                  required:
                    - type
                  properties:
                    type:
                      type: string
                      enum:
                        - auto
                        - none
                        - any
                        - tool
                      default: auto
                      description: >-
                        `auto` 允许模型自行判断；`none` 禁止调用工具。强制 `any` 或指定 `tool`
                        会直接调用工具，不先返回思维块。
                    name:
                      type: string
                      description: type 为 `tool` 时指定工具名称。
                  description: 控制模型是否可以使用工具。
                output_config:
                  type: object
                  properties:
                    effort:
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                        - xhigh
                        - max
                      default: medium
                      description: 控制 Adaptive Thinking 的深度、延迟和 Token 使用量。
                  description: 输出控制配置。Claude Haiku 5.5 默认使用 medium effort。
                thinking:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - adaptive
                        - disabled
                      default: adaptive
                      description: 默认使用 `adaptive`；在 high 或以下强度可用 `disabled`。
                  description: >-
                    省略该字段时默认使用自适应思维。在 AnyFast 使用 `disabled` 时请省略
                    `output_config.effort`；显式传 `effort: low` 会返回强度冲突错误。手动
                    `enabled` 加 `budget_tokens` 返回 400。
      responses:
        '200':
          description: 消息创建成功。安全策略拒绝请求时同样返回 HTTP 200，并将 `stop_reason` 设为 `refusal`。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '400':
          description: 请求无效，包括不支持的 Thinking 模式、Assistant 预填或已失效的 Thinking 块。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl https://www.anyfast.ai/v1/messages \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "model": "claude-haiku-5-5",
                "max_tokens": 4096,
                "output_config": { "effort": "medium" },
                "messages": [
                  { "role": "user", "content": "找出这份迁移计划中风险最高的几个假设。" }
                ]
              }'
components:
  schemas:
    Message:
      type: object
      required:
        - id
        - type
        - role
        - content
        - model
        - stop_reason
        - usage
      properties:
        id:
          type: string
          example: msg_01XFDUDYJgAACzvnptvVoYEL
        type:
          type: string
          enum:
            - message
        role:
          type: string
          enum:
            - assistant
        content:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - text
                  - thinking
                  - tool_use
              text:
                type: string
              thinking:
                type: string
              signature:
                type: string
              id:
                type: string
              name:
                type: string
              input:
                type: object
                additionalProperties: true
          example:
            - type: text
              text: 风险最高的假设是所有客户端都能接受计划中的切换窗口。
        model:
          type: string
          example: claude-haiku-5.5
          description: AnyFast 实测响应使用点号版本；请求仍使用带连字符的公开模型 ID。
        container:
          type: object
          nullable: true
          additionalProperties: true
          description: AnyFast 实测文本响应中为 null。
        stop_reason:
          type: string
          enum:
            - end_turn
            - max_tokens
            - stop_sequence
            - tool_use
            - refusal
            - model_context_window_exceeded
            - null
        stop_sequence:
          type: string
          nullable: true
        stop_details:
          type: object
          nullable: true
          additionalProperties: true
          description: 安全拒绝或其他停止原因的附加信息。
        request_id:
          type: string
          description: AnyFast 在响应体中添加的请求 ID。
        billing:
          type: object
          description: AnyFast 添加的计费信息；金额以字符串返回。
          properties:
            status:
              type: string
            billed_cost_usd:
              type: string
            currency:
              type: string
            zero_data_retention:
              type: boolean
            effective_discount_percent:
              type: number
        usage:
          type: object
          properties:
            service_tier:
              type: string
              example: standard
            input_tokens:
              type: integer
            output_tokens:
              type: integer
            cache_creation_input_tokens:
              type: integer
            cache_read_input_tokens:
              type: integer
            cache_creation:
              type: object
              properties:
                ephemeral_1h_input_tokens:
                  type: integer
                ephemeral_5m_input_tokens:
                  type: integer
            output_tokens_details:
              type: object
              properties:
                thinking_tokens:
                  type: integer
    Error:
      type: object
      properties:
        type:
          type: string
          example: error
        error:
          type: object
          properties:
            type:
              type: string
              example: invalid_request_error
            message:
              type: string
              example: 请求参数无效
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.