> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://tempo.xyz/developers/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

# Fee Payer API

Use the Fee Payer API to cover transaction fees for your users.

<span id="how-hosted-fee-sponsorship-works" />

## How the Fee Payer API works

A fee payer pays the fee for a transaction sent by another account. Use one to cover transaction costs for your users.

The sender authorizes the transaction, and the fee payer separately authorizes the fee. When you prepare a transaction, request sponsorship from a fee payer endpoint. The service applies its policy, fills the required fields, and reports whether the request was sponsored.

Tempo supports this flow natively, so you do not need a paymaster contract, bundler, or EntryPoint contract.

<span id="hosted-fee-payer-endpoints" />

The Tempo API provides a hosted JSON-RPC relay that fills, sponsors, and broadcasts Tempo Transactions. Authenticate with a [Tempo API key](/docs/api/authentication), then use the Fee Payer API as your sponsorship RPC URL:

```text
https://api.tempo.xyz/rpc/sponsor
```

<span id="configure-clients-for-hosted-fee-sponsorship" />

## Get Started

::::steps
### Sign into the Tempo Console

Open the [Tempo Console](https://console.tempo.xyz/?to=/\:org/projects) and select **Sign in with Tempo**.

:::info
Tempo Console signups are currently limited. [Contact us](https://tempo.xyz/contact/) to request access.
:::

### Set up Organization

Create an organization and project.

### Set up Billing

For this testnet example, switch to [**Sandbox mode**](https://console.tempo.xyz/?to=/\:org/projects%3Fenv%3Dsandbox) (located in the top-left organization picker), then open [**Billing**](https://console.tempo.xyz/?to=/\:org/billing%3Fenv%3Dsandbox) and add a payment method.

:::info
For production, keep the Console in the production environment and do not switch to **Sandbox mode**. Production fee sponsorship requires active billing.
:::

### Get an API Key

Open [**API Keys**](https://console.tempo.xyz/?to=/\:org/api-keys%3Fenv%3Dsandbox), select [**New key**](https://console.tempo.xyz/?to=/\:org/api-keys/new%3Fenv%3Dsandbox), choose your project, and create the key. Copy it when prompted; it is shown only once.

### Sponsor Transaction Fees

Configure Viem's [`withRelay`](https://viem.sh/tempo/transports/withRelay) transport with a default RPC transport and the Tempo API sponsorship endpoint. Add your Tempo API key through the endpoint's `key` search parameter, then set `feePayer: true` when sending a transaction to request sponsorship.

:::info
For production, do not switch to **Sandbox mode**. Remove `testnet: true` and replace the sandbox API key with a production API key (`tempo:sk:...`).
:::

```ts twoslash [example.ts]
import { Account, createClient, http, withRelay } from 'viem/tempo'

const client = createClient({
  account: Account.fromSecp256k1('0x...'),
  testnet: true,
  transport: withRelay( // [!code focus]
    http(), // default transport // [!code focus]
    http('https://api.tempo.xyz/rpc/sponsor?key=tempo_sandbox:sk:...'), // relay transport // [!code focus]
  ), // [!code focus]
})

const receipt = await client.sendTransactionSync({
  data: '0xdeadbeef',
  feePayer: true, // [!code focus]
  to: '0xcafebabecafebabecafebabecafebabecafebabe',
})
```
::::

## Public testnet fee payer

For demos and testnet development without an API key, use Tempo's public fee payer endpoint:

```text
https://sponsor.moderato.tempo.xyz
```

Use the Fee Payer API above for authenticated sandbox and production integrations.

<span id="use-a-fee-payer-in-production" />

## Learn more

* [Viem Fee Sponsorship](https://viem.sh/tempo/guides/sponsor-fees) — Use a local account or fee payer endpoint to sponsor transaction fees with Viem.
* [Tempo API Authentication](/docs/api/authentication) — Authenticate fee payer requests with a production or sandbox API key.
* [Sponsor User Fees](/docs/guide/payments/sponsor-user-fees) — Learn how Tempo fee sponsorship works across supported SDKs.
* [Tempo Transaction Spec](/docs/protocol/transactions/spec-tempo-transaction#fee-payer-signature-details) — Read the fee payer signature details in the Tempo Transaction specification.
