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

# 智能体

> 你是需要 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 /agent
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:
  /agent:
    post:
      tags:
        - Agent
      summary: 启动用于 Agent 驱动数据提取的任务
      operationId: startAgent
      requestBody:
        content:
          application/json:
            schema:
              properties:
                maxCredits:
                  description: 此代理任务可使用的最大额度。若未设置，默认值为 2500。高于 2,500 的值一律按付费请求计费。
                  type: number
                model:
                  default: spark-1-mini
                  description: >-
                    适用于智能体任务的模型。spark-1-mini（默认）成本更低，价格便宜约 60%；spark-1-pro
                    在处理复杂任务时能提供更高的准确率。
                  enum:
                    - spark-1-mini
                    - spark-1-pro
                  type: string
                prompt:
                  description: 用于描述应提取哪些数据的提示词
                  maxLength: 10000
                  type: string
                schema:
                  description: 用于定义提取数据结构的可选 JSON Schema
                  type: object
                strictConstrainToURLs:
                  description: 如果为 true，代理将仅访问 urls 数组中提供的 URL
                  type: boolean
                urls:
                  description: 用于限定智能体访问范围的可选 URL 列表
                  items:
                    format: uri
                    type: string
                  type: array
              required:
                - prompt
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  id:
                    format: uuid
                    type: string
                  success:
                    type: boolean
                type: object
          description: 代理任务已成功启动
        '402':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: Payment required to access this resource.
                    type: string
                type: object
          description: 需要付款
        '429':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: Rate limit exceeded.
                    type: string
                type: object
          description: 请求次数过多
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````