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

# GPT-6 Luna

> 通过 AnyFast 使用 OpenAI GPT-6 Luna，处理聚焦、高并发的推理、视觉和结构化输出任务。

GPT-6 Luna 是 OpenAI 面向聚焦、高并发任务的最高效 GPT-6 模型。使用模型 ID `gpt-6-luna`，可调用 OpenAI 兼容的 Responses API `POST /v1/responses` 或 Chat Completions API `POST /v1/chat/completions`。

<Info>
  内置工具、带推理的函数调用、图像输入、结构化输出和提示缓存建议使用 Responses API。Chat Completions 仅在 `reasoning_effort` 为 `none` 时支持函数调用。
</Info>

## 模型规格

| 属性          | 值                                          |
| ----------- | ------------------------------------------ |
| 模型 ID       | `gpt-6-luna`                               |
| 推荐接口        | Responses API                              |
| 输入          | 文本、图像                                      |
| 输出          | 文本                                         |
| 上下文窗口（官方规格） | 1,050,000 tokens                           |
| 最大输出        | 128,000 tokens                             |
| 知识截止时间      | 2026 年 5 月 18 日                            |
| 推理强度        | `none`、`low`、`medium`、`high`、`xhigh`、`max` |
| 默认推理强度      | `medium`                                   |
| 微调          | 不支持                                        |

## 适用场景

* 聚焦、高并发的文本处理
* 分类、抽取和结构化输出
* 对成本和吞吐敏感的智能体工作流
* 大上下文摘要与分析
* 结合文本与图像输入的视觉任务
* 日常编码和自动化任务

## 快速开始

<Tabs sync={false}>
  <Tab title="Responses API">
    ```bash cURL theme={null}
    curl https://www.anyfast.ai/v1/responses \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-6-luna",
        "input": "对这条客服工单分类，并返回简短的路由原因。",
        "reasoning": {
          "effort": "medium",
          "summary": "auto"
        },
        "max_output_tokens": 1024
      }'
    ```
  </Tab>

  <Tab title="Chat Completions">
    ```bash cURL theme={null}
    curl https://www.anyfast.ai/v1/chat/completions \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-6-luna",
        "messages": [
          { "role": "user", "content": "用三个要点总结这份事故报告。" }
        ],
        "reasoning_effort": "medium",
        "max_completion_tokens": 1024
      }'
    ```
  </Tab>
</Tabs>

## 工具调用

模型需要推理并调用工具时，使用 Responses API：

```bash cURL theme={null}
curl https://www.anyfast.ai/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-luna",
    "input": "查询订单 AF-1024 的状态。",
    "reasoning": { "effort": "medium" },
    "tools": [{
      "type": "function",
      "name": "get_order_status",
      "description": "返回订单的当前状态。",
      "parameters": {
        "type": "object",
        "properties": {
          "order_id": { "type": "string" }
        },
        "required": ["order_id"],
        "additionalProperties": false
      },
      "strict": true
    }],
    "tool_choice": "auto"
  }'
```

<Warning>
  Chat Completions 的函数调用要求 `reasoning_effort: "none"`。需要在 `low`、`medium`、`high`、`xhigh` 或 `max` 推理强度下调用工具时，请使用 Responses API。
</Warning>

Chat Completions 需要将每个函数定义放在 `function` 对象内：

```json theme={null}
{
  "type": "function",
  "function": {
    "name": "get_order_status",
    "description": "返回订单的当前状态。",
    "parameters": {
      "type": "object",
      "properties": {
        "order_id": { "type": "string" }
      },
      "required": ["order_id"],
      "additionalProperties": false
    },
    "strict": true
  }
}
```

### 内置工具

OpenAI 为 GPT-6 Luna 列出的 Responses API 工具包括：Web search、File search、Image generation、Code Interpreter、Hosted shell、Apply patch、Skills、Computer use、MCP 和 Tool search。不同工具具有各自的请求字段，并可能需要文件、向量存储、远程服务器或计算机操作循环等配套资源。

## 推理与采样规则

| 推理强度     | 典型用途                                  |
| -------- | ------------------------------------- |
| `none`   | 最低延迟、需要采样参数，或使用 Chat Completions 函数调用 |
| `low`    | 轻量推理的日常任务                             |
| `medium` | 通用分析和自动化；默认值                          |
| `high`   | 复杂多步骤任务                               |
| `xhigh`  | 高难度专业任务                               |
| `max`    | 最大推理深度                                |

<Warning>
  当推理强度不是 `none` 时，请移除 `temperature`、`top_p` 和 `top_logprobs`。Chat Completions 还需移除 `logprobs`；Responses 的 `include` 中不要请求 `message.output_text.logprobs`。
</Warning>

## 核心参数

| 参数                      | 接口               | 说明                                                  |
| ----------------------- | ---------------- | --------------------------------------------------- |
| `model`                 | 两者               | 必须为 `gpt-6-luna`                                    |
| `input`                 | Responses        | 文本或有序输入项                                            |
| `messages`              | Chat Completions | 有序会话消息                                              |
| `reasoning.effort`      | Responses        | `none`、`low`、`medium`、`high`、`xhigh` 或 `max`        |
| `reasoning_effort`      | Chat Completions | 与 Responses 相同的推理强度                                 |
| `max_output_tokens`     | Responses        | 可见输出和推理 token 的上限，最高 128,000                        |
| `max_completion_tokens` | Chat Completions | 补全和推理 token 的上限                                     |
| `tools`                 | 两者               | 工具定义；Chat Completions 要求 `reasoning_effort: "none"` |
| `text.format`           | Responses        | 文本或严格 JSON Schema 输出配置                              |
| `stream`                | 两者               | 流式返回响应事件                                            |

<Note>
  解析 Responses API 原始 JSON 时，应从消息项的 `output[].content[].text` 读取生成文本。部分官方 SDK 会提供聚合后的 `output_text` 便利属性，但调用方不应依赖原始 HTTP 响应一定包含顶层 `output_text` 字段。
</Note>

<Card title="API 参考" icon="code" href="/zh/api-reference/model-api/openai/gpt-6-luna">
  查看 GPT-6 Luna API 参考。
</Card>

## 官方参考

* [GPT-6 Luna 模型页面](https://developers.openai.com/api/docs/models/gpt-6-luna)
* [GPT-6 使用指南](https://developers.openai.com/api/docs/guides/latest-model)

<script src="/public/feedback.js" />
