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

# Tempo Fee Sponsorship

> Have one vault account pay the network fee for Tempo transfers sent from other vault accounts in your workspace, using Tempo's native fee sponsorship.

> [!NOTE]
>
> Every Tempo feature in this section is in beta and available through the API only. To get access, contact your Customer Success Manager (CSM).

With fee sponsorship, one vault account (the fee payer) pays the network fee for a transfer sent from another vault account in the same workspace. The sender doesn't need to hold the fee token, so you can fund a single treasury vault for fees instead of topping up every deposit or customer vault. This uses Tempo's native [fee sponsorship](https://tempo.xyz/developers/docs/guide/use-accounts/fee-sponsorship), not a relayer or a forwarder contract.

## How it works

A sponsored Tempo Transaction carries two signatures, one from each account, over two different payloads:

1. **The sender signs** the transfer with the fee token left blank. This lets the fee payer choose the token.
2. **The fee payer signs** a separate payload that commits to the fee token and to the sender's address. The signature can't be reused to sponsor a different sender.
3. **Fireblocks combines** both signatures into one transaction and broadcasts it. The chain charges the fee to the fee payer, in the fee token.

Fireblocks produces both signatures with MPC in one signing round, so you don't run a second step. The transfer goes through one Policy Engine evaluation, which names both the source and the fee payer.

## Set up the fee payer

Pick the vault account that will pay fees, and fund it with the stablecoin you'll use for fees, such as PathUSD on Tempo.

## Rules

* The fee payer must be a vault account in the same workspace as the source.
* The fee payer must be a different vault account from the source. Fireblocks rejects the request with a 400 error: "A vault account cannot sponsor its own fee".
* The fee payer pays in the transaction's `feeCurrency`. If you leave `feeCurrency` out, Tempo picks the fee token using its fee-token rules (see [How Tempo chooses the fee token](https://developers.fireblocks.com/docs/tempo-fee-token-selection.md#how-tempo-chooses-the-fee-token)). Set it to control which token the fee payer spends.
* Sponsorship works only for TIP-20 transfers. An ERC-20 transfer on Tempo always pays its own fee.

## Create a sponsored transfer

Add `feePayerAccountId` to a `POST /v1/operations/tempo/transfer` request.

`feePayerAccountId` on its own turns sponsorship on, so you don't need `useGasless`. Don't send `useGasless: false` with it, or the transfer goes out unsponsored and the source pays the fee. `useGasless: true` without `feePayerAccountId` doesn't sponsor the transfer.

```json POST /v1/operations/tempo/transfer theme={"system"}
{
  "assetId": "OUSD_TEMPO_MODERATO_TEST_GV4U",
  "amount": "250",
  "source": { "type": "VAULT_ACCOUNT", "id": "5" },
  "destination": { "type": "VAULT_ACCOUNT", "id": "8" },
  "feeCurrency": "PATHUSD_TEMPO_MODERATO_TEST_O46L",
  "feePayerAccountId": "1",
  "externalTxId": "d2e9f0a1-3b4c-4d5e-8f6a-7b8c9d0e1f2a"
}
```

The response returns only the transaction ID and status:

```json Response theme={"system"}
{
  "id": "7f3a1c9e-4b2d-4e1a-9c3f-1a2b3c4d5e6f",
  "status": "SUBMITTED"
}
```

To confirm which vault account paid, read `feePayerInfo.feePayerAccountId` on the transaction. See [How fees appear on the transaction](https://developers.fireblocks.com/docs/tempo.md#how-fees-appear-on-the-transaction).

### Code sample

The sample reads credentials from environment variables. Never hardcode an API key or secret key.

```typescript TypeScript theme={"system"}
import { readFileSync } from "node:fs";
import { createHash, randomUUID } from "node:crypto";
import axios from "axios";
import jwt from "jsonwebtoken";

const BASE_URL = "https://api.fireblocks.io";
const PATH = "/v1/operations/tempo/transfer";

async function sendSponsoredTransfer() {
  const body = JSON.stringify({
    assetId: "OUSD_TEMPO_MODERATO_TEST_GV4U",
    amount: "250",
    source: { type: "VAULT_ACCOUNT", id: "5" },      // sender: holds OpenUSD only
    destination: { type: "VAULT_ACCOUNT", id: "8" },
    feeCurrency: "PATHUSD_TEMPO_MODERATO_TEST_O46L", // token the fee payer spends
    feePayerAccountId: "1",                          // fee payer vault account
    externalTxId: randomUUID(),                      // unique per request
  });

  const apiKey = process.env.FIREBLOCKS_API_KEY!;
  const secretKey = readFileSync(process.env.FIREBLOCKS_SECRET_KEY_PATH!, "utf8");
  const token = jwt.sign(
    { uri: PATH, nonce: randomUUID(), bodyHash: createHash("sha256").update(body).digest("hex") },
    secretKey,
    { algorithm: "RS256", subject: apiKey, expiresIn: 55 },
  );

  const { data } = await axios.post(BASE_URL + PATH, body, {
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": apiKey,
      Authorization: `Bearer ${token}`,
    },
  });

  console.log(`Created ${data.id}, status ${data.status}`);
}

sendSponsoredTransfer().catch((err) => {
  console.error("Sponsored transfer failed:", err?.response?.data ?? err.message);
  process.exit(1);
});
```
