---
title: "Claude Messages API"
method: POST
path: "/v1/messages"
tags: ["Text Series"]
---

# Claude Messages API

`POST /v1/messages`

Send requests in the Claude Messages format. For the latest request parameter definitions, refer to the official Anthropic documentation: https://platform.claude.com/docs/en/api/messages/create

## Request body

- ClaudeMessageRequest
  - `model` string, required — Model name. Example: `claude-sonnet-4-5-20250929`.
  - `messages` ClaudeMessage[], required — 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."}].
    - `role` 'user' | 'assistant', required — Role type. Use `user` for user messages and `assistant` for model responses in multi-turn conversations.
    - `content` union, required — Message content. Supports plain text or structured blocks such as text and image content.
      - string
      - ClaudeContentBlock[]
        - `type` string, required
        - `text` string — Text content for text blocks.
        - `source` object — Source for image blocks.
          - `type` string
          - `media_type` string
          - `data` string — Base64-encoded image data.
          - `url` string — Image URL (if using URL source).
  - `max_tokens` integer — Maximum number of tokens to generate.
  - `system` union — System prompt for the assistant. Supports a string or structured text blocks.
    - string
    - ClaudeContentBlock[]
      - `type` string, required
      - `text` string — Text content for text blocks.
      - `source` object — Source for image blocks.
        - `type` string
        - `media_type` string
        - `data` string — Base64-encoded image data.
        - `url` string — Image URL (if using URL source).
  - `cache_control` ClaudeCacheControl — Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
    - `type` 'ephemeral' — Cache control type.
    - `ttl` '5m' | '1h' — Optional cache TTL. Defaults to `5m`.
  - `stream` boolean — Whether to use streaming output.
  - `stop_sequences` string[] — Stop sequences. The model stops when it encounters any of these strings.
  - `metadata` object — Additional metadata such as `user_id`.
  - `output_config` ClaudeOutputConfig — Configuration options for the model's output, such as output format and effort level.
    - `effort` 'low' | 'medium' | 'high' | 'xhigh' | 'max' — Output effort level.
    - `format` ClaudeOutputFormat — Schema-based structured output configuration.
      - `type` 'json_schema', required
      - `schema` object, required — JSON Schema that defines the output format.
  - `thinking` union — Configuration for Claude extended thinking. Use this field with the `claude-opus-4-7-thinking` model. Thinking tokens count toward `max_tokens`.
    - ClaudeThinkingEnabled — Enabled extended thinking. Requires `budget_tokens` >= 1024 and less than `max_tokens`.
      - `type` 'enabled'
      - `budget_tokens` integer, required — Token budget for Claude's internal reasoning process.
      - `display` 'summarized' | 'omitted' — Controls how thinking content appears in the response. Defaults to `summarized`.
    - ClaudeThinkingAdaptive — Adaptive extended thinking configuration.
      - `type` 'adaptive'
      - `display` 'summarized' | 'omitted' — Controls how thinking content appears in the response. Defaults to `summarized`.
    - ClaudeThinkingDisabled — Disable extended thinking.
      - `type` 'disabled'
  - `tools` ClaudeTool[] — Tool definitions available to the model.
    - `name` string, required — Tool name.
    - `description` string — Tool description shown to the model.
    - `input_schema` object, required — JSON Schema for tool inputs.
  - `tool_choice` union — Controls tool usage behavior. Examples: `auto`, or an object such as {"type": "tool", "name": "get_weather"}.
    - string
    - object

## Response `200`

Message created

- ClaudeMessageResponse
  - `code` integer
  - `data` ClaudeMessageResult
    - `id` string
    - `type` string
    - `role` string
    - `content` ClaudeContentBlock[]
      - `type` string, required
      - `text` string — Text content for text blocks.
      - `source` object — Source for image blocks.
        - `type` string
        - `media_type` string
        - `data` string — Base64-encoded image data.
        - `url` string — Image URL (if using URL source).
    - `model` string
    - `stop_reason` string
    - `stop_sequence` string, nullable
    - `usage` ClaudeUsage
      - `input_tokens` integer
      - `output_tokens` integer

---

[API](https://skmtc.net/poyo/apis/poyo-ai-hunyuan-3d-v3-1-api.md) · [All operations](https://skmtc.net/poyo/apis/poyo-ai-hunyuan-3d-v3-1-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/poyo/poyo-ai-hunyuan-3d-v3-1-api/revisions/4b46904b78eb/schema)
