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

> 通过 AnyFast Responses API 调用 OpenAI GPT-6 Astra，处理复杂推理、编码、研究、计算机操作和文档工作流。

GPT-6 Astra 是 OpenAI 面向复杂推理、编码、研究、计算机操作和文档创建的 GPT-6 旗舰模型。使用模型 ID `gpt-6-astra`，通过 OpenAI 兼容的 Responses API `POST /v1/responses` 调用。

<Info>
  `gpt-6-astra` 同时支持 `POST /v1/responses` 和 `POST /v1/chat/completions`。工具调用、图片和文件输入、结构化输出及提示词缓存请使用 Responses API。
</Info>

## 模型规格

| 属性     | 取值                                  |
| ------ | ----------------------------------- |
| 模型 ID  | `gpt-6-astra`                       |
| 推荐接口   | Responses API                       |
| 输入     | 文本、图片                               |
| 输出     | 文本                                  |
| 上下文窗口  | 1,050,000 Tokens                    |
| 最大输入   | 922,000 Tokens                      |
| 最大输出   | 128,000 Tokens                      |
| 知识截止日期 | 2026 年 4 月 30 日                     |
| 推理强度   | `low`、`medium`、`high`、`xhigh`、`max` |
| 微调     | 不支持                                 |

## 核心能力

* **长上下文推理** — 在 105 万 Token 上下文窗口中分析大型代码库、文档和多步骤工作流。
* **软件工程** — 跨文件、工具和验证步骤规划并执行长周期编码任务。
* **图片理解** — 将图片和文本指令一起传入模型。
* **结构化输出** — 按指定 Schema 返回 JSON。
* **提示词缓存** — `prompt_cache_key` 和 `prompt_cache_options` 支持 `30m` 缓存时长，并返回缓存写入与命中 Token 数。
* **Responses API 工具** — AnyFast 支持网页搜索、代码解释器、Hosted Shell、Apply Patch、Computer Use、MCP、Function 和 Custom Tool。
* **异步工具调用** — Function 和 Custom Tool 支持 `async: true`，并返回相应工具调用项。

## 能力示例

<Tabs sync={false}>
  <Tab title="文本与推理">
    使用 `reasoning.effort` 在延迟和推理深度之间进行选择。GPT-6 Astra 支持 `low`、`medium`、`high`、`xhigh` 和 `max`。

    ```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-astra",
        "input": "审查这个重试方案，找出竞态条件并给出安全的实现计划。",
        "reasoning": {
          "effort": "high",
          "summary": "auto"
        },
        "max_output_tokens": 4096
      }'
    ```
  </Tab>

  <Tab title="图片和文件输入">
    分析架构图、截图或图表时添加 `input_image` 内容块；分析文档时，可通过 `input_file` 传入内联 Base64 数据。

    ```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-astra",
        "input": [{
          "role": "user",
          "content": [
            { "type": "input_text", "text": "找出这张架构图中的故障点。" },
            { "type": "input_image", "image_url": "data:image/png;base64,<BASE64_IMAGE_DATA>", "detail": "high" },
            { "type": "input_file", "filename": "deployment-notes.pdf", "file_data": "data:application/pdf;base64,<BASE64_PDF_DATA>" }
          ]
        }],
        "reasoning": { "effort": "high" }
      }'
    ```
  </Tab>

  <Tab title="结构化输出">
    当应用需要可直接解析的数据时，将 `text.format.type` 设为 `json_schema`，并提供严格的 JSON Schema。

    ```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-astra",
        "input": "将部署风险分类为低、中或高。",
        "text": {
          "format": {
            "type": "json_schema",
            "name": "deployment_risk",
            "strict": true,
            "schema": {
              "type": "object",
              "properties": {
                "risk": { "type": "string", "enum": ["low", "medium", "high"] },
                "reason": { "type": "string" }
              },
              "required": ["risk", "reason"],
              "additionalProperties": false
            }
          }
        }
      }'
    ```
  </Tab>

  <Tab title="工具工作流">
    Function Calling 请使用 Responses API。根据 OpenAI 的 GPT-6 Astra 说明，Chat Completions 不支持该模型的工具调用。

    ```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-astra",
        "input": "检查服务 api-gateway 的部署状态。",
        "tools": [{
          "type": "function",
          "name": "get_deployment_status",
          "description": "返回指定服务当前的部署状态。",
          "parameters": {
            "type": "object",
            "properties": {
              "service": { "type": "string" }
            },
            "required": ["service"],
            "additionalProperties": false
          },
          "strict": true
        }],
        "tool_choice": "auto"
      }'
    ```
  </Tab>
</Tabs>

## 推理配置

| 推理强度     | 适用场景         |
| -------- | ------------ |
| `low`    | 低延迟请求和常规任务   |
| `medium` | 通用推理和编码      |
| `high`   | 复杂分析和多步骤工作   |
| `xhigh`  | 高难度专业与工程任务   |
| `max`    | 需要最大推理深度的工作流 |

<Warning>
  GPT-6 Astra 不支持 `none` 或 `minimal`，也不支持 `temperature`、`top_p` 和 `top_logprobs`。使用 Chat Completions 时也不要传入 `logprobs`。
</Warning>

## 接口说明

* 工具调用请使用 Responses API。
* 显式配置提示词缓存时，请使用 `prompt_cache_options.ttl`，不要使用旧的 `prompt_cache_retention` 字段。
* 如需无状态传递加密推理项，请同时使用 `include: ["reasoning.encrypted_content"]` 和 `store: false`。
* 使用 `max_tool_calls` 限制内置工具调用总数，使用 `parallel_tool_calls` 控制并行 Function 调用。
* 公开图片 URL 必须允许服务端下载；如果远端主机阻止自动访问，可改用 Data URL。
* 支持图片输入，不支持音频和视频输入。

<Warning>
  AnyFast 当前不提供 Responses 查询、Conversations 或 Vector Stores 管理端点。请勿依赖 `background`、`conversation`、`previous_response_id`、已保存提示词引用或 `configuration_update`。跨请求引用输出项时，也可能因请求被路由到不同上游资源而失败。
</Warning>

## 核心参数

| 参数                        | 类型              | 必填 | 说明                                    |
| ------------------------- | --------------- | -- | ------------------------------------- |
| `model`                   | string          | 是  | 固定为 `gpt-6-astra`                     |
| `input`                   | string / array  | 是  | 文本、图片、文件或工具结果输入                       |
| `instructions`            | string          | 否  | 当前响应的系统级指令                            |
| `reasoning.effort`        | string          | 否  | `low`、`medium`、`high`、`xhigh` 或 `max` |
| `reasoning.summary`       | string          | 否  | `auto`、`concise` 或 `detailed`         |
| `reasoning.context`       | string          | 否  | `auto`、`current_turn` 或 `all_turns`   |
| `reasoning.mode`          | string          | 否  | 使用 `standard`；当前 AnyFast 路由未开放 Pro 模式 |
| `max_output_tokens`       | integer         | 否  | 最大生成 Token 数，上限 128,000               |
| `max_tool_calls`          | integer         | 否  | 当前响应可处理的内置工具调用总数上限                    |
| `text.format`             | object          | 否  | 文本或结构化输出配置                            |
| `text.verbosity`          | string          | 否  | `low`、`medium` 或 `high`               |
| `tools`                   | array           | 否  | Function 或 Responses API 工具定义         |
| `tool_choice`             | string / object | 否  | 控制是否调用工具以及调用哪个工具                      |
| `parallel_tool_calls`     | boolean         | 否  | 是否允许模型在一个轮次中发起多个工具调用                  |
| `include`                 | array           | 否  | 请求返回受支持的附加响应数据                        |
| `prompt_cache_key`        | string          | 否  | 改善相关请求的缓存匹配                           |
| `prompt_cache_options`    | object          | 否  | 配置隐式或显式提示词缓存；`ttl` 当前仅支持 `30m`        |
| `prompt_cache_breakpoint` | object          | 否  | 在内容块中标记显式可复用提示词前缀边界                   |
| `stream`                  | boolean         | 否  | 通过 SSE 流式返回响应事件                       |
| `stream_options`          | object          | 否  | 控制事件混淆等流式行为                           |
| `store`                   | boolean         | 否  | 控制上游是否保存响应；AnyFast 不提供响应查询端点          |
| `metadata`                | object          | 否  | 应用定义的字符串键值元数据                         |
| `truncation`              | string          | 否  | 当前 AnyFast 路由使用 `disabled`            |

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

## 官方参考

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

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