> SpecStream is the live web data engine for teams and agents. This is the Markdown copy of https://specstream.ai/docs/integrations/taskfuel. Every page, with what SpecStream does and costs: https://specstream.ai/llms.txt

# TaskFuel

[TaskFuel (opens in a new tab)](https://taskfuel.ai/?utm_source=specstream) lets agents discover and call paid APIs through one prepaid USD balance, topped up by card, Bitcoin or stablecoins, so one agent pays for SpecStream and the 3,000+ other tools in [TaskFuel's catalog (opens in a new tab)](https://taskfuel.ai/catalog/?utm_source=specstream#cap-web-search) from the same balance. SpecStream's Search API and Extract API take payment per call over x402, so an agent pays for one search or one page read with no SpecStream account and no key, through TaskFuel or from its own wallet.

[SpecStream for TaskFuel, API & cloud platforms](https://specstream.ai/integrations/taskfuel.md)

## What you need

-   A TaskFuel account with a balance, and the `taskfuel` CLI or TaskFuel's MCP server connected to your agent. [TaskFuel's docs (opens in a new tab)](https://taskfuel.ai/docs/?utm_source=specstream) cover both.
-   No SpecStream account or key. Each call is paid when it's made.

1.  1

    ## 1. Connect TaskFuel

    In a shell, install TaskFuel's CLI and check which account it spends from. If `taskfuel whoami` shows no connection, run `taskfuel connect` and approve the code it prints in your browser:

    Terminal

    ```bash
    curl -fsSL https://taskfuel.ai/install.sh | sh
    taskfuel whoami
    ```

2.  2

    ## 2. Find SpecStream's endpoints

    TaskFuel's gateway calls only the domains in its catalog and refuses the rest. List what it offers on `api.specstream.ai`, then read the search endpoint's parameters:

    Terminal

    ```bash
    taskfuel discover api.specstream.ai
    taskfuel discover GET https://api.specstream.ai/v1/web-search
    ```

3.  3

    ## 3. Search

    Quote the search, then make the call with the quoted price as its ceiling. Send the question in `q`, in everyday words. The reply's `data.answer.value` holds a short answer when the pages give one, and `data.sources` lists each page with its `title`, `url` and `snippet`:

    Terminal

    ```bash
    taskfuel quote "https://api.specstream.ai/v1/web-search?q=which+networks+does+x402+support"
    taskfuel call "https://api.specstream.ai/v1/web-search?q=which+networks+does+x402+support" --max-amount 0.007 | jq '.data.answer.value, .data.sources[].url'
    ```

4.  4

    ## 4. Read the pages you need

    `POST /v1/extract` returns the main text of 1 to 20 pages or documents in one call, at $0.002 for each URL you send, so set `--max-amount` to $0.002 times the number of URLs. Each item of `data.results` has the page's `url`, a `status`, and its `text` when the status is `ok`:

    Terminal

    ```bash
    taskfuel call https://api.specstream.ai/v1/extract --method POST \
      --body '{"urls": ["https://docs.x402.org", "https://taskfuel.ai/docs/"], "format": "markdown"}' \
      --max-amount 0.004
    ```

## From your app or over MCP

A server sends SpecStream's URL, method and body to TaskFuel's `POST https://app.taskfuel.ai/v1/call` with its own TaskFuel key and a `maxAmountUsd` ceiling. SpecStream's response comes back as it was sent, and the `x-taskfuel-cost` header holds what the call cost:

server.js

```javascript
const res = await fetch("https://app.taskfuel.ai/v1/call", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TASKFUEL_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    url: "https://api.specstream.ai/v1/extract",
    method: "POST",
    body: { urls: ["https://docs.x402.org"], format: "markdown" },
    maxAmountUsd: 0.002,
  }),
});
const { data } = await res.json();
console.log(res.headers.get("x-taskfuel-cost"), data.results[0].text);
```

## Over MCP

An agent connected to TaskFuel's MCP server at `https://app.taskfuel.ai/mcp` uses its `discover` and `call` tools with the same URLs and bodies, and `max_amount_usd` as the ceiling.

## Pay with your own wallet

Any x402 v2 client pays SpecStream directly, with no TaskFuel balance in between:

-   Call `GET https://api.specstream.ai/v1/web-search?q=<the question>` or `POST https://api.specstream.ai/v1/extract` with `{"urls": ["<url>", ...]}`, with no key.
-   SpecStream answers `402 Payment Required` with a `PAYMENT-REQUIRED` header: the `exact` scheme at the call's fixed price in USDC on Base, Arbitrum or Polygon.
-   Your client signs it and sends the same request again with the payment in `PAYMENT-SIGNATURE`.
-   The answer comes back with a `PAYMENT-RESPONSE` header naming the transaction.

## Machine-readable terms

Both endpoints, with their x402 terms and an example request, are at [https://api.specstream.ai/.well-known/x402 (opens in a new tab)](https://api.specstream.ai/.well-known/x402). A whole list of records, every match on the live web in structured rows, is bought over x402 the same way, up to a maximum you sign for: [Agent payments](https://specstream.ai/docs/agent-payments.md) has the steps.

## Errors

-   `402` from TaskFuel: the TaskFuel balance is empty. Top it up at [app.taskfuel.ai (opens in a new tab)](https://app.taskfuel.ai).
-   A refusal above your ceiling: the price is higher than `--max-amount` or `maxAmountUsd`. Nothing is charged. Quote again and set the ceiling to the quoted price.
-   `429` with `Retry-After`: the payer sent more calls in a minute than SpecStream allows, or a payment didn't settle. Wait that many seconds and send it again.
-   A timeout in your own client: the call still runs and is paid. Fetch the response back with `taskfuel result` instead of calling again.

## Cost

A search of up to 10 results is $0.007, or $0.002 with `speed=fast`, `news=true` or `images=true`. A page read is $0.002 for each URL you ask for. The price is taken when the payment settles, before the call runs, so a search with no result or a page with no text is paid. TaskFuel bills each call at that price and charges its own fee when you add credit, as its [pricing page (opens in a new tab)](https://taskfuel.ai/pricing/?utm_source=specstream) shows. With a SpecStream API key instead, the same calls cost $5 per 1,000 searches and $0.80 per 1,000 pages. [Balance, quotes, and billing](https://specstream.ai/docs/billing.md) has the details.

## Remove

SpecStream holds no account or key for these calls, so there is nothing to remove on our side. To stop an agent paying through TaskFuel, revoke its key at [app.taskfuel.ai/keys (opens in a new tab)](https://app.taskfuel.ai/keys). Questions go to [support@specstream.ai](mailto:support@specstream.ai).

## More

[SpecStream for TaskFuel](https://specstream.ai/integrations/taskfuel.md) covers what it does in TaskFuel on one page. Every other tool has its guide in [Connect your tools](https://specstream.ai/docs/integrations.md). You see the most a request can cost before it starts, and the matches are paid from your balance. [Billing](https://specstream.ai/docs/billing.md) has the details. For help, email [support@specstream.ai](mailto:support@specstream.ai).
