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

# 文本

> OpenAI 兼容文本 HTTP 接口说明。

> 适合聊天、多轮对话、Agent 编排和结构化文本输出。

## 端点列表

* [/v1/chat/completions](/api-reference/endpoints/openai/chat-completions)
* [/v1/responses](/api-reference/endpoints/openai/responses)

## 你应该怎么选

* 如果你在接传统聊天补全，优先用 `chat.completions`
* 如果你希望统一文本、结构化输出和后续多模态扩展，优先用 `responses`

## 请求要点

* 使用 `Authorization: Bearer {API_KEY}` 鉴权
* `chat.completions` 以 `messages` 为核心
* `responses` 以 `input`、`instructions`、`response_format` 为核心

## 返回要点

* `chat.completions` 常从 `choices[0].message.content` 读取文本
* `responses` 常从 `output_text` 或 `output[]` 中读取结果
* 流式模式下需要按 SSE chunk 逐段处理

## 参考旧页

* [OpenAI 兼容文本协议页](/api-reference/text/openai)
