# Messages API

Creates a model response in the Anthropic Messages API format.

Send the conversation history in `messages` on each request. Use `https://api.deepseek.com/anthropic` as the Anthropic SDK's `base_url`; the SDK appends `/v1/messages`. Direct HTTP requests can also use the compatible path `/anthropic/messages`.

Authenticate with either `x-api-key` or `Authorization: Bearer`. If both are supplied, `Authorization` takes precedence. See the [Anthropic API Guide](https://api-docs.deepseek.com/guides/anthropic_api.md) for model mappings, tool-result replay, and compatibility details.

Compatibility fields `container`, `mcp_servers`, `service_tier`, and `top_k` are ignored.

## Endpoint

```http
POST /anthropic/v1/messages
```

operationId: `createMessage`

### Servers

- `https://api.deepseek.com`

## Authentication

### Alternative 1

**anthropicApiKey**

`x-api-key` (header)

```yaml
type: apiKey
in: header
name: x-api-key
```

### Alternative 2

**bearerAuth**

`Authorization: Bearer <API_KEY>`

```yaml
type: http
scheme: bearer
```

## Parameters

**`anthropic-version`** (header) — optional

The Anthropic SDK sends this header automatically; the service currently ignores it.

- `type`: `string`

**Example**

```json
"2023-06-01"
```

**`anthropic-beta`** (header) — optional

Include `files-api-2025-04-14` when referencing an uploaded image with `source.type` of `file`. Otherwise not required for this endpoint. See the [Files API Guide](https://api-docs.deepseek.com/guides/files_api.md#anthropic-compatible-files-api).

- `type`: `string`

**Example**

```json
"files-api-2025-04-14"
```

## Request body

**required**

### application/json

- Reference: [CreateMessageRequest](#schema-create-message-request) (`#/components/schemas/CreateMessageRequest`)

## Responses

### 200 (No streaming)

OK, returns a `message` object. Its content may include text, thinking, and tool-use blocks.

#### application/json

- Reference: [AnthropicMessage](#schema-anthropic-message) (`#/components/schemas/AnthropicMessage`)

**Example**

```json
{
  "id": "e6ef6a63-a078-4f53-a73b-38c8d1d46310",
  "type": "message",
  "role": "assistant",
  "model": "deepseek-flash",
  "content": [{"type": "text", "text": "Hello!"}],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 12,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "output_tokens": 3,
    "service_tier": "standard"
  }
}
```

### 200 (Streaming)

OK, returns SSE events in the order `message_start` → content block events → `message_delta` → `message_stop`. A `ping` event or keep-alive comment may appear between events. There is no `data: [DONE]` message. Accumulate tool input JSON fragments until the content block ends before parsing them. See [Streaming](https://api-docs.deepseek.com/guides/anthropic_api.md#streaming).

A connection that closes before `message_stop` is an incomplete response. Errors after streaming has started may terminate the connection without an Anthropic `error` event.

#### text/event-stream

- `type`: `array`

- **Array items**

  - Reference: [AnthropicMessageStreamEvent](#schema-anthropic-message-stream-event) (`#/components/schemas/AnthropicMessageStreamEvent`)

**Example**

```
event: message_start
data: {"type":"message_start","message":{"id":"e6ef6a63-a078-4f53-a73b-38c8d1d46310","type":"message","role":"assistant","model":"deepseek-flash","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":12,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"service_tier":"standard"}}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

event: ping
data: {"type":"ping"}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello!"}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":12,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":3,"service_tier":"standard"}}

event: message_stop
data: {"type":"message_stop"}
```

### 400 (Bad request)

Invalid request, for example an empty `messages` array or unpaired tool results. Request errors use the common DeepSeek `{error: {message, type, param, code}}` structure, without the Anthropic top-level `type: "error"` field. See [Error Codes](https://api-docs.deepseek.com/quick_start/error_codes.md) for other HTTP errors.

#### application/json

- Reference: [ErrorResponse](#schema-error-response) (`#/components/schemas/ErrorResponse`)

**Example**

```json
{
  "error": {
    "message": "messages: at least one message is required",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request_error"
  }
}
```

## Code samples

### curl

```bash
# Set DEEPSEEK_API_KEY to your API key before running this example.
curl --silent --show-error --max-time 60 "https://api.deepseek.com/anthropic/v1/messages" \
  --header "x-api-key: ${DEEPSEEK_API_KEY}" \
  --header "anthropic-version: 2023-06-01" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "deepseek-flash",
  "messages": [{"role": "user", "content": "Say hello."}],
  "max_tokens": 32,
  "thinking": {"type": "disabled"},
  "stream": false
}'
```

### Python — Anthropic SDK

```python
# Install the SDK first: pip install anthropic
# Set DEEPSEEK_API_KEY to your API key before running this example.
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["DEEPSEEK_API_KEY"],
    base_url="https://api.deepseek.com/anthropic",
    timeout=60.0,
)

message = client.messages.create(
    model="deepseek-flash",
    messages=[{"role": "user", "content": "Say hello."}],
    max_tokens=32,
    thinking={"type": "disabled"},
    stream=False,
)
print(message.model_dump_json(indent=2))
```

## Referenced schemas

### schema-create-message-request

**CreateMessageRequest** — `#/components/schemas/CreateMessageRequest`

Creates the next assistant message using the Anthropic Messages format. Compatibility fields `container`, `mcp_servers`, `service_tier`, and `top_k` are ignored. See the [Anthropic API Guide](https://api-docs.deepseek.com/guides/anthropic_api.md) for compatibility details.

- `type`: `object`

- `required`: `["model","messages"]`

- **Properties**

  - **`model`** (required)

    ID of the model to use. Use `deepseek-flash` or `deepseek-v4-pro`. Claude model-name aliases are also accepted: `claude-opus*` maps to `deepseek-v4-pro`, and other `claude*` names map to `deepseek-flash`. See the [Anthropic API Guide](https://api-docs.deepseek.com/guides/anthropic_api.md).

    - `type`: `string`

    **Example**

    ```json
    "deepseek-flash"
    ```

  - **`messages`** (required)

    The conversation history. At least one message is required. This API is stateless: include the messages needed for the current turn in every request. Use the top-level `system` field for the system prompt. When continuing after a tool call, pass back the complete assistant content, including thinking and tool-use blocks, followed by the matching tool results. The service may restore omitted thinking content from tool-call IDs; if recovery is required but fails, the request returns `400`. Preserve the complete content for reliable replay.

    - `type`: `array`

    - `minItems`: `1`

    - **Array items**

      - Reference: [AnthropicMessageParam](#schema-anthropic-message-param) (`#/components/schemas/AnthropicMessageParam`)

  - **`system`** (optional)

    - Reference: [AnthropicSystemContent](#schema-anthropic-system-content) (`#/components/schemas/AnthropicSystemContent`)

  - **`max_tokens`** (optional)

    The requested output token limit, including thinking tokens. This field is optional at the HTTP API level; the Anthropic SDK requires it. The default and effective limit depend on the model, thinking mode, and reasoning effort. Values above the model limit are capped, and the input plus output must fit within the context window. For certain Claude Code or OpenCode main-agent requests in thinking mode, compatibility handling may raise the effective limit above the requested value, within model and context limits. See [Models & Pricing](https://api-docs.deepseek.com/quick_start/pricing.md).

    - `type`: `integer`

    - `minimum`: `1`

    - `nullable`: `true`

    **Example**

    ```json
    4096
    ```

  - **`stream`** (optional)

    If `true`, return named server-sent events (SSE), ending with `message_stop`. There is no `data: [DONE]` message. Otherwise, return one complete message object.

    - `type`: `boolean`

    - `nullable`: `true`

    - `default`: `false`

  - **`thinking`** (optional)

    - Reference: [AnthropicThinkingConfig](#schema-anthropic-thinking-config) (`#/components/schemas/AnthropicThinkingConfig`)

  - **`output_config`** (optional)

    - Reference: [AnthropicOutputConfig](#schema-anthropic-output-config) (`#/components/schemas/AnthropicOutputConfig`)

  - **`tools`** (optional)

    Tools available to the model. Supports client-defined tools and the web search server tool. Tool names must be unique. An empty list is treated as no tools. `cache_control` is ignored.

    - `type`: `array`

    - `nullable`: `true`

    - **Array items**

      - Reference: [AnthropicTool](#schema-anthropic-tool) (`#/components/schemas/AnthropicTool`)

  - **`tool_choice`** (optional)

    - Reference: [AnthropicToolChoice](#schema-anthropic-tool-choice) (`#/components/schemas/AnthropicToolChoice`)

  - **`stop_sequences`** (optional)

    Up to 16 non-empty strings that stop generation. If a string is matched, `stop_reason` is `stop_sequence` and `stop_sequence` contains the matched string.

    - `type`: `array`

    - `nullable`: `true`

    - `maxItems`: `16`

    - **Array items**

      - `type`: `string`

      - `minLength`: `1`

  - **`temperature`** (optional)

    Sampling temperature, between 0 and 2. Higher values produce more varied output. In thinking mode the value is fixed at 1, and the supplied value has no effect. We generally recommend changing either this or `top_p`, rather than both.

    - `type`: `number`

    - `nullable`: `true`

    - `minimum`: `0`

    - `maximum`: `2`

    - `default`: `1`

  - **`top_p`** (optional)

    Nucleus sampling probability, greater than 0 and at most 1. For `deepseek-flash`, thinking mode defaults to 1 and clamps values below 0.95 to 0.95; non-thinking mode always uses 1. For `deepseek-v4-pro`, thinking mode uses 0.95 when tools are enabled and 1 otherwise, ignoring the supplied value; non-thinking mode uses the supplied value, defaulting to 1. Setting `tool_choice` to `{"type":"none"}` disables tool calling.

    - `type`: `number`

    - `nullable`: `true`

    - `minimum`: `0`

    - `exclusiveMinimum`: `true`

    - `maximum`: `1`

    **Example**

    ```json
    1
    ```

  - **`metadata`** (optional)

    - Reference: [AnthropicMetadata](#schema-anthropic-metadata) (`#/components/schemas/AnthropicMetadata`)

### schema-anthropic-message

**AnthropicMessage** — `#/components/schemas/AnthropicMessage`

- title: `Message`

- `type`: `object`

- `required`: `["id","type","role","model","content","stop_reason","stop_sequence","usage"]`

- **Properties**

  - **`id`** (required)

    Unique identifier for this message.

    - `type`: `string`

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["message"]`

  - **`role`** (required)

    - `type`: `string`

    - `enum`: `["assistant"]`

  - **`model`** (required)

    The model identifier supplied in the request. When using a Claude-compatible model name, the response retains that name.

    - `type`: `string`

  - **`content`** (required)

    Generated content blocks. Preserve the full content when adding this assistant turn to the next request.

    - `type`: `array`

    - **Array items**

      - Reference: [AnthropicMessageOutputBlock](#schema-anthropic-message-output-block) (`#/components/schemas/AnthropicMessageOutputBlock`)

  - **`stop_reason`** (required)

    Why generation stopped: natural completion, output limit, a stop sequence, a client tool call, or content filtering. Null in message\_start.

    - `type`: `string`

    - `nullable`: `true`

    - `enum`: `["end_turn","max_tokens","stop_sequence","tool_use","refusal",null]`

  - **`stop_sequence`** (required)

    The matched stop sequence, or null when no stop sequence was matched.

    - `type`: `string`

    - `nullable`: `true`

  - **`usage`** (required)

    - Reference: [AnthropicMessageUsage](#schema-anthropic-message-usage) (`#/components/schemas/AnthropicMessageUsage`)

### schema-anthropic-message-stream-event

**AnthropicMessageStreamEvent** — `#/components/schemas/AnthropicMessageStreamEvent`

- title: `Message stream event`

Normal message events have an event name matching the JSON type. A normal stream ends with message\_stop. Ping events and keep-alive comments may appear between events; no data: \[DONE] is emitted. A timeout may instead return an unnamed data event containing an error object before closing the connection. An interrupted stream without message\_stop is incomplete.

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicMessageStartEvent](#schema-anthropic-message-start-event) (`#/components/schemas/AnthropicMessageStartEvent`)

  - oneOf 2

    - Reference: [AnthropicContentBlockStartEvent](#schema-anthropic-content-block-start-event) (`#/components/schemas/AnthropicContentBlockStartEvent`)

  - oneOf 3

    - Reference: [AnthropicContentBlockDeltaEvent](#schema-anthropic-content-block-delta-event) (`#/components/schemas/AnthropicContentBlockDeltaEvent`)

  - oneOf 4

    - Reference: [AnthropicContentBlockStopEvent](#schema-anthropic-content-block-stop-event) (`#/components/schemas/AnthropicContentBlockStopEvent`)

  - oneOf 5

    - Reference: [AnthropicMessageDeltaEvent](#schema-anthropic-message-delta-event) (`#/components/schemas/AnthropicMessageDeltaEvent`)

  - oneOf 6

    - Reference: [AnthropicMessageStopEvent](#schema-anthropic-message-stop-event) (`#/components/schemas/AnthropicMessageStopEvent`)

  - oneOf 7

    - Reference: [AnthropicPingEvent](#schema-anthropic-ping-event) (`#/components/schemas/AnthropicPingEvent`)

### schema-error-response

**ErrorResponse** — `#/components/schemas/ErrorResponse`

- `type`: `object`

- `required`: `["error"]`

- **Properties**

  - **`error`** (required)

    - Reference: [Error](#schema-error) (`#/components/schemas/Error`)

### schema-anthropic-message-param

**AnthropicMessageParam** — `#/components/schemas/AnthropicMessageParam`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicUserMessage](#schema-anthropic-user-message) (`#/components/schemas/AnthropicUserMessage`)

  - oneOf 2

    - Reference: [AnthropicAssistantMessage](#schema-anthropic-assistant-message) (`#/components/schemas/AnthropicAssistantMessage`)

### schema-anthropic-system-content

**AnthropicSystemContent** — `#/components/schemas/AnthropicSystemContent`

The system prompt. Supports only a string, an array of text blocks, or `null`.

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextContent](#schema-anthropic-text-content) (`#/components/schemas/AnthropicTextContent`)

  - oneOf 2

    - Reference: [AnthropicSystemBlocks](#schema-anthropic-system-blocks) (`#/components/schemas/AnthropicSystemBlocks`)

  - oneOf 3

    - Reference: [AnthropicNullValue](#schema-anthropic-null-value) (`#/components/schemas/AnthropicNullValue`)

### schema-anthropic-thinking-config

**AnthropicThinkingConfig** — `#/components/schemas/AnthropicThinkingConfig`

- title: `Thinking configuration`

Controls thinking mode. An explicit `thinking.type` takes precedence over `output_config.effort` when selecting the mode. When omitted, `effort` determines the mode. If neither is set, thinking is enabled by default for `deepseek-flash` and `deepseek-v4-pro`.

- `type`: `object`

- `required`: `["type"]`

- `nullable`: `true`

- **Properties**

  - **`type`** (required)

    `enabled` turns thinking on; `disabled` turns it off. `adaptive` is treated as `enabled`.

    - `type`: `string`

    - `enum`: `["enabled","disabled","adaptive"]`

  - **`budget_tokens`** (optional)

    Ignored. This parameter does not set a thinking-token budget.

    - `type`: `integer`

    - `minimum`: `0`

    - `nullable`: `true`

### schema-anthropic-output-config

**AnthropicOutputConfig** — `#/components/schemas/AnthropicOutputConfig`

- title: `Output configuration`

Output configuration. Only `effort` is supported; output-format settings such as `format` are ignored.

- `type`: `object`

- `nullable`: `true`

- **Properties**

  - **`effort`** (optional)

    Controls thinking mode and effort. `none` disables thinking unless `thinking.type` explicitly enables it. `low`, `high`, and `max` enable thinking, with `high` as the default effort. Compatibility aliases: `minimal` maps to `low`, `medium` and `xhigh` both map to `high`, and `ultra` maps to `max`. An explicit `thinking.type` determines whether thinking is enabled.

    - `type`: `string`

    - `enum`: `["none","minimal","low","medium","high","xhigh","ultra","max",null]`

    - `nullable`: `true`

### schema-anthropic-tool

**AnthropicTool** — `#/components/schemas/AnthropicTool`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicClientTool](#schema-anthropic-client-tool) (`#/components/schemas/AnthropicClientTool`)

  - oneOf 2

    - Reference: [AnthropicWebSearchTool](#schema-anthropic-web-search-tool) (`#/components/schemas/AnthropicWebSearchTool`)

### schema-anthropic-tool-choice

**AnthropicToolChoice** — `#/components/schemas/AnthropicToolChoice`

Controls tool selection. Defaults to `auto`. `any` is treated as `auto` and does not force a tool call. Selecting a named client tool requires non-thinking mode. `disable_parallel_tool_use` is ignored.

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicToolChoiceAuto](#schema-anthropic-tool-choice-auto) (`#/components/schemas/AnthropicToolChoiceAuto`)

  - oneOf 2

    - Reference: [AnthropicToolChoiceAny](#schema-anthropic-tool-choice-any) (`#/components/schemas/AnthropicToolChoiceAny`)

  - oneOf 3

    - Reference: [AnthropicToolChoiceNamed](#schema-anthropic-tool-choice-named) (`#/components/schemas/AnthropicToolChoiceNamed`)

  - oneOf 4

    - Reference: [AnthropicToolChoiceNone](#schema-anthropic-tool-choice-none) (`#/components/schemas/AnthropicToolChoiceNone`)

  - oneOf 5

    - Reference: [AnthropicNullValue](#schema-anthropic-null-value) (`#/components/schemas/AnthropicNullValue`)

### schema-anthropic-metadata

**AnthropicMetadata** — `#/components/schemas/AnthropicMetadata`

- title: `Metadata`

Request metadata. Only `user_id` is supported; other metadata fields are ignored.

- `type`: `object`

- `nullable`: `true`

- **Properties**

  - **`user_id`** (optional)

    A custom end-user identifier. We recommend using only ASCII letters, digits, underscores (`_`), and hyphens (`-`). The UTF-8 encoded value must not exceed 512 bytes. Do not include personal information. See [Rate Limit & Isolation](https://api-docs.deepseek.com/quick_start/rate_limit.md).

    - `type`: `string`

    - `nullable`: `true`

### schema-anthropic-message-output-block

**AnthropicMessageOutputBlock** — `#/components/schemas/AnthropicMessageOutputBlock`

- title: `Output content block`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextBlock](#schema-anthropic-text-block) (`#/components/schemas/AnthropicTextBlock`)

  - oneOf 2

    - Reference: [AnthropicOutputThinkingBlock](#schema-anthropic-output-thinking-block) (`#/components/schemas/AnthropicOutputThinkingBlock`)

  - oneOf 3

    - Reference: [AnthropicToolUseBlock](#schema-anthropic-tool-use-block) (`#/components/schemas/AnthropicToolUseBlock`)

  - oneOf 4

    - Reference: [AnthropicOutputServerToolUseBlock](#schema-anthropic-output-server-tool-use-block) (`#/components/schemas/AnthropicOutputServerToolUseBlock`)

  - oneOf 5

    - Reference: [AnthropicWebSearchToolResultBlock](#schema-anthropic-web-search-tool-result-block) (`#/components/schemas/AnthropicWebSearchToolResultBlock`)

### schema-anthropic-message-usage

**AnthropicMessageUsage** — `#/components/schemas/AnthropicMessageUsage`

- title: `Message usage`

- `type`: `object`

- `required`: `["input_tokens","cache_creation_input_tokens","cache_read_input_tokens","output_tokens","service_tier"]`

- **Properties**

  - **`input_tokens`** (required)

    Input tokens not served from the context cache. Total input tokens equal input\_tokens + cache\_read\_input\_tokens + cache\_creation\_input\_tokens.

    - `type`: `integer`

    - `minimum`: `0`

  - **`cache_creation_input_tokens`** (required)

    Always 0. Anthropic-style cache creation is not used; context caching is automatic.

    - `type`: `integer`

    - `enum`: `[0]`

  - **`cache_read_input_tokens`** (required)

    Input tokens served from the context cache.

    - `type`: `integer`

    - `minimum`: `0`

  - **`output_tokens`** (required)

    Generated output tokens, including thinking tokens when thinking is enabled. In message\_delta this is the cumulative count, not an increment.

    - `type`: `integer`

    - `minimum`: `0`

  - **`service_tier`** (required)

    - `type`: `string`

    - `enum`: `["standard"]`

  - **`server_tool_use`** (optional)

    - title: `Server tool usage`

    Server-side web search counts, separate from token usage. Present only when at least one web search was attempted; otherwise omitted. Both fields are present when this object is returned. Read the final message's usage for non-streaming responses or the final message\_delta.usage for streaming responses. These counts are cumulative, not deltas. See [Server tool usage](https://api-docs.deepseek.com/guides/anthropic_api.md#server-tool-usage).

    - `type`: `object`

    - `required`: `["web_search_requests","tool_search"]`

    - **Properties**

      - **`web_search_requests`** (required)

        Number of server-side web search attempts, including failed attempts and attempts exceeding `max_uses`.

        - `type`: `integer`

        - `minimum`: `0`

      - **`tool_search`** (required)

        Number of successful server-side web searches that returned nonempty results. Failed attempts and empty results are not counted. This field can be used as a basis for billing.

        - `type`: `integer`

        - `minimum`: `0`

    **Example**

    ```json
    {
      "web_search_requests": 1,
      "tool_search": 1
    }
    ```

### schema-anthropic-message-start-event

**AnthropicMessageStartEvent** — `#/components/schemas/AnthropicMessageStartEvent`

- title: `message_start`

- `type`: `object`

- `required`: `["type","message"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["message_start"]`

  - **`message`** (required)

    - Reference: [AnthropicMessage](#schema-anthropic-message) (`#/components/schemas/AnthropicMessage`)

### schema-anthropic-content-block-start-event

**AnthropicContentBlockStartEvent** — `#/components/schemas/AnthropicContentBlockStartEvent`

- title: `content_block_start`

- `type`: `object`

- `required`: `["type","index","content_block"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["content_block_start"]`

  - **`index`** (required)

    Zero-based index of the content block.

    - `type`: `integer`

    - `minimum`: `0`

  - **`content_block`** (required)

    - Reference: [AnthropicMessageOutputBlock](#schema-anthropic-message-output-block) (`#/components/schemas/AnthropicMessageOutputBlock`)

### schema-anthropic-content-block-delta-event

**AnthropicContentBlockDeltaEvent** — `#/components/schemas/AnthropicContentBlockDeltaEvent`

- title: `content_block_delta`

- `type`: `object`

- `required`: `["type","index","delta"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["content_block_delta"]`

  - **`index`** (required)

    Zero-based index of the content block.

    - `type`: `integer`

    - `minimum`: `0`

  - **`delta`** (required)

    - Reference: [AnthropicContentBlockDelta](#schema-anthropic-content-block-delta) (`#/components/schemas/AnthropicContentBlockDelta`)

### schema-anthropic-content-block-stop-event

**AnthropicContentBlockStopEvent** — `#/components/schemas/AnthropicContentBlockStopEvent`

- title: `content_block_stop`

- `type`: `object`

- `required`: `["type","index"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["content_block_stop"]`

  - **`index`** (required)

    Zero-based index of the content block.

    - `type`: `integer`

    - `minimum`: `0`

### schema-anthropic-message-delta-event

**AnthropicMessageDeltaEvent** — `#/components/schemas/AnthropicMessageDeltaEvent`

- title: `message_delta`

- `type`: `object`

- `required`: `["type","delta","usage"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["message_delta"]`

  - **`delta`** (required)

    - title: `Stop information`

    - `type`: `object`

    - `required`: `["stop_reason","stop_sequence"]`

    - **Properties**

      - **`stop_reason`** (required)

        The final reason generation stopped.

        - `type`: `string`

        - `nullable`: `false`

        - `enum`: `["end_turn","max_tokens","stop_sequence","tool_use","refusal"]`

      - **`stop_sequence`** (required)

        The matched stop sequence, or null when no stop sequence was matched.

        - `type`: `string`

        - `nullable`: `true`

  - **`usage`** (required)

    - Reference: [AnthropicMessageUsage](#schema-anthropic-message-usage) (`#/components/schemas/AnthropicMessageUsage`)

### schema-anthropic-message-stop-event

**AnthropicMessageStopEvent** — `#/components/schemas/AnthropicMessageStopEvent`

- title: `message_stop`

- `type`: `object`

- `required`: `["type"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["message_stop"]`

### schema-anthropic-ping-event

**AnthropicPingEvent** — `#/components/schemas/AnthropicPingEvent`

- title: `ping`

- `type`: `object`

- `required`: `["type"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["ping"]`

### schema-error

**Error** — `#/components/schemas/Error`

- `type`: `object`

- `required`: `["type","message","param","code"]`

- **Properties**

  - **`code`** (required)

    - `type`: `string`

    - `nullable`: `true`

  - **`message`** (required)

    - `type`: `string`

    - `nullable`: `false`

  - **`param`** (required)

    - `type`: `string`

    - `nullable`: `true`

  - **`type`** (required)

    - `type`: `string`

    - `nullable`: `false`

### schema-anthropic-user-message

**AnthropicUserMessage** — `#/components/schemas/AnthropicUserMessage`

- title: `User message`

- `type`: `object`

- `required`: `["role","content"]`

- **Properties**

  - **`role`** (required)

    - `type`: `string`

    - `enum`: `["user"]`

  - **`content`** (required)

    - Reference: [AnthropicUserContent](#schema-anthropic-user-content) (`#/components/schemas/AnthropicUserContent`)

### schema-anthropic-assistant-message

**AnthropicAssistantMessage** — `#/components/schemas/AnthropicAssistantMessage`

- title: `Assistant message`

A previous assistant message. Preserve its content blocks when passing it back, including thinking, tool use, and web search results.

- `type`: `object`

- `required`: `["role","content"]`

- **Properties**

  - **`role`** (required)

    - `type`: `string`

    - `enum`: `["assistant"]`

  - **`content`** (required)

    - Reference: [AnthropicAssistantContent](#schema-anthropic-assistant-content) (`#/components/schemas/AnthropicAssistantContent`)

### schema-anthropic-text-content

**AnthropicTextContent** — `#/components/schemas/AnthropicTextContent`

- title: `Text content`

- `type`: `string`

### schema-anthropic-system-blocks

**AnthropicSystemBlocks** — `#/components/schemas/AnthropicSystemBlocks`

- title: `System text blocks`

- `type`: `array`

- **Array items**

  - Reference: [AnthropicTextBlock](#schema-anthropic-text-block) (`#/components/schemas/AnthropicTextBlock`)

### schema-anthropic-null-value

**AnthropicNullValue** — `#/components/schemas/AnthropicNullValue`

- title: `Null value`

- `type`: `string`

- `nullable`: `true`

- `enum`: `[null]`

### schema-anthropic-client-tool

**AnthropicClientTool** — `#/components/schemas/AnthropicClientTool`

- title: `Client tool`

The application executes this tool after receiving a `tool_use` block and returns a `tool_result` block. Omit `type` for client tools. Providing `type` selects server-tool parsing; unsupported values such as `custom` return `422`. `cache_control` is ignored.

- `type`: `object`

- `required`: `["name","input_schema"]`

- **Properties**

  - **`name`** (required)

    A unique tool name containing letters, digits, underscores, or hyphens, up to 128 characters.

    - `type`: `string`

    - `minLength`: `1`

    - `maxLength`: `128`

    - `pattern`: `^[a-zA-Z0-9_-]+$`

  - **`description`** (optional)

    A description of what the tool does and when to use it.

    - `type`: `string`

    - `nullable`: `true`

  - **`input_schema`** (required)

    A valid JSON Schema describing the tool arguments. Its top-level `type` must be `object`.

    - `type`: `object`

    - **additionalProperties**

      - Schema: `true`

    **Example**

    ```json
    {
      "type": "object",
      "properties": {
        "city": {
          "type": "string"
        }
      },
      "required": [
        "city"
      ]
    }
    ```

- **not**

  - `required`: `["type"]`

### schema-anthropic-web-search-tool

**AnthropicWebSearchTool** — `#/components/schemas/AnthropicWebSearchTool`

- title: `Web search server tool`

The service executes web searches and returns `server_tool_use` and `web_search_tool_result` blocks in the assistant message. Both type values select the same tool.

- `type`: `object`

- `required`: `["type","name"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["web_search_20250305","web_search_20260209"]`

  - **`name`** (required)

    - `type`: `string`

    - `enum`: `["web_search"]`

  - **`max_uses`** (optional)

    Maximum searches allowed in this request. The default and service-side cap are normally 5; for Claude Code search-subagent compatibility requests, both are 1. Larger values are capped at the applicable limit. A search beyond this limit returns a `max_uses_exceeded` result.

    - `type`: `integer`

    - `minimum`: `0`

    - `nullable`: `true`

### schema-anthropic-tool-choice-auto

**AnthropicToolChoiceAuto** — `#/components/schemas/AnthropicToolChoiceAuto`

- title: `Automatic tool choice`

The model decides whether to call a tool. This is the default.

- `type`: `object`

- `required`: `["type"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["auto"]`

  - **`disable_parallel_tool_use`** (optional)

    Ignored; it does not disable parallel tool calls.

    - `type`: `boolean`

    - `nullable`: `true`

### schema-anthropic-tool-choice-any

**AnthropicToolChoiceAny** — `#/components/schemas/AnthropicToolChoiceAny`

- title: `Any tool (automatic)`

Treated as `auto`; the model decides whether to call a tool.

- `type`: `object`

- `required`: `["type"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["any"]`

  - **`disable_parallel_tool_use`** (optional)

    Ignored; it does not disable parallel tool calls.

    - `type`: `boolean`

    - `nullable`: `true`

### schema-anthropic-tool-choice-named

**AnthropicToolChoiceNamed** — `#/components/schemas/AnthropicToolChoiceNamed`

- title: `Named tool choice`

Selects the named tool. For a client tool, this forces a call in non-thinking mode; selecting it in thinking mode returns a `400` error. Set `thinking.type` to `disabled` when forcing a client-tool call.

- `type`: `object`

- `required`: `["type","name"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["tool"]`

  - **`name`** (required)

    The name of a tool present in `tools`.

    - `type`: `string`

  - **`disable_parallel_tool_use`** (optional)

    Ignored; it does not disable parallel tool calls.

    - `type`: `boolean`

    - `nullable`: `true`

### schema-anthropic-tool-choice-none

**AnthropicToolChoiceNone** — `#/components/schemas/AnthropicToolChoiceNone`

- title: `Disable tool calls`

Disables tool calling, even when `tools` is provided.

- `type`: `object`

- `required`: `["type"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["none"]`

### schema-anthropic-text-block

**AnthropicTextBlock** — `#/components/schemas/AnthropicTextBlock`

- title: `Text block`

Each text block must have `type: "text"`, with its content in the `text` field. On input, additional `cache_control` and `citations` fields are ignored.

- `type`: `object`

- `required`: `["type","text"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["text"]`

  - **`text`** (required)

    The text content.

    - `type`: `string`

### schema-anthropic-output-thinking-block

**AnthropicOutputThinkingBlock** — `#/components/schemas/AnthropicOutputThinkingBlock`

- title: `Thinking output`

- `type`: `object`

- `required`: `["type","thinking","signature"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["thinking"]`

  - **`thinking`** (required)

    The generated thinking content. Return this block unchanged when continuing a thinking-mode tool conversation.

    - `type`: `string`

  - **`signature`** (required)

    Opaque signature returned with the thinking block; preserve it when replaying the block.

    - `type`: `string`

### schema-anthropic-tool-use-block

**AnthropicToolUseBlock** — `#/components/schemas/AnthropicToolUseBlock`

- title: `Tool-use block`

Appears in assistant messages. Each tool-use block must have a matching tool-result block in the immediately following user message.

- `type`: `object`

- `required`: `["type","id","name","input"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["tool_use"]`

  - **`id`** (required)

    The tool-call ID. Pass this ID back as `tool_result.tool_use_id`.

    - `type`: `string`

  - **`name`** (required)

    The name of the client tool.

    - `type`: `string`

  - **`input`** (required)

    The JSON arguments supplied to the tool, normally an object matching its `input_schema`.

### schema-anthropic-output-server-tool-use-block

**AnthropicOutputServerToolUseBlock** — `#/components/schemas/AnthropicOutputServerToolUseBlock`

- title: `Server tool use output`

Describes a tool call executed by the service. Request-level search counts are reported separately in `usage.server_tool_use`; the client does not execute this call.

- `type`: `object`

- `required`: `["type","id","name","input","caller"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["server_tool_use"]`

  - **`id`** (required)

    Identifier of the server tool call.

    - `type`: `string`

  - **`name`** (required)

    Name of the server tool.

    - `type`: `string`

  - **`input`** (required)

    Arguments supplied to the server tool as a JSON value, normally an object.

  - **`caller`** (required)

    - title: `Caller`

    - `type`: `object`

    - `required`: `["type"]`

    - **Properties**

      - **`type`** (required)

        - `type`: `string`

        - `enum`: `["direct"]`

### schema-anthropic-web-search-tool-result-block

**AnthropicWebSearchToolResultBlock** — `#/components/schemas/AnthropicWebSearchToolResultBlock`

- title: `Web search result block`

- `type`: `object`

- `required`: `["type","tool_use_id","content"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["web_search_tool_result"]`

  - **`tool_use_id`** (required)

    The ID of the associated `server_tool_use` block.

    - `type`: `string`

  - **`content`** (required)

    Search results or search-error items. Pass the entire array back unchanged with the assistant message.

    - `type`: `array`

    - **Array items**

      - Reference: [AnthropicWebSearchResultContent](#schema-anthropic-web-search-result-content) (`#/components/schemas/AnthropicWebSearchResultContent`)

### schema-anthropic-content-block-delta

**AnthropicContentBlockDelta** — `#/components/schemas/AnthropicContentBlockDelta`

- title: `Content delta`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextDelta](#schema-anthropic-text-delta) (`#/components/schemas/AnthropicTextDelta`)

  - oneOf 2

    - Reference: [AnthropicThinkingDelta](#schema-anthropic-thinking-delta) (`#/components/schemas/AnthropicThinkingDelta`)

  - oneOf 3

    - Reference: [AnthropicSignatureDelta](#schema-anthropic-signature-delta) (`#/components/schemas/AnthropicSignatureDelta`)

  - oneOf 4

    - Reference: [AnthropicInputJsonDelta](#schema-anthropic-input-json-delta) (`#/components/schemas/AnthropicInputJsonDelta`)

### schema-anthropic-user-content

**AnthropicUserContent** — `#/components/schemas/AnthropicUserContent`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextContent](#schema-anthropic-text-content) (`#/components/schemas/AnthropicTextContent`)

  - oneOf 2

    - Reference: [AnthropicUserBlocks](#schema-anthropic-user-blocks) (`#/components/schemas/AnthropicUserBlocks`)

### schema-anthropic-assistant-content

**AnthropicAssistantContent** — `#/components/schemas/AnthropicAssistantContent`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextContent](#schema-anthropic-text-content) (`#/components/schemas/AnthropicTextContent`)

  - oneOf 2

    - Reference: [AnthropicAssistantBlocks](#schema-anthropic-assistant-blocks) (`#/components/schemas/AnthropicAssistantBlocks`)

### schema-anthropic-web-search-result-content

**AnthropicWebSearchResultContent** — `#/components/schemas/AnthropicWebSearchResultContent`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicWebSearchResult](#schema-anthropic-web-search-result) (`#/components/schemas/AnthropicWebSearchResult`)

  - oneOf 2

    - Reference: [AnthropicWebSearchToolResultError](#schema-anthropic-web-search-tool-result-error) (`#/components/schemas/AnthropicWebSearchToolResultError`)

### schema-anthropic-text-delta

**AnthropicTextDelta** — `#/components/schemas/AnthropicTextDelta`

- title: `Text delta`

- `type`: `object`

- `required`: `["type","text"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["text_delta"]`

  - **`text`** (required)

    Append this text to the current text block.

    - `type`: `string`

### schema-anthropic-thinking-delta

**AnthropicThinkingDelta** — `#/components/schemas/AnthropicThinkingDelta`

- title: `Thinking delta`

- `type`: `object`

- `required`: `["type","thinking"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["thinking_delta"]`

  - **`thinking`** (required)

    Append this text to the current thinking block.

    - `type`: `string`

### schema-anthropic-signature-delta

**AnthropicSignatureDelta** — `#/components/schemas/AnthropicSignatureDelta`

- title: `Signature delta`

- `type`: `object`

- `required`: `["type","signature"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["signature_delta"]`

  - **`signature`** (required)

    Signature for the completed thinking block.

    - `type`: `string`

### schema-anthropic-input-json-delta

**AnthropicInputJsonDelta** — `#/components/schemas/AnthropicInputJsonDelta`

- title: `Tool input delta`

- `type`: `object`

- `required`: `["type","partial_json"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["input_json_delta"]`

  - **`partial_json`** (required)

    A fragment of the tool input JSON. Concatenate all fragments for this block, then parse the JSON after content\_block\_stop.

    - `type`: `string`

### schema-anthropic-user-blocks

**AnthropicUserBlocks** — `#/components/schemas/AnthropicUserBlocks`

- title: `User content blocks`

Place all `tool_result` blocks before text or image blocks when replying to tool calls.

- `type`: `array`

- `minItems`: `1`

- **Array items**

  - Reference: [AnthropicUserContentBlock](#schema-anthropic-user-content-block) (`#/components/schemas/AnthropicUserContentBlock`)

### schema-anthropic-assistant-blocks

**AnthropicAssistantBlocks** — `#/components/schemas/AnthropicAssistantBlocks`

- title: `Assistant content blocks`

- `type`: `array`

- `minItems`: `1`

- **Array items**

  - Reference: [AnthropicAssistantContentBlock](#schema-anthropic-assistant-content-block) (`#/components/schemas/AnthropicAssistantContentBlock`)

### schema-anthropic-web-search-result

**AnthropicWebSearchResult** — `#/components/schemas/AnthropicWebSearchResult`

- title: `Web search result`

- `type`: `object`

- `required`: `["type","title","url","encrypted_content"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["web_search_result"]`

  - **`title`** (required)

    The title of the result page.

    - `type`: `string`

  - **`url`** (required)

    The URL of the result page.

    - `type`: `string`

    - `format`: `uri`

  - **`encrypted_content`** (required)

    Opaque result content. Preserve this value unchanged when passing the result back.

    - `type`: `string`

  - **`page_age`** (optional)

    Page-age metadata, when available; may be `null`.

    - `type`: `string`

    - `nullable`: `true`

### schema-anthropic-web-search-tool-result-error

**AnthropicWebSearchToolResultError** — `#/components/schemas/AnthropicWebSearchToolResultError`

- title: `Web search error`

- `type`: `object`

- `required`: `["type","error_code"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["web_search_tool_result_error"]`

  - **`error_code`** (required)

    The reason the server-side search failed.

    - `type`: `string`

    - `enum`: `["invalid_tool_input","unavailable","max_uses_exceeded","too_many_requests","query_too_long","request_too_large"]`

### schema-anthropic-user-content-block

**AnthropicUserContentBlock** — `#/components/schemas/AnthropicUserContentBlock`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextBlock](#schema-anthropic-text-block) (`#/components/schemas/AnthropicTextBlock`)

  - oneOf 2

    - Reference: [AnthropicImageBlock](#schema-anthropic-image-block) (`#/components/schemas/AnthropicImageBlock`)

  - oneOf 3

    - Reference: [AnthropicToolResultBlock](#schema-anthropic-tool-result-block) (`#/components/schemas/AnthropicToolResultBlock`)

### schema-anthropic-assistant-content-block

**AnthropicAssistantContentBlock** — `#/components/schemas/AnthropicAssistantContentBlock`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextBlock](#schema-anthropic-text-block) (`#/components/schemas/AnthropicTextBlock`)

  - oneOf 2

    - Reference: [AnthropicThinkingBlock](#schema-anthropic-thinking-block) (`#/components/schemas/AnthropicThinkingBlock`)

  - oneOf 3

    - Reference: [AnthropicToolUseBlock](#schema-anthropic-tool-use-block) (`#/components/schemas/AnthropicToolUseBlock`)

  - oneOf 4

    - Reference: [AnthropicServerToolUseBlock](#schema-anthropic-server-tool-use-block) (`#/components/schemas/AnthropicServerToolUseBlock`)

  - oneOf 5

    - Reference: [AnthropicWebSearchToolResultBlock](#schema-anthropic-web-search-tool-result-block) (`#/components/schemas/AnthropicWebSearchToolResultBlock`)

### schema-anthropic-image-block

**AnthropicImageBlock** — `#/components/schemas/AnthropicImageBlock`

- title: `Image block`

Image input is supported by `deepseek-flash` in user messages and tool results. Images in assistant messages are not supported. `deepseek-v4-pro` does not support image input. See the [Vision Guide](https://api-docs.deepseek.com/guides/vision.md) for image limits.

- `type`: `object`

- `required`: `["type","source"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["image"]`

  - **`source`** (required)

    - Reference: [AnthropicImageSource](#schema-anthropic-image-source) (`#/components/schemas/AnthropicImageSource`)

### schema-anthropic-tool-result-block

**AnthropicToolResultBlock** — `#/components/schemas/AnthropicToolResultBlock`

- title: `Tool-result block`

Only valid in user messages. Return one result for every pending tool-use ID, with no duplicates, before any text or image blocks.

- `type`: `object`

- `required`: `["type","tool_use_id"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["tool_result"]`

  - **`tool_use_id`** (required)

    The ID of the corresponding `tool_use` block in the immediately preceding assistant message.

    - `type`: `string`

  - **`content`** (optional)

    - Reference: [AnthropicToolResultContent](#schema-anthropic-tool-result-content) (`#/components/schemas/AnthropicToolResultContent`)

  - **`is_error`** (optional)

    Ignored. Include any error details in `content`.

    - `type`: `boolean`

    - `nullable`: `true`

### schema-anthropic-thinking-block

**AnthropicThinkingBlock** — `#/components/schemas/AnthropicThinkingBlock`

- title: `Thinking block`

- `type`: `object`

- `required`: `["type","thinking"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["thinking"]`

  - **`thinking`** (required)

    Thinking content returned by the model. Pass it back unchanged when continuing a tool-call turn in thinking mode.

    - `type`: `string`

  - **`signature`** (optional)

    The signature returned with the thinking block. Preserve it when passing back the block; the input signature is not validated.

    - `type`: `string`

    - `nullable`: `true`

### schema-anthropic-server-tool-use-block

**AnthropicServerToolUseBlock** — `#/components/schemas/AnthropicServerToolUseBlock`

- title: `Server-tool-use block`

Returned when the service runs web search. Its matching `web_search_tool_result` appears in the same assistant message; the client does not run this tool.

- `type`: `object`

- `required`: `["type","id","name","input"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["server_tool_use"]`

  - **`id`** (required)

    The server-tool-call ID.

    - `type`: `string`

  - **`name`** (required)

    - `type`: `string`

    - `enum`: `["web_search"]`

  - **`input`** (required)

    The server-tool arguments as a JSON value, normally an object such as `{"query":"..."}`. Preserve them when passing back the assistant message.

  - **`caller`** (optional)

    Identifies a direct server-tool call.

    - `type`: `object`

    - `required`: `["type"]`

    - **Properties**

      - **`type`** (required)

        - `type`: `string`

        - `enum`: `["direct"]`

### schema-anthropic-image-source

**AnthropicImageSource** — `#/components/schemas/AnthropicImageSource`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicBase64ImageSource](#schema-anthropic-base-64-image-source) (`#/components/schemas/AnthropicBase64ImageSource`)

  - oneOf 2

    - Reference: [AnthropicUrlImageSource](#schema-anthropic-url-image-source) (`#/components/schemas/AnthropicUrlImageSource`)

  - oneOf 3

    - Reference: [AnthropicFileImageSource](#schema-anthropic-file-image-source) (`#/components/schemas/AnthropicFileImageSource`)

### schema-anthropic-tool-result-content

**AnthropicToolResultContent** — `#/components/schemas/AnthropicToolResultContent`

The tool output as a string or a list of text and image blocks. If omitted or `null`, the result is empty.

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextContent](#schema-anthropic-text-content) (`#/components/schemas/AnthropicTextContent`)

  - oneOf 2

    - Reference: [AnthropicToolResultBlocks](#schema-anthropic-tool-result-blocks) (`#/components/schemas/AnthropicToolResultBlocks`)

  - oneOf 3

    - Reference: [AnthropicNullValue](#schema-anthropic-null-value) (`#/components/schemas/AnthropicNullValue`)

### schema-anthropic-base-64-image-source

**AnthropicBase64ImageSource** — `#/components/schemas/AnthropicBase64ImageSource`

- title: `Base64 image`

- `type`: `object`

- `required`: `["type","media_type","data"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["base64"]`

  - **`media_type`** (required)

    - `type`: `string`

    - `enum`: `["image/jpeg","image/png","image/gif","image/webp"]`

  - **`data`** (required)

    The base64-encoded image bytes, without a data-URL prefix.

    - `type`: `string`

### schema-anthropic-url-image-source

**AnthropicUrlImageSource** — `#/components/schemas/AnthropicUrlImageSource`

- title: `Image URL`

- `type`: `object`

- `required`: `["type","url"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["url"]`

  - **`url`** (required)

    An HTTP or HTTPS URL from which the server can download the image.

    - `type`: `string`

    - `format`: `uri`

### schema-anthropic-file-image-source

**AnthropicFileImageSource** — `#/components/schemas/AnthropicFileImageSource`

- title: `Uploaded image file`

Requires the request header `anthropic-beta: files-api-2025-04-14`.

- `type`: `object`

- `required`: `["type","file_id"]`

- **Properties**

  - **`type`** (required)

    - `type`: `string`

    - `enum`: `["file"]`

  - **`file_id`** (required)

    The ID of an uploaded image file. See the [Files API Guide](https://api-docs.deepseek.com/guides/files_api.md#anthropic-compatible-files-api).

    - `type`: `string`

### schema-anthropic-tool-result-blocks

**AnthropicToolResultBlocks** — `#/components/schemas/AnthropicToolResultBlocks`

- title: `Tool-result content blocks`

- `type`: `array`

- **Array items**

  - Reference: [AnthropicToolResultContentBlock](#schema-anthropic-tool-result-content-block) (`#/components/schemas/AnthropicToolResultContentBlock`)

### schema-anthropic-tool-result-content-block

**AnthropicToolResultContentBlock** — `#/components/schemas/AnthropicToolResultContentBlock`

- **oneOf**

  - oneOf 1

    - Reference: [AnthropicTextBlock](#schema-anthropic-text-block) (`#/components/schemas/AnthropicTextBlock`)

  - oneOf 2

    - Reference: [AnthropicImageBlock](#schema-anthropic-image-block) (`#/components/schemas/AnthropicImageBlock`)
