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

# Gas Sponsorship

> Pay gas for your users—they never see fees

Sponsorship is the ultimate gasless experience. You pay, users don't see or think about gas. Perfect for onboarding, promotions, and premium features.

<Info>
  **MEE Supersedes Paymasters**: In traditional ERC-4337 implementations, gas sponsorship requires configuring a separate paymaster service. Biconomy's MEE (Modular Execution Environment) has replaced paymasters—providing all sponsorship functionality plus cross-chain gas abstraction in a unified interface. One gas tank powers sponsorship across **all supported chains**.
</Info>

## When to Sponsor

<Check>Onboarding new users (first transaction free)</Check>
<Check>Promotional campaigns</Check>
<Check>Premium features for paying customers</Check>
<Check>High-value actions where friction costs conversions</Check>
<Check>Enterprise apps where users shouldn't see blockchain</Check>

## Choosing the Right Flow

| Wallet Type      | Flow              | Sponsorship Ready? | Notes                                             |
| ---------------- | ----------------- | ------------------ | ------------------------------------------------- |
| Embedded Wallets | EIP-7702          | Easy               | Best UX, full smart account delegation            |
| External EOAs    | Fusion            | Conditional        | Requires permit-supporting tokens or fallback gas |
| Native SCAs      | SCA Orchestration | Flexible           | Best for apps controlling deployment              |

## Setup

### 1. Get API Key with Sponsorship

1. Go to [dashboard.biconomy.io](https://dashboard.biconomy.io)
2. Create a project
3. Enable sponsorship
4. Copy your API key
5. Sponsorship is post-paid, Biconomy will invoice your for the costs at the end of the month

### 2. Implement

```typescript theme={null}
import {
  createMeeClient,
  toMultichainNexusAccount,
  getMEEVersion,
  MEEVersion
} from "@biconomy/abstractjs";

// 1. Setup with API key
const account = await toMultichainNexusAccount({
  signer: userWallet,
  chainConfigurations: [
    { chain: base, transport: http(), version: getMEEVersion(MEEVersion.V2_1_0) }
  ]
});

const meeClient = await createMeeClient({
  account,
  apiKey: YOUR_API_KEY  // Sponsorship-enabled key
});

// 2. Build instruction
const mintInstruction = await account.buildComposable({
  type: "default",
  data: {
    chainId: base.id,
    to: NFT_CONTRACT,
    abi: nftAbi,
    functionName: "mint",
    args: [userAddress, tokenId]
  }
});

// 3. Get sponsored quote
const quote = await meeClient.getQuote({
  sponsorship: true,  // Enable sponsorship
  instructions: [mintInstruction]
});

// 4. Execute (user signs, you pay gas)
const { hash } = await meeClient.executeQuote({ quote });

// 5. Wait for confirmation
const receipt = await meeClient.waitForSupertransactionReceipt({ hash });
```

For sponsorship on testnets (no API key, shared gas tank), see [Testnet Sponsorship](/gasless-apps/testnet-sponsorship).

## Sponsorship Controls

<Warning>
  **All sponsorship limits and configurations are managed exclusively through the [Biconomy Dashboard](https://dashboard.biconomy.io) — not in code.** Your code only needs `sponsorship: true` in the quote request. Everything else is configured in the dashboard.
</Warning>

Go to [dashboard.biconomy.io](https://dashboard.biconomy.io) and navigate to your project's sponsorship settings to configure:

* **Per-transaction limit** — set a maximum USD amount you're willing to sponsor per individual transaction
* **Total spending cap** — set an overall budget ceiling for your sponsorship
* **Allowed contracts** — restrict sponsorship to specific contract addresses
* **Chain restrictions** — limit which chains are eligible for sponsored transactions

## Monitoring & Analytics

Track sponsorship usage in the dashboard:

* Total gas sponsored
* Spend by contract
* Remaining balance

## Best Practices

### Start with Limits

Before going live, head to [dashboard.biconomy.io](https://dashboard.biconomy.io) and set reasonable per-transaction and total spending limits. Don't launch with unlimited sponsorship — always cap your exposure first.

### Monitor Spend

Use the dashboard to track spending and set up alerts for:

* Spend thresholds being approached
* Unusual activity patterns
* Low balance warnings

## EIP-7702 Sponsorship (Embedded Wallets)

EIP-7702 lets you install smart account logic **directly on EOAs**, enabling orchestration and sponsorship with zero user effort.

```typescript theme={null}
const quote = await meeClient.getQuote({
  sponsorship: true,
  instructions: [/* your calls here */],
  delegate: true,
  authorization // Required for 7702 accounts
});
```

<Note>
  **Full Support**: Supports all ERC-20s, multichain execution, and full transaction abstraction.
</Note>

<Info>
  **Best For**: Embedded wallets (Privy, Dynamic, Turnkey, ...)
</Info>

## Fusion Sponsorship (External Wallets)

For MetaMask/Rabby users, use Fusion with sponsorship. Fusion enables orchestration from EOAs via a **trigger + Companion Account** pattern:

```typescript theme={null}
const quote = await meeClient.getFusionQuote({
  sponsorship: true,
  trigger: {
    amount: 1n,
    chainId: base.id,
    tokenAddress: USDC
  },
  instructions: [/* your calls here */]
});

const { hash } = await meeClient.executeFusionQuote({ fusionQuote: quote });
```

<Warning>
  Fusion sponsorship requires the trigger token to support ERC-2612 permit for fully gasless experience. Otherwise, user needs gas for one approval.
</Warning>

<Info>
  **Best For**: External Wallets - MetaMask, Trust, Rabby, Coinbase Wallet, Uniswap Wallet, ...
</Info>

## Hosted vs Self-Hosted Sponsorship

<Tabs>
  <Tab title="Biconomy-Hosted">
    * No infra required
    * Uses Biconomy-managed gas tanks
    * Set up via dashboard
    * Supports post-paid modes with enterprise contracts or paying via credit card

    ```typescript theme={null}
    const meeClient = await createMeeClient({
      account: orchestrator,
      apiKey: "your_project_api_key"
    });
    ```
  </Tab>

  <Tab title="Self-Hosted">
    * Run your own sponsorship backend
    * Fully programmable: accept or reject transactions based on any custom logic
    * Define your own gas tank and token

    ```typescript theme={null}
    sponsorshipOptions: {
      url: "https://your-custom-backend",
      gasTank: {
        address: "0x...",
        token: "0x...",
        chainId: 84532
      }
    }
    ```

    Ideal for wallets, infra providers, or apps needing custom user-based policies.
  </Tab>
</Tabs>

## Common Issues

### "Sponsorship not enabled"

* Check API key has sponsorship enabled in dashboard

### "Transaction limit exceeded"

* Transaction gas cost exceeds your per-transaction limit
* Adjust limits in dashboard if needed

## Next Steps

<CardGroup cols={2}>
  <Card title="Pay in Tokens" icon="coins" href="/gasless-apps/pay-in-tokens">
    Alternative: let users pay in ERC-20
  </Card>

  <Card title="Use Cases" icon="lightbulb" href="/gasless-apps/use-cases">
    See sponsorship in action
  </Card>
</CardGroup>
