---
title: "Anthropic Messages"
method: POST
path: "/anthropic/v1/messages"
tags: ["Chat Completions"]
---

# Anthropic Messages

`POST /anthropic/v1/messages`

## Headers

- `anthropic-version` string, nullable
- `anthropic-beta` string, nullable
- `x-deepinfra-source` string, nullable
- `xi-api-key` string, nullable
- `x-api-key` string, nullable

## Request body

- AnthropicMessagesIn
  - `model` string, required
  - `max_tokens` integer, nullable
  - `messages` object[], required
  - `system` union
    - string
    - AnthropicSystemContent[]
      - `type` 'text', required
      - `text` string, required
  - `stop_sequences` string[], nullable
  - `stream` boolean, nullable
  - `temperature` number, nullable
  - `top_p` number, nullable
  - `top_k` integer, nullable
  - `metadata` object, nullable
  - `tools` AnthropicTool[], nullable
    - `name` string, required
    - `description` string, nullable
    - `input_schema` object, required
  - `tool_choice` object, nullable
  - `thinking` AnthropicThinkingConfig — Anthropic `thinking` config: {type: enabled|disabled|adaptive, budget_tokens}. `enabled` is a legacy pre-spec field this endpoint used to accept; it only applies when `type` is absent.
    - `type` 'enabled' | 'disabled' | 'adaptive', nullable
    - `budget_tokens` integer, nullable
    - `enabled` boolean, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/deepinfra/apis/deepinfra-api.md) · [All operations](https://skmtc.net/deepinfra/apis/deepinfra-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deepinfra/deepinfra-api/versions/2df28210837a/schema)
