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

# Stablecoin Payments

> Accept USDC, EURC, or any ERC-20 token on-chain with the lowest fees and full transparency.

Accept USDC, EURC, or any ERC-20 token directly on-chain. Stablecoin payments are Nevermined's native payment method, purpose-built for crypto users and autonomous agent-to-agent commerce.

## When to Use Stablecoins

<CardGroup cols={2}>
  <Card title="Agent-to-Agent Payments" icon="robot">
    Agents with wallets can purchase plans and pay per request autonomously, with no human in the loop.
  </Card>

  <Card title="Human-to-Agent Purchases" icon="user">
    Users buy plans through the Nevermined App checkout page, paying with tokens from their connected wallet.
  </Card>

  <Card title="Crypto-Native Users" icon="wallet">
    Your audience already holds stablecoins and prefers on-chain payments over traditional card flows.
  </Card>

  <Card title="Lowest Fees" icon="piggy-bank">
    Just 1% Nevermined fee with no additional processing surcharges. Ideal for high-volume or high-value use cases.
  </Card>

  <Card title="On-Chain Transparency" icon="magnifying-glass">
    Every payment settles on-chain, giving both parties a verifiable, auditable record of every transaction.
  </Card>
</CardGroup>

## How It Works

<Steps>
  <Step title="Fund a smart account">
    The subscriber funds their Nevermined smart account with ERC-20 tokens (USDC, EURC, or another supported token). This account is an ERC-4337 smart account that supports programmable permissions.
  </Step>

  <Step title="Create a delegation">
    The subscriber creates a delegation that grants the facilitator permission to execute specific actions (order plans, burn credits, redeem access) on their behalf. Each delegation is scoped by spending limits and duration, following the principle of least privilege.
  </Step>

  <Step title="Payment settles on-chain">
    When the subscriber purchases a plan or makes a request, the facilitator submits a UserOperation to the smart contract. The payment settles on-chain and credits are minted to the subscriber.
  </Step>

  <Step title="Credits consumed per request">
    Each API call or agent query burns credits according to the plan configuration. If the subscriber's balance runs low, the facilitator can [top up](/docs/integrate/patterns/top-up) their credits automatically — when the wallet has sufficient balance and the delegation permits it.
  </Step>
</Steps>

## Supported Networks and Tokens

Payments settle on the **Base** network. The most common tokens are:

| Token | Description                     | Base Mainnet                                 | Base Sepolia                                 |
| ----- | ------------------------------- | -------------------------------------------- | -------------------------------------------- |
| USDC  | USD-pegged stablecoin by Circle | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | `0x036CbD53842c5426634e7929541eC2318f3dCF7e` |
| EURC  | EUR-pegged stablecoin by Circle | `0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42` | `0x808456652fdb597867f38412077A9182bf77359F` |

<Tip>
  Nevermined supports any ERC-20 token on Base. If you need to accept a custom token, you can specify its contract address when creating your plan's price configuration.
</Tip>

## Permission Model

Delegations are the core of the stablecoin permission model. Instead of giving the facilitator full control over a wallet, subscribers create scoped delegations that limit exactly what can be done. The delegation model is shared between crypto (`erc4337`) and fiat (`stripe`) payment providers.

Each delegation enforces the **principle of least privilege** through two limits:

| Limit                | Description                                                               |
| -------------------- | ------------------------------------------------------------------------- |
| `spendingLimitCents` | Maximum total amount (in cents) that can be spent across all transactions |
| `durationSecs`       | Duration in seconds after which the delegation expires                    |

When the spending limit is exhausted or the delegation expires, it stops working. The subscriber must create a new delegation with fresh limits to continue.

Delegations are created via the SDK before generating an x402 access token:

```typescript theme={null}
// Create a delegation for crypto payments
const delegation = await payments.delegation.createDelegation({
  provider: 'erc4337',
  spendingLimitCents: 10000,
  durationSecs: 604800, // 7 days
  currency: 'usdc',
})
```

<Note>
  Delegations are revocable at any time by the smart account owner. You always retain full control over your wallet. Under the hood, delegations create the appropriate session keys for the chosen provider.
</Note>

## Fees and Settlement

| Item                 | Cost                                            |
| -------------------- | ----------------------------------------------- |
| Nevermined fee       | 1% of the plan price                            |
| Processing surcharge | None                                            |
| Settlement           | On-chain via Nevermined smart contracts on Base |

Because there's no payment processor in the middle, stablecoin payments carry no additional fees beyond the 1% Nevermined fee. This makes them the most cost-effective option, especially for high-volume use cases.

## Supported Plan Types

<CardGroup cols={2}>
  <Card title="Credits-Based" icon="coins">
    Prepaid credits consumed per request. Set total credits and cost per request when creating the plan.
  </Card>

  <Card title="Time-Based" icon="clock">
    Unlimited access for a set duration (days, months, years). Great for subscription-style access.
  </Card>

  <Card title="Dynamic Pricing" icon="chart-line">
    Variable credit charges based on request complexity, token count, or custom metrics.
  </Card>

  <Card title="Hybrid" icon="layer-group">
    Combine time-based access with credit limits for balanced monetization.
  </Card>

  <Card title="Trial" icon="flask">
    Offer free credits or time-limited trials to let users test your agent before purchasing.
  </Card>

  <Card title="Pay-As-You-Go" icon="meter">
    Per-request settlement in USDC or EURC. No prepaid credits needed -- customers pay on demand.
  </Card>
</CardGroup>

## Automatic Top-Ups

When a subscriber's credit balance runs low, the facilitator can automatically top up their credits at settlement — no manual balance checks required. This keeps agent-to-agent workflows running without interruption, bounded by the delegation's `spendingLimitCents`.

See the [Automatic Credit Top-Ups](/docs/integrate/patterns/top-up) guide for how it works, how to set up the delegation, crypto vs. fiat behavior, and failure handling.

## Next Steps

<CardGroup cols={2}>
  <Card title="Fiat Payments" icon="credit-card" href="/docs/integrate/patterns/fiat-payments">
    Accept credit cards via Stripe for mainstream and enterprise users
  </Card>

  <Card title="Payment Models" icon="calculator" href="/docs/integrate/patterns/payment-models">
    Configure credits, time-based, dynamic, and hybrid plans
  </Card>

  <Card title="Nevermined x402" icon="handshake" href="/docs/development-guide/nevermined-x402">
    Deep dive into the x402 protocol and smart account settlement
  </Card>

  <Card title="Payment Plans API" icon="code" href="/docs/api-reference/typescript/payment-plans">
    Create and manage plans programmatically with the TypeScript SDK
  </Card>
</CardGroup>
