> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vidgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Messages

> 兼容 Anthropic 的 Messages API

使用支持 Messages 协议的模型。`Authorization: Bearer` 和 `x-api-key` 两种认证方式均可。

```bash theme={null}
curl https://api.vidgo.ai/v1/messages \
  -H "x-api-key: $VIDGO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-5","max_tokens":512,"messages":[{"role":"user","content":"Hello"}]}'
```

## 其他支持的模型

* `anthropic/claude-fable-5.1`
* `anthropic/claude-opus-4.8`
* `anthropic/claude-sonnet-4.6`
* `anthropic/claude-opus-4.6`
* `anthropic/claude-opus-5.5`
* `anthropic/claude-sonnet-5.5`
* `anthropic/claude-haiku-5.5`
* `anthropic/claude-opus-4.7`
* `anthropic/claude-opus-4.5`
* `anthropic/claude-sonnet-4.5`
* `anthropic/claude-haiku-4.5`
* `deepseek/deepseek-v4.1-flash`

在根级发送协议字段，不需要生成接口的 input 包装。messages 必须是非空数组，max\_tokens 必须是正整数。


## OpenAPI

````yaml zh/api-manual/chat-series/claude-messages.json POST /v1/messages
openapi: 3.1.0
info:
  title: Vidgo Claude Messages
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
security: []
paths:
  /v1/messages:
    post:
      summary: 创建 Claude 消息
      description: >-
        使用原生协议请求体，不需要生成接口的 input 包装。JSON 和 SSE 响应体由上游转发；返回的模型名可能与 Vidgo 公开 ID
        不同。认证错误可能使用 detail 字段；协议错误使用该协议的错误结构。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
                - max_tokens
              properties:
                model:
                  type: string
                  example: anthropic/claude-fable-5.1
                messages:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                  minItems: 1
                max_tokens:
                  type: integer
                  minimum: 1
                stream:
                  type: boolean
                  default: false
              additionalProperties: true
            examples:
              workflow:
                summary: Vidgo 工作流程示例
                value:
                  model: anthropic/claude-fable-5.1
                  messages:
                    - role: user
                      content: Hello
                  max_tokens: 64
      responses:
        '200':
          description: Message 或 SSE 流
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
            text/event-stream:
              schema:
                type: string
        '400':
          description: 不支持的模型或协议
        '401':
          description: 凭证无效
        '402':
          description: 积分不足
        '403':
          description: 拒绝访问
        '404':
          description: 未找到厂商上下文
        '408':
          description: 请求超时
          content:
            text/plain:
              schema:
                type: string
              example: Request timeout
        '422':
          description: JSON 无效或请求体不是对象
        '429':
          description: 超出上游速率限制
        '502':
          description: 上游连接或响应错误
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.