> ## Documentation Index
> Fetch the complete documentation index at: https://firecrawl-capy-docs-factual-copy-fixes.mintlify.site/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 ja/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のサービスを利用して、Webスクレイピングやクロールを行うためのAPIです。
  title: Firecrawl API
  version: v2
servers:
  - url: https://api.firecrawl.dev/v2
security:
  - bearerAuth: []
paths:
  /agent:
    post:
      tags:
        - Agent
      summary: エージェントによるデータ抽出タスクを開始する
      operationId: startAgent
      requestBody:
        content:
          application/json:
            schema:
              properties:
                auditMetadata:
                  $ref: '#/components/schemas/AuditMetadata'
                effort:
                  description: >-
                    エージェントタスクの推論予算。すべての実行は spark-2 で実行されるため、モデルの指定有無にかかわらず
                    effort を送信できます。
                  enum:
                    - low
                    - medium
                    - high
                  type: string
                exchange:
                  additionalProperties: false
                  description: >-
                    実行中に Agent が Team の
                    [Alexandria](https://docs.firecrawl.dev/features/alexandria)
                    データプロバイダーを呼び出せるようにします。このオブジェクトを指定しない場合、ウェブのみを使用して実行します（追加ターンでは前のターンの設定を引き継ぎます）。[接続済みの
                    Alexandria
                    ツールを使用する](https://docs.firecrawl.dev/features/agent#use-your-connected-alexandria-tools)を参照してください。
                  properties:
                    approve:
                      additionalProperties: false
                      description: >-
                        このスレッドの前のターンの終了時に返された `pendingApproval`
                        を承認します。`threadId` が必要です。
                      properties:
                        always:
                          default: false
                          description: このスレッドの残りのターンでは承認を求めないようにします。`terms` の承認では無視されます。
                          type: boolean
                        approvalId:
                          description: 承認または拒否する対象の `pendingApproval.id`。
                          format: uuid
                          type: string
                        callIds:
                          description: >-
                            承認対象の呼び出しのうち、指定した呼び出しのみを実行します。既定ではすべてを実行します。`terms`
                            の承認では無視されます。
                          items:
                            type: string
                          type: array
                      required:
                        - approvalId
                      type: object
                    decline:
                      additionalProperties: false
                      description: >-
                        このスレッドの前のターンの終了時に返された `pendingApproval`
                        を拒否します。`threadId` が必要です。`terms`
                        の提示を拒否すると、対象のプロバイダーはスレッドの残りのターンで使用されません。
                      properties:
                        approvalId:
                          description: 承認または拒否する対象の `pendingApproval.id`。
                          format: uuid
                          type: string
                      required:
                        - approvalId
                      type: object
                    enabled:
                      default: true
                      description: >-
                        Agent が Alexandria プロバイダーを呼び出せるようにします。`exchange`
                        を送信した場合の既定値は `true`
                        です。スレッドの特定のターンでプロバイダーを無効にするには、`false` を送信します。
                      type: boolean
                    maxCalls:
                      default: 16
                      description: このターンで Agent が行えるプロバイダー呼び出しの最大回数。
                      maximum: 30
                      minimum: 1
                      type: integer
                    onTermsRequired:
                      default: skip
                      description: >-
                        Agent が使用しようとするプロバイダーで、Team
                        がまだ同意していないデータ利用規約への同意が必要な場合の動作。そのようなプロバイダーは呼び出されません。`skip`
                        は規約に同意済みのプロバイダーを使用して回答し、それ以外のプロバイダーを
                        `exchange.skippedProviders` に一覧表示します。`ask` はさらに、種類が
                        `terms` の `pendingApproval` と `exchange.requiresAction`
                        を返してターンを終了します。追加ターンで省略すると、前のターンの値が維持されます。[規約への同意が必要なデータプロバイダー](https://docs.firecrawl.dev/features/agent#data-providers-that-need-terms)を参照してください。
                      enum:
                        - skip
                        - ask
                      type: string
                    requireApproval:
                      default: false
                      description: >-
                        有料のプロバイダー呼び出しを行う前に、種類が `calls` の `pendingApproval`
                        を返してターンを終了し、次のターンで承認または拒否できるようにします。追加リクエストでも、同じリクエストで
                        `mode: "chat"` を指定する必要があります。
                      type: boolean
                    toolkits:
                      description: >-
                        使用するプロバイダーをスラッグで最大 5 つ指定します。例：`["apollo"]`。Agent
                        は指定されたプロバイダーのみを使用します。空または省略した場合、Team
                        が使用できるすべてのプロバイダーが対象になります。
                      items:
                        type: string
                      maxItems: 5
                      type: array
                  type: object
                maxCredits:
                  description: >-
                    このエージェントタスクで使用するクレジットの最大値です。未設定の場合、デフォルトは2500です。2,500を超える値は、常に有料リクエストとして課金されます。
                  type: number
                mode:
                  default: extract
                  description: >-
                    `extract` は、各ターンで構造化された結果全体を `data` に返します。`chat`
                    では、新しいデータを求めない追加リクエストに対して、再実行せずに `message`
                    に短い回答を返せます。`exchange.requireApproval` を使用するには、同じリクエストで
                    `chat` を指定する必要があります。追加ターンで省略すると、スレッドのモードが維持されます。
                  enum:
                    - extract
                    - chat
                  type: string
                model:
                  default: spark-2
                  description: >-
                    エージェントタスクで使用するモデルを指定します。spark-2
                    はデフォルトで、すべての実行で使用されるモデルです。Spark 1
                    のモデル名は後方互換性のため引き続き使用できますが、非推奨であり、spark-2 にルーティングされます。
                  enum:
                    - spark-2
                    - spark-1-mini
                    - spark-1-pro
                  type: string
                prompt:
                  description: 抽出するデータ内容を指定するプロンプト
                  maxLength: 10000
                  type: string
                schema:
                  description: 抽出データを構造化するためのオプションの JSON スキーマ
                  type: object
                strictConstrainToURLs:
                  description: true の場合、エージェントは urls 配列で指定された URL にのみアクセスします
                  type: boolean
                threadId:
                  description: >-
                    既存のスレッドを続行するには、以前の実行で返された `threadId`
                    を渡します。このリクエストは、そのスレッドの次のターンとして実行されます。省略した
                    `urls`、`schema`、`effort`、`mode`、`exchange`
                    の設定は、前のターンから引き継がれます。新しいスレッドを開始するには、`threadId` を省略します。
                  format: uuid
                  type: string
                threatProtection:
                  $ref: '#/components/schemas/ThreatProtectionOverride'
                urls:
                  description: エージェントのアクセス先を制限するための任意のURLリスト
                  items:
                    format: uri
                    type: string
                  type: array
                webhook:
                  description: >-
                    webhook
                    仕様オブジェクト。エージェントのライフサイクルイベント（agent.started、agent.action、agent.completed、agent.failed、agent.cancelled）を購読します。
                  properties:
                    events:
                      default:
                        - started
                        - action
                        - completed
                        - failed
                        - cancelled
                      description: webhook URL に送信するイベント。デフォルトではすべてのイベントです。
                      items:
                        enum:
                          - started
                          - action
                          - completed
                          - failed
                          - cancelled
                        type: string
                      type: array
                    headers:
                      additionalProperties:
                        type: string
                      description: webhook URL に送信するヘッダー。
                      type: object
                    metadata:
                      additionalProperties:
                        type: string
                      description: このエージェントジョブのすべての webhook ペイロードに含まれるカスタムメタデータ。
                      type: object
                    url:
                      description: webhook イベントの送信先 URL。
                      format: uri
                      type: string
                  required:
                    - url
                  type: object
              required:
                - prompt
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  id:
                    format: uuid
                    type: string
                  success:
                    type: boolean
                  threadId:
                    description: この実行が属するスレッド。スレッドを続行するには、これを `threadId` として渡します。
                    format: uuid
                    type: string
                  threadTurn:
                    description: スレッド内でのこの実行のターン番号。1 から始まります。
                    type: integer
                type: object
          description: エージェントタスクが正常に開始されました
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: 'Invalid JSON schema: ...'
                    type: string
                type: object
          description: 不正なリクエスト — リクエストボディの検証に失敗しました（たとえば、無効な JSON schema）。
        '402':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: Payment required to access this resource.
                    type: string
                type: object
          description: お支払いが必要です
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: >-
                      This URL (https://example.com) is blocked by your
                      organization's threat protection policy (rule: blocklist).
                      If you believe this is a mistake, contact your
                      organization administrator to adjust the policy (e.g.
                      whitelist the domain).
                    type: string
                type: object
          description: 禁止 — 指定された URL はチームの脅威保護ポリシーによりブロックされています。
        '429':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: Rate limit exceeded.
                    type: string
                type: object
          description: リクエストが多すぎます
        '500':
          content:
            application/json:
              schema:
                properties:
                  error:
                    example: Failed to passthrough agent request.
                    type: string
                type: object
          description: 内部サーバーエラー — エージェントサービスに接続できませんでした。
      security:
        - bearerAuth: []
components:
  schemas:
    AuditMetadata:
      additionalProperties: false
      description: 組織でSIEM Loggingが有効になっている場合、SIEMロギングイベントに含まれるユーザーの属性情報。
      properties:
        username:
          description: リクエストに関連付けられたユーザー名。
          maxLength: 1024
          type: string
      required:
        - username
      type: object
    ThreatProtectionOverride:
      description: >-
        このリクエスト単位の [脅威保護](https://docs.firecrawl.dev/features/threat-protection)
        オーバーライドです。指定したフィールドは、このリクエストに限り、組織のポリシー内の対応するフィールドを置き換えます。省略したフィールドには組織レベルの値がそのまま適用されます。利用するには、チームで脅威保護が有効になっている必要があります（エンタープライズ機能）。有効でない場合、リクエストは
        403 で拒否されます。組織でリクエストごとのオーバーライドが無効になっている場合、このオブジェクトを含むリクエストはすべて 403
        で拒否されます。チームに対して脅威保護が強制適用されている場合、`mode` に `off` は設定できません。
      properties:
        blacklist:
          description: >-
            常にブロックするドメインです。通常のドメイン（`example.com`）またはワイルドカードグロブ（`*.example.com`）で指定します。プロトコル、パス、ポートは含めないでください。
          items:
            type: string
          maxItems: 1000
          type: array
        blockedTlds:
          description: '無条件でブロックするトップレベルドメインです。先頭のドットを付けない小文字で指定します（例: `zip`）。'
          items:
            type: string
          maxItems: 1000
          type: array
        failurePolicy:
          description: 分類器に到達できない場合の動作です。`closed` はリクエストをブロックし、`open` は許可します。
          enum:
            - open
            - closed
          type: string
        mode:
          description: >-
            このリクエストの URL スキャンモード。`normal` は URL を Google Web Risk
            でチェックします（スキャンした URL 1 件あたり +2 クレジット）。
          enum:
            - 'off'
            - normal
          type: string
        riskScoreThreshold:
          description: 分類器の判定で URL をブロックする正規化リスクスコアのしきい値（0〜100）。値を低くするほど厳格になります。
          example: 75
          maximum: 100
          minimum: 0
          type: integer
        whitelist:
          description: 常に許可するドメインです。通常のドメインまたはワイルドカードグロブで指定します。ほかのすべてのルールより優先されます。
          items:
            type: string
          maxItems: 1000
          type: array
      title: Threat Protection Override
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.