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

# OpenAI 风格

> 使用 OpenAI Chat Completions 风格返回结果

## 接口说明

该页面演示如何使用 OpenAI 风格调用聊天接口。

* `style` 固定为 `openai`
* 适合使用 OpenAI SDK 或兼容 OpenAI 返回结构的应用

## 请求示例

```bash theme={null}
curl --location --request POST 'https://api.qhaigc.net/v1/chat/completions' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-5-mini",
    "style": "openai",
    "messages": [
        {
            "role": "user",
            "content": "请用三句话介绍 RAG"
        }
    ],
    "stream": false
}'
```

## 相关页面

* [聊天请求（总览）](/docs/api-reference/chat/create)
* [Claude 风格](/docs/api-reference/chat/claude-style)
* [Gemini 风格](/docs/api-reference/chat/gemini-style)


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

````