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

> ## Agent Instructions
> Before reading these docs, install the relevant Circle Skill to get pre-loaded context — skills are LLM-optimized and cover architecture decisions, correct flows, and common pitfalls. In Claude Code: run /plugin marketplace add circlefin/skills then /plugin install circle-skills@circle. With Vercel Skills CLI: run npx skills add circlefin/skills. Available skills: use-usdc https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-usdc/SKILL.md (balances, transfers, approvals on EVM and Solana); EURC has no skill — see https://developers.circle.com/stablecoins/what-is-eurc.md; bridge-stablecoin https://github.com/circlefin/skills/blob/master/plugins/circle/skills/bridge-stablecoin/SKILL.md (crosschain transfers via CCTP, USDC, EURC, and third-party assets); use-arc https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-arc/SKILL.md (Arc chain config, contract deployment, USDC bridging — Arc docs: https://docs.arc.io/llms.txt); use-circle-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-circle-wallets/SKILL.md (choose wallet type); use-developer-controlled-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-developer-controlled-wallets/SKILL.md (custodial wallets for payouts and treasury); use-user-controlled-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-user-controlled-wallets/SKILL.md (embedded wallets with Web2 login); use-modular-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-modular-wallets/SKILL.md (smart contract wallets with passkeys and ERC-4337); use-gateway https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-gateway/SKILL.md (unified USDC balance, nanopayments); use-smart-contract-platform https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-smart-contract-platform/SKILL.md (deploy, interact, monitor contracts). Pair any skill with the Circle MCP server for live SDK signatures, contract addresses, and chain IDs: {"mcpServers":{"circle":{"url":"https://api.circle.com/v1/codegen/mcp"}}}.
> Read the product overview first. Each product has an overview explaining when and why to use it. Read it before quickstarts.
> Pick the right wallet type. Developer-controlled (you hold keys), user-controlled (end user holds keys via PIN/social login), or modular (smart contract wallets with passkeys). See https://developers.circle.com/wallets.md.
> Use CCTP V2 for crosschain transfers. CCTP natively transfers USDC and EURC via burn-and-mint, and supports permissionless wrapping of third-party assets via lock-and-mint. V1 is legacy; always use V2 unless V1 is specified or the chain requires it (Noble, Sui, and Aptos still require V1). Migration guide: https://developers.circle.com/cctp/migration-from-v1-to-v2.md.
> Use Bridge Kit for frontend bridging. Wraps CCTP with a simpler SDK for user-facing apps. Use CCTP directly for backend transfers.
> Gas Station vs Paymaster. Gas Station sponsors gas for Circle Wallet transactions. Paymaster lets users pay gas in USDC. Different use cases — read both overviews.
> Gateway Nanopayments for sub-cent payments. Gasless USDC micropayments down to $0.000001 via x402 and batched settlement. For pay-per-request APIs, AI agent payments, streaming.
> Look up USDC addresses per chain. Never hardcode — use https://developers.circle.com/stablecoins/usdc-contract-addresses.md.
> Prefer SDKs over raw API calls. Node.js and Python SDKs handle auth, retries, and errors.
> API key required. Bearer token in Authorization header. Testnet and mainnet use separate keys and may use different base URLs depending on the product.
> Set up webhooks when available. Most operations are async. Webhooks deliver transaction confirmations and state changes.
> When calling list endpoints, paginate using pageSize and pageAfter until no nextPageAfter cursor is returned—stopping at the first page silently misses records.
> Building an AI agent? Start with the Agent Stack—Circle CLI, agent wallets, and nanopayments built for autonomous use cases: https://developers.circle.com/agent-stack.md.

# How upfront fees work

> Learn how CCTP collects upfront fees and completes Fast Transfer and Forwarding Service transfers.

Paying fees upfront starts with requesting a signed fee quote from Circle, then
submitting that quote with the burn in a single transaction on the source
blockchain. Circle honors the quoted price, so the recipient receives the full
transferred amount. For a full walkthrough, see
[Transfer USDC with upfront fees](/cctp/howtos/transfer-usdc-with-upfront-fees).

## Transfer flow with upfront fees

```mermaid theme={null}
sequenceDiagram
    actor User
    participant API as Quote API
    participant USDC as USDC token
    participant TMWF as TokenMessengerWithFees
    participant CCTP as TokenMessengerV2
    participant Circle as Circle

    User->>API: Request fee quote
    API-->>User: Signed, time-bound quote
    User->>USDC: approve(TMWF, amount [+ fee])
    User->>TMWF: depositForBurnWithFees (quote + fee)
    TMWF->>TMWF: Verify quote and collect fee
    TMWF->>CCTP: depositForBurn
    CCTP-->>Circle: Burn message emitted
    Circle-->>User: Full amount minted on destination
```

<Steps>
  <Step title="Request a quote">
    Request an [upfront fee quote](/cctp/concepts/upfront-fee-quotes) from the
    [Quote API](/api-reference/cctp/all/create-usdc-burn-quote) for the fees you
    want to pay upfront: the Forwarding Service fee, the Fast Transfer fee, or
    both. See [Paying the fee](#paying-the-fee) for the available fee tokens.
  </Step>

  <Step title="Receive a signed quote">
    Circle returns a signed, time-bound quote that prices each fee and includes a
    `signedQuote` blob.
  </Step>

  <Step title="Approve USDC">
    Approve
    [`TokenMessengerWithFees`](/cctp/references/contract-interfaces#tokenmessengerwithfees)
    to spend the USDC amount you're transferring, plus the quoted fee if you're
    paying it in USDC. The contract pulls the transfer amount for the burn and, if
    applicable, the fee amount.
  </Step>

  <Step title="Submit the burn">
    Call `depositForBurnWithFees` (or `depositForBurnWithHookAndFees`) on
    `TokenMessengerWithFees`, passing the signed quote along with the standard
    `depositForBurn` parameters, and pay the quoted fee amount: attach it as the
    transaction's native value, or rely on the USDC approval from the previous
    step.
  </Step>

  <Step title="Fee is collected and tokens are burned">
    The contract verifies the quote, collects the fee, and then delegates to
    `TokenMessengerV2` to complete the CCTP burn.
  </Step>

  <Step title="Full amount is minted">
    Circle attests the transfer with no fee deducted at mint, and the full amount
    is minted to the recipient.
  </Step>
</Steps>

## Paying the fee

The token you selected on the quote request decides where the fee comes from:

* **Native gas token** (default): attach the quoted amount as the transaction's
  native value.
* **USDC**: request the quote with `feeToken` set to the USDC address, then
  approve `TokenMessengerWithFees` to spend the quoted fee before you submit.
  This fee approval is on top of the USDC you're transferring, so approve the
  transfer amount plus the quoted fee.

## Forwarding with upfront fees

When a quote includes a `FORWARD` fee, the transfer is forwarded on the
destination blockchain the same way as any other
[Forwarding Service](/cctp/concepts/forwarding-service) transfer, except that
the forwarding fee isn't deducted from the transferred amount. What changes is
how you supply the hook data.

Forwarding requires a valid `cctp-forward` hook in the submitted hook data.
[`depositForBurnWithFees`](/cctp/references/contract-interfaces#depositforburnwithfees)
builds this hook for you automatically, as long as you request the quote without
passing `hookData`. For custom hook data, use
[`depositForBurnWithHookAndFees`](/cctp/references/contract-interfaces#depositforburnwithhookandfees)
and submit the same `hookData` you used to request the quote. For the hook
structure, including how to append your own frame, see
[Forwarding Service hook format](/cctp/concepts/forwarding-service#hook-format).
