> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://mpp.dev/api/mcp` to find what you need.

# Tempo \[Stablecoin payments on the Tempo blockchain]

## Choose a signing account

### Direct

Create a server-only wallet.ts module, then import account wherever an example creates a local signing account.

```ts
import { privateKeyToAccount } from 'viem/accounts'

export const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`)
```

### Privy

Create an EVM wallet in Privy, fund it with the required currency on this page's network, and keep PRIVY\_APP\_SECRET server-side.

```bash
pnpm add @privy-io/node
```

Create a server-only privy.ts module, then import its account wherever an example configures account or feePayer.

```ts
import { PrivyClient } from '@privy-io/node'
import { createViemAccount } from '@privy-io/node/viem'

const privy = new PrivyClient({
  appId: process.env.PRIVY_APP_ID!,
  appSecret: process.env.PRIVY_APP_SECRET!,
})

export const account = createViemAccount(privy, {
  address: process.env.PRIVY_WALLET_ADDRESS as `0x${string}`,
  walletId: process.env.PRIVY_WALLET_ID!,
})
```

createViemAccount delegates signatures to the Privy wallet, so it replaces any local viem account in the examples on this page.

The [Tempo](https://docs.tempo.xyz) payment method enables payments using TIP-20 stablecoins on the Tempo blockchain. Tempo supports **charge** for one-time payments, **session** for pay-as-you-go payment channels, and **subscription** for recurring access.

## Payments on Tempo

Tempo is purpose-built for the payment patterns MPP enables:

* **Instant finality**—Transactions settle in ~500ms with deterministic confirmation, no probabilistic waiting
* **Sub-cent fees**—Transaction costs low enough for micropayments and per-request billing
* **Fee sponsorship**—Servers can pay gas fees on behalf of clients, removing wallet UX friction entirely
* **2D nonces**—Parallel nonce lanes let clients submit payment transactions without blocking other account activity
* **Payment lane**—Dedicated transaction ordering for payment channel operations, providing reliable channel management UX
* **High throughput**—Tempo's throughput handles the on-chain settlement and channel management volume that payment sessions generate at scale

## Choosing a payment method

| | **Charge** | **Session** Recommended | **Subscription** New |
|---|---|---|---|
| **Pattern** | One-time payment per request | Continuous pay-as-you-go | Recurring access |
| **Latency overhead** | ~500ms (on-chain confirmation) | Near-zero | Near-zero after activation |
| **Throughput** | One transaction per request | Hundreds of vouchers per second per channel | One renewal per period |
| **Best for** | Single API calls, content access, one-off purchases | LLM APIs, metered services, usage-based billing | Plans, memberships, recurring API access |
| **On-chain cost** | Per request (0.001 USD per request) | Amortized across many requests (0.001 USD total) | Per billing period |
| **Settlement** | Immediate on-chain transaction | Off-chain vouchers, periodic on-chain settlement | Key-authorized recurring transfers |

## Intents

<div className="vocs:grid vocs:grid-cols-1 vocs:md:grid-cols-3 vocs:gap-4">
  <a href="/payment-methods/tempo/charge" className="vocs:relative vocs:flex vocs:flex-col vocs:space-y-2 vocs:rounded-md vocs:bg-surfaceTint/70 vocs:border vocs:border-primary vocs:p-4 vocs:no-underline vocs:transition-colors vocs:hover:bg-surfaceTint">
    <div className="vocs:size-8 vocs:flex vocs:items-center vocs:justify-center vocs:rounded-lg vocs:border vocs:border-primary vocs:bg-surface vocs:text-accent">
      <svg viewBox="0 0 24 24" width="20" height="20">
        <path fill="currentColor" d="M10.55 17h-2.73l2.53-7.73h-3.24l.71-2.27h9.03l-.71 2.27h-3.07L10.55 17Z" />
      </svg>
    </div>

    <div className="vocs:text-[15px] vocs:font-medium vocs:text-heading">Tempo charge</div>
    <div className="vocs:text-sm vocs:leading-relaxed vocs:text-secondary">Immediate one-time payments settled on-chain</div>
  </a>

  <a href="/payment-methods/tempo/session" className="vocs:relative vocs:flex vocs:flex-col vocs:space-y-2 vocs:rounded-md vocs:bg-surfaceTint/70 vocs:border vocs:border-primary vocs:p-4 vocs:no-underline vocs:transition-colors vocs:hover:bg-surfaceTint">
    <div className="vocs:absolute vocs:top-4 vocs:right-4">Recommended</div>

    <div className="vocs:size-8 vocs:flex vocs:items-center vocs:justify-center vocs:rounded-lg vocs:border vocs:border-primary vocs:bg-surface vocs:text-accent">
      <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
        <path d="M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1" />

        <path d="M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1" />

        <path d="M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1" />
      </svg>
    </div>

    <div className="vocs:text-[15px] vocs:font-medium vocs:text-heading">Session</div>
    <div className="vocs:text-sm vocs:leading-relaxed vocs:text-secondary">Pay-as-you-go payment sessions over payment channels</div>
  </a>

  <a href="/payment-methods/tempo/subscription" className="vocs:relative vocs:flex vocs:flex-col vocs:space-y-2 vocs:rounded-md vocs:bg-surfaceTint/70 vocs:border vocs:border-primary vocs:p-4 vocs:no-underline vocs:transition-colors vocs:hover:bg-surfaceTint">
    <div className="vocs:absolute vocs:top-4 vocs:right-4">New</div>

    <div className="vocs:size-8 vocs:flex vocs:items-center vocs:justify-center vocs:rounded-lg vocs:border vocs:border-primary vocs:bg-surface vocs:text-accent">
      <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
        <path d="M8 2v4" />

        <path d="M16 2v4" />

        <rect width="18" height="18" x="3" y="4" rx="2" />

        <path d="M3 10h18" />

        <path d="m9 16 2 2 4-4" />
      </svg>
    </div>

    <div className="vocs:text-[15px] vocs:font-medium vocs:text-heading">Subscription</div>
    <div className="vocs:text-sm vocs:leading-relaxed vocs:text-secondary">Recurring stablecoin payments for paid API plans</div>
  </a>
</div>

## Fee sponsorship

Tempo supports server-paid transaction fees for charge, session, and subscription intents. When enabled, the client signs only the payment authorization and the server covers gas costs. The client doesn't need to hold gas tokens or understand fee mechanics.

Pass a `feePayer` account to a Tempo server method to enable this. For one-time charges, configure `tempo.charge`:

```ts twoslash
import { Mppx, tempo } from 'mppx/server'
import { privateKeyToAccount } from 'viem/accounts'

const mppx = Mppx.create({
  methods: [tempo.charge({
    feePayer: privateKeyToAccount('0x…'), // [!code hl]
  })],
})
```

It is also possible to point the `feePayer` to a fee service that supports the [`Handler.feePayer`](https://docs.tempo.xyz/sdk/typescript/server/handler.feePayer) endpoint:

```ts
import { Mppx, tempo } from 'mppx/server'

const mppx = Mppx.create({
  methods: [tempo.charge({
    feePayer: 'https://sponsor.example.com', // [!code hl]
  })],
})
```

For Sessions, pass the same `feePayer` parameter to [`tempo.session`](/sdk/typescript/server/Method.tempo.session) alongside `account` and `store`.
