# エージェント (/ja/api-reference/endpoint/agent)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1454 · updated: 2026-07-30 -->

> Firecrawl API キーが必要な AI エージェントの方は、自動オンボーディング手順について [firecrawl.dev/agent-onboarding/SKILL.md](https://www.firecrawl.dev/agent-onboarding/SKILL.md) を参照してください。

`POST /agent`

エージェントによるデータ抽出タスクを開始する

## OpenAPI

```json
{
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "auditMetadata": {
              "additionalProperties": false,
              "description": "組織でSIEM Loggingが有効になっている場合、SIEMロギングイベントに含まれるユーザーの属性情報。",
              "properties": {
                "username": {
                  "description": "リクエストに関連付けられたユーザー名。",
                  "maxLength": 1024,
                  "type": "string"
                }
              },
              "required": [
                "username"
              ],
              "type": "object"
            },
            "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 スキーマ",
              "type": "object"
            },
            "strictConstrainToURLs": {
              "description": "true の場合、エージェントは urls 配列で指定された URL にのみアクセスします",
              "type": "boolean"
            },
            "threatProtection": {
              "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"
            },
            "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": "リクエストが多すぎます"
    }
  }
}
```
