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

# 聊天请求（总览）

> 使用大语言模型进行对话交互

## 接口描述

该接口用于创建聊天补全任务，支持文本和图片输入（多模态）。

## 鉴权

需要使用 API Key 进行鉴权。在 Header 中添加 `Authorization: Bearer <your-api-key>`。

## 请求参数

| 参数名             | 类型      | 必填 | 描述                                     |
| :-------------- | :------ | :- | :------------------------------------- |
| model           | string  | 是  | 模型名称，例如 `gpt-5-mini`                   |
| messages        | array   | 是  | 聊天上下文信息                                |
| style           | string  | 否  | 接口风格，支持 `openai`（默认）、`claude`、`gemini` |
| stream          | boolean | 否  | 是否开启流式输出，默认为 `false`                   |
| stream\_options | object  | 否  | 流式输出选项                                 |

### Messages 参数说明

`messages` 数组中的每个元素包含：

| 参数名     | 类型           | 描述                                   |
| :------ | :----------- | :----------------------------------- |
| role    | string       | 角色，可以是 `user`, `assistant`, `system` |
| content | string/array | 内容。如果是多模态输入，可以使用数组格式。                |

### Style 参数说明

* `openai`：返回 OpenAI Chat Completions 风格结果（默认）
* `claude`：返回 Claude Messages 风格结果
* `gemini`：返回 Gemini 风格结果

## 子页面导航

<CardGroup cols={3}>
  <Card title="OpenAI 风格" icon="sparkles" href="/docs/api-reference/chat/openai-style">
    使用 `style: openai`，返回 OpenAI Chat Completions 风格结果。
  </Card>

  <Card title="Claude 风格" icon="star" href="/docs/api-reference/chat/claude-style">
    使用 `style: claude`，返回 Claude Messages 风格结果。
  </Card>

  <Card title="Gemini 风格" icon="bolt" href="/docs/api-reference/chat/gemini-style">
    使用 `style: gemini`，返回 Gemini 风格结果。
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /v1/chat/completions
openapi: 3.1.0
info:
  title: 启航 AI API
  version: 1.0.0
  description: 启航 AI API 文档，支持绘图、语音生成、视频生成、音乐生成等多种 AIGC 接口。
servers:
  - url: https://api.qhaigc.net
    description: 生产服务器
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      tags:
        - 聊天模型
      summary: 对话补全
      description: 使用大语言模型进行对话交互
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: 模型名称
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                      content:
                        type: string
                style:
                  type: string
                  enum:
                    - openai
                    - claude
                    - gemini
                  default: openai
                  description: 接口风格，支持 OpenAI、Claude、Gemini
                stream:
                  type: boolean
                  description: 是否流式
              required:
                - model
                - messages
      responses:
        '200':
          description: 成功响应 (流式)
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````