> ## 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.

# Chat Completions

> 兼容 OpenAI 的 Chat Completions API

使用支持 Chat Completions 协议的模型。设置 `stream: true` 可获得 SSE 响应。

```bash theme={null}
curl https://api.vidgo.ai/v1/chat/completions \
  -H "Authorization: Bearer $VIDGO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"kimi-k3","messages":[{"role":"user","content":"Hello"}]}'
```

## 其他支持的模型

* `openai/gpt-6-astra`
* `anthropic/claude-fable-5.1`
* `xai/grok-4.6`
* `google/gemini-3.7-flash`
* `google/gemini-3.5-flash`
* `anthropic/claude-opus-4.8`
* `openai/gpt-5.5`
* `openai/gpt-5.4`
* `openai/gpt-5.2`
* `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`
* `openai/gpt-6.1-sol`
* `openai/gpt-6.1-terra`
* `openai/gpt-6-sol`
* `openai/gpt-6-luna`
* `google/gemini-3.8-flash`
* `google/gemini-4-argon`
* `google/gemini-3.1-pro-preview`
* `google/gemini-3-flash-preview`
* `deepseek/deepseek-v4-pro`
* `deepseek/deepseek-v4-flash`
* `deepseek/deepseek-v4.1-flash`
* `x-ai/grok-4.7`

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


## OpenAPI

````yaml zh/api-manual/chat-series/chat-completions.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Vidgo Chat Completions
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
security: []
paths:
  /v1/chat/completions:
    post:
      summary: 创建 Chat Completion
      description: >-
        使用原生协议请求体，不需要生成接口的 input 包装。JSON 和 SSE 响应体由上游转发；返回的模型名可能与 Vidgo 公开 ID
        不同。认证错误可能使用 detail 字段；协议错误使用该协议的错误结构。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  type: string
                  example: openai/gpt-6-astra
                messages:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                  minItems: 1
                stream:
                  type: boolean
                  default: false
              additionalProperties: true
            examples:
              workflow:
                summary: Vidgo 工作流程示例
                value:
                  model: openai/gpt-6-astra
                  messages:
                    - role: user
                      content: Hello
      responses:
        '200':
          description: Completion 或 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: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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