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

# 提问

> 使用 AI 支持代理诊断 Firecrawl 任务、账户和 API 使用问题。

`/support/ask` 端点是一个 AI 支持代理，可帮助诊断 Firecrawl 任务、账户和 API 使用方式中的问题。提交问题后，你将收到经过验证的答案，以及可直接采取行动的修复参数——通常会在 15–30 秒内返回。

<div id="designed-for-ai-agents">
  ## 为 AI 代理而设计
</div>

`/support/ask` 专为 **代理间** 通信而构建。如果你正在构建使用 Firecrawl 的 AI 代理，请将此端点接入错误处理流程，让代理能够在无需人工干预的情况下，自行诊断抓取失败、爬取问题和配置问题。

传入 `rationale` 字段，为支持代理提供有关终端用户想要实现目标的上下文。这有助于优先收集相关证据。

<div id="how-it-works">
  ## 工作原理
</div>

1. **你描述问题** — 用自然语言说明你遇到的问题。
2. **代理进行调查** — 它会检查任务日志、账户状态、文档和源代码。
3. **代理进行验证** — 在可能的情况下，代理会针对实时 Firecrawl API 测试修复方案 (例如使用调整后的参数重试抓取) 。
4. **你获得经过验证的答案** — 响应中包含文字说明形式的 `answer`、可直接应用的机器可读 `fixParameters`，以及表明该修复是否经过测试的 `validation` 结果。

<div id="authentication">
  ## 身份验证
</div>

使用你的 Firecrawl API 密钥作为 Bearer Token。请求会自动限定在你的团队范围内——你只能查询自己的任务和账户数据。

```bash theme={null}
curl -X POST https://api.firecrawl.dev/v2/support/ask \
  -H "Authorization: Bearer fc-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "my crawl returned 3 pages but I expected 50",
    "rationale": "user is on their third failed crawl attempt today"
  }'
```

<div id="response-fields">
  ## 响应字段
</div>

| 字段              | 类型      | 描述                      |                                                                 |
| --------------- | ------- | ----------------------- | --------------------------------------------------------------- |
| `answer`        | string  | 用 2-4 句话说明问题诊断和修复方法     |                                                                 |
| `confidence`    | string  | `high`、`medium` 或 `low` |                                                                 |
| `fixParameters` | object  | null                    | 用于应用修复的 API 参数 (例如 `{"waitFor": 5000}`)                         |
| `validation`    | object  | null                    | 修复是否已测试：`tested`、`result` (success/failure/skipped) 、`evidence` |
| `feedback`      | object  | null                    | 当代理陷入卡住状态时提供；`{ blockedBy, attempted }`。成功时为 `null`。            |
| `durationMs`    | integer | 总执行时间 (以毫秒为单位)          |                                                                 |

<div id="status-codes">
  ## 状态码
</div>

| Code  | 含义                         |
| ----- | -------------------------- |
| `200` | 已答复或卡住 (始终返回 envelope)     |
| `400` | JSON 无效或不符合 schema         |
| `401` | 缺少或无效的 bearer token        |
| `504` | 达到 60 秒硬性时限——返回部分 envelope |

如需查看包含集成示例的功能指南，请参见 [提问 功能文档](/zh/features/ask)。

> 你是需要 Firecrawl API 密钥的 AI 代理吗？请参见 [firecrawl.dev/agent-onboarding/SKILL.md](https://www.firecrawl.dev/agent-onboarding/SKILL.md) 了解自动化接入说明。


## OpenAPI

````yaml zh/api-reference/v2-openapi.json POST /support/ask
openapi: 3.0.0
info:
  contact:
    email: support@firecrawl.dev
    name: Firecrawl Support
    url: https://firecrawl.dev/support
  description: 用于与 Firecrawl 服务交互，执行网页抓取和爬取任务的 API。
  title: Firecrawl API
  version: v2
servers:
  - url: https://api.firecrawl.dev/v2
security:
  - bearerAuth: []
paths:
  /support/ask:
    post:
      tags:
        - Support
      summary: 向 Firecrawl 支持代理提问
      description: 使用 AI 支持代理诊断 Firecrawl 任务、账户和 API 使用问题。
      operationId: askSupportAgent
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SupportAskRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupportAskResponse'
          description: 支持代理答案
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupportProxyErrorResponse'
          description: 请求无效
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupportProxyErrorResponse'
          description: Bearer token 缺失或无效
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupportProxyErrorResponse'
          description: 支持代理不可用
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupportProxyErrorResponse'
          description: 支持代理超时
      security:
        - bearerAuth: []
components:
  schemas:
    SupportAskRequest:
      additionalProperties: true
      properties:
        question:
          description: 供支持代理诊断的问题或故障。
          type: string
        rationale:
          description: 关于最终用户想要实现目标的可选上下文信息。
          type: string
      required:
        - question
      type: object
    SupportAskResponse:
      properties:
        answer:
          description: 诊断结果和建议的修复方案。
          type: string
        confidence:
          enum:
            - high
            - medium
            - low
          type: string
        durationMs:
          description: 支持代理的总执行时间（毫秒）。
          type: integer
        feedback:
          additionalProperties: true
          description: 在支持代理受阻或需要更多信息时出现。
          nullable: true
          type: object
        fixParameters:
          additionalProperties: true
          description: 可能可用于修复问题的机器可读 API 参数。
          nullable: true
          type: object
        validation:
          additionalProperties: true
          description: 支持代理测试或尝试修复时的验证结果。
          nullable: true
          type: object
      type: object
    SupportProxyErrorResponse:
      properties:
        error:
          description: 支持代理或上游返回的错误代码。
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````