> ## Documentation Index
> Fetch the complete documentation index at: https://exa.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Nevermined

> Autonomous agent payments for Exa via Nevermined x402 card delegation. A 7 USD purchase provisions or tops up an Exa API key with 7 USD of credits.

Agents pay Exa with a credit card via [Nevermined](https://nevermined.ai)'s [x402 card-delegation](https://nevermined.ai/docs/specs/x402-card-delegation) scheme. Each **\$7 purchase** returns an Exa API key with **\$7 of Exa credits**.

<Info>
  Use this Nevermined plan ID:<br />`27800462147494506865542649899724877617306579171265399959488097895839186996870`<br />The purchase is for API credits, not for a single search request.
</Info>

For a first-time Nevermined payer, `POST /team-management/nevermined/purchase-key` provisions a new Exa API key and adds \$7 of credits. If the key runs out, mint a fresh x402 token with the same Nevermined wallet/card details and call the same endpoint again. Exa returns the same API key with another \$7 of credits added.

## Buy a key

```bash theme={null}
POST https://admin-api.exa.ai/team-management/nevermined/purchase-key
payment-signature: <x402-token>
```

* **Cost:** \$7 per purchase, charged to the card delegated to the x402 token.
* **Response (new payer):** `{ status: "ok", apiKey: "…", expiresAt: null }` — a new Exa API key with \$7 of credits.
* **Response (returning payer):** `{ status: "ok", apiKey: "…", expiresAt: null }` — the same Exa API key with \$7 more credits.
* **Response (replayed token):** cached result, no new charge.
* **Missing/invalid signature:** `402 Payment Required` with payment requirements in the body.

## What \$7 buys

Credits are consumed at standard Exa API pricing. At current rates, \$7 of credits covers roughly:

| Endpoint or feature                                      |                              Price |   Approximate usage |
| -------------------------------------------------------- | ---------------------------------: | ------------------: |
| Search (`instant`, `fast`, `auto`) with up to 10 results |               \$7 / 1,000 requests |      1,000 requests |
| Deep-Lite Search                                         |              \$10 / 1,000 requests |        700 requests |
| Deep Search                                              |              \$12 / 1,000 requests |      \~583 requests |
| Deep-Reasoning Search                                    |              \$15 / 1,000 requests |      \~466 requests |
| Contents (`text`, `highlights`, or `summary`)            | \$1 / 1,000 pages per content type |         7,000 pages |
| AI page summaries on Search or Contents                  |                  \$1 / 1,000 pages |     7,000 summaries |
| Additional results beyond the first 10                   |                \$1 / 1,000 results | 7,000 extra results |
| Answer                                                   |               \$5 / 1,000 requests |      1,400 requests |
| Monitors                                                 |              \$15 / 1,000 requests |      \~466 requests |

Search requests include text and highlights for up to 10 results. Extra results beyond 10 and AI summaries are billed separately.<br />
For full pricing details, see [Exa pricing](https://exa.ai/pricing).

## Sample request

Mint an x402 token with the Nevermined SDK using the Exa purchase plan ID, then POST it to Exa. The Nevermined API key and card enrollment come from Nevermined — see [NVM Pay docs](https://nevermined.ai/docs/products/nvm-pay/overview) for SDK setup and [card enrollment](https://nevermined.ai/docs/specs/x402-card-delegation).

```typescript theme={null}
import { Payments } from "@nevermined-io/payments";

const EXA_PLAN_ID = "27800462147494506865542649899724877617306579171265399959488097895839186996870"

const payments = Payments.getInstance({
  nvmApiKey: process.env.NVM_API_KEY!,  // your Nevermined API key
  environment: "live",
});

// 1. Mint x402 token scoped to an enrolled card
const { accessToken } = await payments.x402.getX402AccessToken(
  EXA_PLAN_ID,
  undefined,
  {
    scheme: "nvm:card-delegation",
    delegationConfig: {
      providerPaymentMethodId: "pm_...",  // Stripe/Credit Card payment method, enrolled in Nevermined
      spendingLimitCents: 700,            // >= $7 purchase
      durationSecs: 3600,
    },
  },
);

// 2. Exchange the token for (or top up) an Exa API key
const res = await fetch(
  "https://admin-api.exa.ai/team-management/nevermined/purchase-key",
  { method: "POST", headers: { "payment-signature": accessToken } },
);
const { apiKey } = await res.json();

// 3. Use the key like any Exa API key
await fetch("https://api.exa.ai/search", {
  method: "POST",
  headers: { "x-api-key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({ query: "..." }),
});
```

### Parameters you get from Nevermined

| Parameter                 | Where to get it                                                                                                                     |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `planId`                  | Use<br />`27800462147494506865542649899724877617306579171265399959488097895839186996870`<br />for Exa API key purchases and top-ups |
| `nvmApiKey`               | [Nevermined dashboard](https://nevermined.app) → API Keys                                                                           |
| `providerPaymentMethodId` | Enroll a card via Nevermined, copy the `pm_…` id                                                                                    |

## When the key runs out

Exa returns **`HTTP 402`** on the regular API endpoints once the API key's credits are exhausted:

```json theme={null}
{
  "requestId": "...",
  "error": "You have exceeded your credits limit. Please top up to keep using Exa at dashboard.exa.ai",
  "tag": "NO_MORE_CREDITS"
}
```

Mint a fresh x402 token with the same plan ID and Nevermined wallet/card details, then POST it again to the same `/purchase-key` endpoint. Exa adds another \$7 of credits to the same API key.

## References

* [Nevermined NVM Pay](https://nevermined.ai/docs/products/nvm-pay/overview)
* [x402 card-delegation spec](https://nevermined.ai/docs/specs/x402-card-delegation)
* [Exa pricing](https://exa.ai/pricing)
* [Exa Search API](/api-reference/search)
