---
title: "Create a message (Anthropic Messages API)"
method: POST
path: "/v1/messages"
tags: ["messages"]
---

# Create a message (Anthropic Messages API)

`POST /v1/messages`

## Request body

- AnthropicapiMessagesRequest
  - `max_tokens` integer
  - `messages` AnthropicapiMessage[]
    - `content` union
      - string
      - AnthropicapiContentBlock[]
        - `content` union
          - string
          - AnthropicapiContentBlock[]
        - `id` string
        - `input` object
        - `is_error` boolean
        - `name` string
        - `source` union
          - string
          - object
        - `text` string
        - `thinking` string
        - `tool_use_id` string
        - `type` string
    - `role` string
  - `metadata` AnthropicapiMetadata
    - `user_id` string
  - `model` string
  - `stop_sequences` string[]
  - `stream` boolean
  - `system` union
    - string
    - AnthropicapiContentBlock[]
      - `content` union
        - string
        - AnthropicapiContentBlock[]
      - `id` string
      - `input` object
      - `is_error` boolean
      - `name` string
      - `source` union
        - string
        - object
      - `text` string
      - `thinking` string
      - `tool_use_id` string
      - `type` string
  - `temperature` number
  - `thinking` AnthropicapiThinking
    - `budget_tokens` integer
    - `type` string
  - `tool_choice` AnthropicapiToolChoice
    - `disable_parallel_tool_use` boolean
    - `name` string
    - `type` string
  - `tools` AnthropicapiTool[]
    - `description` string
    - `input_schema` object
    - `name` string
    - `type` string
  - `top_k` integer
  - `top_p` number

## Response `200`

JSON response or SSE stream when stream=true

- AnthropicapiMessagesResponse
  - `content` AnthropicapiResponseContentBlock[]
    - `id` string
    - `input` object
    - `name` string
    - `text` string
    - `thinking` string
    - `type` string
  - `id` string
  - `model` string
  - `role` string
  - `stop_reason` string
  - `stop_sequence` string
  - `type` string
  - `usage` AnthropicapiUsage
    - `cache_creation_input_tokens` integer
    - `cache_read_input_tokens` integer
    - `input_tokens` integer
    - `output_tokens` integer

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `429` — Too Many Requests
- `502` — Bad Gateway

---

[API](https://skmtc.net/enterpilot/apis/gomodel-api.md) · [All operations](https://skmtc.net/enterpilot/apis/gomodel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/enterpilot/gomodel-api/revisions/4c27ea61fcfe/schema)
