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

# Anthropic

> Call Anthropic Claude 5.5, 5, and 4 series models through the Anthropic Messages or Chat Completions endpoint.

Anthropic Claude models cover coding, long-horizon agents, research, vision, and knowledge work. The playground on this page uses [Anthropic Messages](https://docs.poyo.ai/api-manual/chat-series/claude-messages.md), which every Claude model supports.

## Models

* **claude-opus-5-5** — Claude Opus 5.5.
* **claude-sonnet-5-5** — Claude Sonnet 5.5.
* **claude-haiku-5-5** — Claude Haiku 5.5, a compact model for classification, extraction, summaries, and subagents, with a 1M-token context.
* **claude-fable-5-1** — Claude Fable 5.1, for long-horizon coding, research, and vision, with 1M context and up to 128K output.
* **claude-opus-5** — Claude Opus 5, for advanced coding, computer use, and deep research.
* **claude-sonnet-5** — Claude Sonnet 5, for agentic coding and browser or computer use, with 1M context and up to 128K output.
* **claude-opus-4-8** — Claude Opus 4.8, with 1M context and up to 128K output.
* **claude-opus-4-7** — Claude Opus 4.7, for coding, deep reasoning, and high-resolution vision.
* **claude-opus-4-6** — Claude Opus 4.6.
* **claude-sonnet-4-6** — Claude Sonnet 4.6.
* **claude-opus-4-5-20251101** — Claude Opus 4.5.
* **claude-sonnet-4-5-20250929** — Claude Sonnet 4.5.
* **claude-haiku-4-5-20251001** — Claude Haiku 4.5.

Every Claude model supports Anthropic Messages and Chat Completions.

## Examples

* **Basic Claude message** — single user message with `max_tokens`.

For streaming, extended thinking, and tool use, see the examples on [Anthropic Messages](https://docs.poyo.ai/api-manual/chat-series/claude-messages.md). To call a model with the Chat Completions format, send the same model id to [Chat Completions](https://docs.poyo.ai/api-manual/chat-series/chat-completions.md).

## Notes

* See [LLM Models](https://docs.poyo.ai/api-manual/chat-series/overview.md) for every model and the formats it supports.


## OpenAPI

````yaml api-manual/chat-series/anthropic.json POST /v1/messages
openapi: 3.0.0
info:
  title: Anthropic API
  description: Call Anthropic Claude models through the Anthropic Messages endpoint.
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/messages:
    post:
      tags:
        - Text Series
      summary: Anthropic
      description: Messages with Anthropic Claude models.
      operationId: createAnthropicMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClaudeMessageRequest'
            examples:
              basic:
                summary: Basic Claude message
                value:
                  model: claude-sonnet-4-5-20250929
                  max_tokens: 1024
                  messages:
                    - role: user
                      content: >-
                        Rewrite the following product announcement to be more
                        gentle and user-friendly: We will have maintenance for 2
                        hours this weekend, services will be unavailable during
                        this time.
      responses:
        '200':
          description: Message created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClaudeMessageResult'
              examples:
                success:
                  summary: Successful response
                  value:
                    id: msg_013zva2CMHNLnXJNN3QKQ2EF
                    type: message
                    role: assistant
                    content:
                      - type: text
                        text: Hello! I'm Claude. Nice to meet you.
                    model: claude-sonnet-4-5-20250929
                    stop_reason: end_turn
                    stop_sequence: null
                    usage:
                      input_tokens: 10
                      output_tokens: 13
        '400':
          description: >-
            Invalid request parameters, or the model does not support this API
            format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoyoValidationError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoyoAuthError'
        '404':
          description: Unknown model id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpstreamFormatError'
              example:
                error:
                  message: 'Model not found: no-such-model'
                  type: invalid_request_error
                  code: model_not_found
components:
  schemas:
    ClaudeMessageRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          enum:
            - claude-opus-5-5
            - claude-sonnet-5-5
            - claude-haiku-5-5
            - claude-fable-5-1
            - claude-opus-5
            - claude-sonnet-5
            - claude-opus-4-8
            - claude-opus-4-7
            - claude-opus-4-6
            - claude-sonnet-4-6
            - claude-opus-4-5-20251101
            - claude-sonnet-4-5-20250929
            - claude-haiku-4-5-20251001
          default: claude-sonnet-4-5-20250929
          description: Anthropic Claude model id.
        messages:
          type: array
          description: >-
            List of conversation messages in order. Each message contains a
            `role` and `content`. Use `user` for user input and `assistant` for
            previous model output in multi-turn conversations. Example:
            [{"role": "user", "content": "Summarize the purpose of feature
            canary releases in two sentences."}].
          items:
            $ref: '#/components/schemas/ClaudeMessage'
        max_tokens:
          type: integer
          minimum: 1
          description: Maximum number of tokens to generate.
          example: 1024
        system:
          description: >-
            System prompt for the assistant. Supports a string or structured
            text blocks.
          oneOf:
            - type: string
              example: >-
                You are a product announcement editor, keep it objective and
                concise.
            - type: array
              items:
                $ref: '#/components/schemas/ClaudeContentBlock'
        cache_control:
          $ref: '#/components/schemas/ClaudeCacheControl'
        stream:
          type: boolean
          description: Whether to use streaming output.
          example: false
        stop_sequences:
          type: array
          description: >-
            Stop sequences. The model stops when it encounters any of these
            strings.
          items:
            type: string
        metadata:
          type: object
          description: Additional metadata such as `user_id`.
          additionalProperties: true
        output_config:
          $ref: '#/components/schemas/ClaudeOutputConfig'
        thinking:
          description: >-
            Configuration for Claude extended thinking. Supported on Claude
            models with extended thinking. Thinking tokens count toward
            `max_tokens`.
          oneOf:
            - $ref: '#/components/schemas/ClaudeThinkingEnabled'
            - $ref: '#/components/schemas/ClaudeThinkingAdaptive'
            - $ref: '#/components/schemas/ClaudeThinkingDisabled'
        tools:
          type: array
          description: Tool definitions available to the model.
          items:
            $ref: '#/components/schemas/ClaudeTool'
        tool_choice:
          description: >-
            Controls tool usage behavior. Examples: `auto`, or an object such as
            {"type": "tool", "name": "get_weather"}.
          oneOf:
            - type: string
              example: auto
            - type: object
              additionalProperties: true
    ClaudeMessageResult:
      type: object
      properties:
        id:
          type: string
          example: msg_013zva2CMHNLnXJNN3QKQ2EF
        type:
          type: string
          example: message
        role:
          type: string
          example: assistant
        content:
          type: array
          items:
            $ref: '#/components/schemas/ClaudeContentBlock'
        model:
          type: string
          example: claude-sonnet-4-5-20250929
        stop_reason:
          type: string
          example: end_turn
        stop_sequence:
          nullable: true
          type: string
        usage:
          $ref: '#/components/schemas/ClaudeUsage'
    PoyoValidationError:
      type: object
      properties:
        code:
          type: integer
          example: 400
        error:
          type: object
          properties:
            message:
              type: string
              example: 'Invalid request parameters: messages: Field required'
            type:
              type: string
              example: validation_error
            details:
              type: object
              description: Field-level validation errors when available.
    PoyoAuthError:
      type: object
      properties:
        code:
          type: integer
          example: 401
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid API key
            type:
              type: string
              example: authentication_error
    UpstreamFormatError:
      type: object
      description: >-
        Error returned when the model or request is rejected for this API
        format.
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: 'Model not found: no-such-model'
            type:
              type: string
              example: invalid_request_error
            code:
              type: string
              example: model_not_found
    ClaudeMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          description: >-
            Role type. Use `user` for user messages and `assistant` for model
            responses in multi-turn conversations.
          example: user
        content:
          description: >-
            Message content. Supports plain text or structured blocks such as
            text and image content.
          oneOf:
            - type: string
              example: >-
                Summarize the purpose of feature canary releases in two
                sentences.
            - type: array
              items:
                $ref: '#/components/schemas/ClaudeContentBlock'
    ClaudeContentBlock:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          example: text
        text:
          type: string
          description: Text content for text blocks.
          example: Hello! I'm Claude. Nice to meet you.
        source:
          type: object
          description: Source for image blocks.
          properties:
            type:
              type: string
              example: base64
            media_type:
              type: string
              example: image/png
            data:
              type: string
              description: Base64-encoded image data.
            url:
              type: string
              description: Image URL (if using URL source).
    ClaudeCacheControl:
      type: object
      description: >-
        Top-level cache control automatically applies a cache_control marker to
        the last cacheable block in the request.
      properties:
        type:
          type: string
          enum:
            - ephemeral
          description: Cache control type.
          example: ephemeral
        ttl:
          type: string
          enum:
            - 5m
            - 1h
          description: Optional cache TTL. Defaults to `5m`.
          example: 1h
    ClaudeOutputConfig:
      type: object
      description: >-
        Configuration options for the model's output, such as output format and
        effort level.
      properties:
        effort:
          type: string
          enum:
            - low
            - medium
            - high
            - xhigh
            - max
          description: Output effort level.
          example: high
        format:
          $ref: '#/components/schemas/ClaudeOutputFormat'
          description: Structured output format configuration.
    ClaudeThinkingEnabled:
      type: object
      description: >-
        Enabled extended thinking. Requires `budget_tokens` >= 1024 and less
        than `max_tokens`.
      required:
        - budget_tokens
      properties:
        type:
          type: string
          enum:
            - enabled
          example: enabled
        budget_tokens:
          type: integer
          minimum: 1024
          description: Token budget for Claude's internal reasoning process.
          example: 2048
        display:
          type: string
          enum:
            - summarized
            - omitted
          description: >-
            Controls how thinking content appears in the response. Defaults to
            `summarized`.
          example: summarized
    ClaudeThinkingAdaptive:
      type: object
      description: Adaptive extended thinking configuration.
      properties:
        type:
          type: string
          enum:
            - adaptive
          example: adaptive
        display:
          type: string
          enum:
            - summarized
            - omitted
          description: >-
            Controls how thinking content appears in the response. Defaults to
            `summarized`.
          example: omitted
    ClaudeThinkingDisabled:
      type: object
      description: Disable extended thinking.
      properties:
        type:
          type: string
          enum:
            - disabled
          example: disabled
    ClaudeTool:
      type: object
      description: Tool definition available to the model.
      required:
        - name
        - input_schema
      properties:
        name:
          type: string
          description: Tool name.
          example: get_weather
        description:
          type: string
          description: Tool description shown to the model.
          example: Fetch the weather by city name.
        input_schema:
          type: object
          description: JSON Schema for tool inputs.
          additionalProperties: true
    ClaudeUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          example: 10
        output_tokens:
          type: integer
          example: 13
    ClaudeOutputFormat:
      type: object
      description: Schema-based structured output configuration.
      required:
        - type
        - schema
      properties:
        type:
          type: string
          enum:
            - json_schema
          example: json_schema
        schema:
          type: object
          description: JSON Schema that defines the output format.
          additionalProperties: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: |-
        API key for authentication.

        Visit the API Key Management Page to get your API Key

        Add to the request header:

        ```
        x-api-key: YOUR_API_KEY
        ```

````

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