Agent 与集成(2/6)

When a run uses Alexandria data providers, it only calls the ones whose data terms your team has accepted. A provider whose terms you haven't accepted is never called, whatever exchange.onTermsRequired is set to. The run carries on with the providers it can use, and the status response reports what it skipped.

There is no auto-accept mode. Accepting a provider's terms always needs a person to agree to them, either in the dashboard or through a terms/accept call your application makes after its user has explicitly agreed. If you build an agent on top of Firecrawl, it must ask its user before calling terms/accept. A request for data isn't consent to a provider's terms.

onTermsRequired What happens
skip (default) The run answers with accepted providers only and never blocks. exchange.skippedProviders lists the gated providers that would have helped.
ask The same as skip. The run also ends with exchange.requiresAction and a pendingApproval of kind: "terms", so you can ask your user, accept, and continue the thread.

If you leave onTermsRequired out on a follow-up turn of a thread, the turn uses the previous turn's value. If a turn ends on a paid-call approval (requireApproval), it has no terms offer.

Response fields

These fields are on the exchange object of GET /v2/agent/{id}:

  • skippedProviders (any mode): one entry per gated provider that would have helped, with provider, name, capability, adds (what it would have added), reason: "terms_required", version (the terms version) and termsUrl (where to accept in the dashboard).
  • requiresAction (ask only): type: "accept_terms", an approvalId and a providers list. approvalId is always present. It's the id of the terms pending approval you answer when you continue the thread. Each provider carries the exact show (terms/show) and accept (terms/accept) calls to make. Each provider's digest (and accept.options.digest) is always present and can be null, meaning the catalog didn't publish one. In that case, run terms/show first and send the digest it returns.
{
  "status": "completed",
  "exchange": {
    "enabled": true,
    "onTermsRequired": "ask",
    "paidCalls": 0,
    "creditsUsed": null,
    "skippedProviders": [
      {
        "provider": "apollo",
        "name": "Apollo",
        "capability": "people/search",
        "adds": "verified work emails and direct phone numbers",
        "reason": "terms_required",
        "version": "F-1.0.0",
        "termsUrl": "https://www.firecrawl.dev/app/alexandria/apollo"
      }
    ],
    "requiresAction": {
      "type": "accept_terms",
      "approvalId": "0199aaaa-0000-7000-8000-000000000000",
      "providers": [
        {
          "provider": "apollo",
          "name": "Apollo",
          "capability": "people/search",
          "version": "F-1.0.0",
          "digest": "<sha256>",
          "url": "https://www.firecrawl.dev/app/alexandria/apollo",
          "show": { "provider": "firecrawl", "capability": "terms/show", "options": { "provider": "apollo" } },
          "accept": {
            "provider": "firecrawl",
            "capability": "terms/accept",
            "options": { "provider": "apollo", "version": "F-1.0.0", "digest": "<sha256>", "confirmed": true }
          }
        }
      ]
    }
  },
  "pendingApproval": {
    "id": "0199aaaa-0000-7000-8000-000000000000",
    "kind": "terms",
    "reason": "Apollo could add verified work emails and direct phone numbers.",
    "calls": [],
    "terms": [{ "provider": "apollo", "name": "Apollo", "version": "F-1.0.0", "digest": "<sha256>", "url": "https://www.firecrawl.dev/app/alexandria/apollo" }],
    "resolution": null
  }
}

Accept, then continue

In ask mode:

  1. Show your user the terms. Run the provider's show call through /v2/scrape with alexandria.
  2. Only if the user explicitly agrees, run its accept call the same way. If accept.options.digest is null, use the digest terms/show returned:
curl -X POST https://api.firecrawl.dev/v2/scrape \
  -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "alexandria": {
      "provider": "firecrawl",
      "capability": "terms/accept",
      "options": { "provider": "apollo", "version": "F-1.0.0", "digest": "<sha256>", "confirmed": true }
    }
  }'
  1. Continue the same thread with exchange.approve. The offer is accepted as a whole, and callIds and always are ignored on it. The next turn uses those providers to fill the gap the previous answer named, rather than re-running everything.
curl -X POST https://api.firecrawl.dev/v2/agent \
  -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "threadId": "<threadId from the previous run>",
    "prompt": "Continue with Apollo.",
    "exchange": {
      "approve": { "approvalId": "0199aaaa-0000-7000-8000-000000000000" }
    }
  }'

To go on without the provider, continue with exchange.decline: { "approvalId": "..." } instead. This declines the whole offer, and its providers aren't offered again for the rest of the thread.

In skip mode there's no pending approval to answer. After the terms are accepted, start a new run (or a new turn of the thread) and the provider is available.

Parameters

Parameter Type Required Description
prompt string Yes Natural language description of the data you want to extract (max 10,000 characters)
model string No Defaults to spark-2, the model every run executes on. Spark 1 models are deprecated and route to spark-2
effort string No Reasoning budget: low, medium, or high. Every run executes on spark-2, so effort can be sent with or without model
urls array No Optional list of URLs to focus the extraction
schema object No Optional JSON schema for structured output
strictConstrainToURLs boolean No If true, the agent only visits the URLs provided in the urls array
webhook object No Webhook to receive agent lifecycle events (agent.started, agent.action, agent.completed, agent.failed, agent.cancelled). See the webhook payloads
maxCredits number No Maximum number of credits to spend on this agent task. Defaults to 2,500 if not set. The dashboard supports values up to 2,500; for higher limits, set maxCredits via the API (values above 2,500 are always treated as paid requests). If the limit is reached, the job fails with stopReason: "credit_limit_reached" and no data is returned. The response may include a best-effort partial; see Handling credit-limit stops. Failed runs are not billed: credits used for AI reasoning are never charged on failure, any credits used for tool calls during the run (scraping, search, mapping, etc.) are refunded, and the response reports creditsUsed: 0.
threadId string No Continue an existing thread: the threadId an earlier run returned. Left-out urls, schema, effort, mode and exchange settings carry over from the previous turn
mode string No extract (default) returns the full structured result in data every turn. chat lets a follow-up that asks for no new data get a short reply in message. Required for exchange.requireApproval
exchange object No Lets the agent call your team's Alexandria data providers. Without it the run uses the web only. See Use your connected Alexandria tools
exchange.enabled boolean No Lets the agent call providers. Defaults to true once exchange is sent
exchange.toolkits array No Up to 5 provider slugs to pin. Empty or left out means every provider your team can use
exchange.maxCalls integer No The most provider calls per turn, from 1 to 30. Defaults to 16
exchange.requireApproval boolean No Ends the turn with a pendingApproval before any paid provider call. Needs mode: "chat". Defaults to false
exchange.approve object No { approvalId, callIds?, always? }: approves the previous turn's pendingApproval. Needs threadId. See Approve paid calls before they run
exchange.decline object No { approvalId }: declines the previous turn's pendingApproval. Needs threadId
exchange.onTermsRequired string No What to do when an Alexandria data provider the agent would use needs terms your team has not accepted: skip (default) or ask. See Data providers that need terms

Agent vs Extract: What's Improved

Feature Agent (New) Extract
URLs Required No Yes
Speed Faster Standard
Cost Lower Standard
Reliability Higher Standard
Query Flexibility High Moderate

Example Use Cases

  • Research: "Find the top 5 AI startups and their funding amounts"
  • Competitive Analysis: "Compare pricing plans between Slack and Microsoft Teams"
  • Data Gathering: "Extract contact information from company websites"
  • Content Summarization: "Summarize the latest blog posts about web scraping"

CSV Upload in Agent Playground

The Agent Playground supports CSV upload for batch processing. Your CSV can contain one or more columns of input data. For example, a single column of company names, or multiple columns such as company name, product, and website URL. Each row represents one item for the agent to process.

Upload your CSV, then add output columns using the "+" button in the grid header. Each column has its own prompt — click a column header to describe what the agent should find for that field (e.g., "CEO or founder name", "Total funding raised"). Hit Run, and the agent processes each row in parallel, filling in the results.

Troubleshooting with Ask

If your agent jobs fail or return unexpected results, use the Ask API for agentic debugging. Describe the issue and get back a verified answer with fix parameters you can apply directly:

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 agent returned incomplete results"
  }'

See the Ask documentation for full details and integration examples.

API Reference

Check out the Agent API Reference for more details.

Have feedback or need help? Email help@firecrawl.com.

Pricing

Firecrawl Agent uses dynamic billing that scales with the complexity of your data extraction request. You pay based on the actual work Agent performs, ensuring fair pricing whether you're extracting simple data points or complex structured information from multiple sources.

How Agent pricing works

Agent pricing is dynamic and credit-based:

  • Simple extractions (like contact info from a single page) typically use fewer credits and cost less
  • Complex research tasks (like competitive analysis across multiple domains) use more credits but reflect the total effort involved
  • Transparent usage shows you exactly how many credits each request consumed
  • Credit conversion automatically converts agent credit usage to credits for easy billing

Credit usage varies based on the complexity of your prompt, the amount of data processed, and the structure of the output requested. As a rough guide, most agent runs consume a few hundred credits, though simpler single-page tasks may use less and complex multi-domain research may use more.

Parallel Agents Pricing

If you are running multiple agents in parallel with Spark-2 Fast, pricing is a lot more predictable at 10 credits per cell.

Getting started

All users receive 5 free daily runs, which can be used from either the playground or the API, to explore Agent's capabilities without any cost.

Additional usage is billed based on credit consumption and converted to credits.

Managing costs

Agent can be expensive, but there are some ways to decrease the cost:

  • Start with free runs: Use your 5 daily free requests to understand pricing
  • Set a maxCredits parameter: Limit your spending by setting a maximum number of credits you're willing to spend. The dashboard caps this at 2,500 credits; to set a higher limit, use the maxCredits parameter directly via the API (note: values above 2,500 are always billed as paid requests)
  • Optimize prompts: More specific prompts often use fewer credits
  • Break large tasks into smaller runs: A single agent run returns roughly 150-200 rows of structured data. For large extraction jobs, split by category, region, or URL batch (3-5 URLs per run) and merge the results. This also keeps each run well under the maxCredits limit.
  • Monitor usage: Track your consumption through the dashboard
  • Set expectations: Complex multi-domain research will use more credits than simple single-page extractions

Try Agent now at firecrawl.dev/app/agent to see how credit usage scales with your specific use cases.

Are you an AI agent that needs a Firecrawl API key? See firecrawl.dev/agent-onboarding/SKILL.md for automated onboarding instructions.