---
title: "Create an Anthropic-compatible message"
method: POST
path: "/v1/messages"
tags: ["Anthropic"]
---

# Create an Anthropic-compatible message

`POST /v1/messages`

## Request

- Base URL: `https://nano-gpt.com/api`
- URL: `https://nano-gpt.com/api/v1/messages`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Accepts Anthropic Messages requests, including video blocks for models that advertise video input. Authenticate with an API key using the Authorization: Bearer header or the x-api-key header.

## Request body

- AnthropicMessageRequest
  - `output_config` InlineReasoningEffort
    - `effort` 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max', required: Astra: low, medium, high, xhigh. Fable 5.1: low, medium, high, xhigh, max; minimal maps to low. Other models and none are unsupported for inline updates.
  - `model` string, required: Model ID or compatibility alias. Append :reasoning-effort/<effort>, where effort is none, low, medium, high, xhigh, or max, to supply a default output_config.effort for enabled reasoning levels; none instead supplies thinking: { type: "disabled" }. The suffix is stripped before model routing and is not listed as a separate model. Explicit reasoning generation settings take precedence, including enabled thinking when the suffix is none. The none suffix requests disabled reasoning where supported; it does not bypass model/provider restrictions. Other effort levels remain model/provider-specific.
  - `max_tokens` integer
  - `messages` object[], required
    - `role` 'user' | 'assistant' | 'system', required
    - `content` union
      - string
      - union[]
        - union
          - AnthropicVideoBlock
            - `type` 'video', required
            - `source` union, required
              - …
          - object
    - `output_config` InlineReasoningEffort
      - `effort` 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max', required: Astra: low, medium, high, xhigh. Fable 5.1: low, medium, high, xhigh, max; minimal maps to low. Other models and none are unsupported for inline updates.

## Response `200`

Anthropic message response

- AnthropicMessage
  - `id` string
  - `type` string
  - `role` string
  - `model` string
  - `content` object[]
  - `stop_reason` string, nullable
  - `usage` object

## Other responses

- `400`: Bad Request. Video errors include video_input_not_supported, invalid_video_url_scheme, invalid_video_data_url, invalid_video_base64, invalid_video_mime_type, missing_video_source, video_file_id_not_supported, invalid_video_segment, video_segment_not_supported, and youtube_video_route_not_supported.
- `401`: Unauthorized

## Changes

- **2026-11-03** `cc8b07d75689`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nano-gpt/apis/nanogpt-api/changes/v1/messages/post.md)

---

[API](https://skmtc.dev/nano-gpt/apis/nanogpt-api.md) - [All operations](https://skmtc.dev/nano-gpt/apis/nanogpt-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nano-gpt/apis/nanogpt-api/revisions/cc8b07d75689?raw)
