<!--
Sitemap:
- [Newton Agent NeoBank](/index)
- [Getting Started](/getting-started)
- [Onboard an Agent](/guides/onboard-an-agent)
- [Give an Agent a Budget](/guides/agent-budget)
- [Pay for an API](/guides/pay-for-an-api)
- [Issue a Card](/guides/issue-a-card)
- [Meter Your API](/guides/meter-your-api)
- [SDK Essentials](/reference/sdk)
- [ModularVault](/reference/sdk/modular-vault)
- [PlatformClient](/reference/sdk/platform-client)
- [FacilitatorClient](/reference/sdk/facilitator-client)
- [createX402Fetch](/reference/sdk/create-x402-fetch)
- [buildPolicyParams](/reference/sdk/build-policy-params)
- [Networks & Addresses](/reference/networks)
-->

# Meter Your API

Charge AI agents per call — no API keys to hand out, no invoicing. Your endpoint asks for payment, the agent pays, and you get settled.

## How it works

1. An agent calls your endpoint.
2. Your endpoint returns `402 Payment Required` with a price.
3. The agent pays — its SDK handles it — and the facilitator verifies and settles the payment.
4. Your endpoint returns the data.

## Register your API

Register your endpoint as a resource server. That hands back an API key the facilitator uses to verify and settle incoming payments — store it, it's shown once.

```typescript
import { FacilitatorClient } from "@newton-xyz/isaac";

const facilitator = new FacilitatorClient({
  baseUrl: process.env.PLATFORM_API_URL!,
  operatorApiKey: process.env.OPERATOR_API_KEY!,
});

const { server, apiKey } = await facilitator.createServer({
  name: "Weather API",
  recipientAddress: "0xYourPayoutAddress", // where settled payments land
  vaultAddress: "0xYourVault", // the custody vault backing settlement
});
```

Prefer clicking to code? Register the same server from the dashboard.

## Ask for payment

On a paid route, respond with `402` and the payment requirements — the price, the token, and where to pay. The agent's SDK reads them, pays, and retries the request. The header format is defined by the [x402 protocol](https://x402.org).

## Next

* **[Pay for an API](/guides/pay-for-an-api)** — the same exchange, seen from the agent's side.
