---
title: "Estimates fees for a sponsored (gasless) transaction."
method: POST
path: "/api/v1/relayers/{relayer_id}/transactions/sponsored/quote"
tags: ["Relayers"]
---

# Estimates fees for a sponsored (gasless) transaction.

`POST /api/v1/relayers/{relayer_id}/transactions/sponsored/quote`

This endpoint provides fee estimation for transactions where the relayer will pay the network fees
on behalf of the user. The user pays fees in a token of their choice (e.g., USDC) instead of the
native network currency (e.g., XLM for Stellar).

The endpoint accepts either a pre-built transaction XDR or a set of operations to build a transaction from.
It returns the estimated fee amount in the specified fee token and the conversion rate from the native currency.

## Path parameters

- `relayer_id` string, required

## Request body

- union — Network-agnostic fee estimate request parameters for gasless transactions. Contains network-specific request parameters for fee estimation. The network type is inferred from the relayer's network configuration. For Stellar, supports both classic and Soroban gas abstraction: - Classic: Pass operations or transaction_xdr with classic fee token (native/USDC:GA...) - Soroban: Pass transaction_xdr containing InvokeHostFunction, user_address, and contract fee token (C...)
  - SolanaFeeEstimateRequestParams
    - `fee_token` string, required
    - `transaction` string, required
  - StellarFeeEstimateRequestParams
    - `fee_token` string, required — Asset identifier for fee token. For classic: "native" or "USDC:GA5Z..." format. For Soroban: contract address (C...) format.
    - `operations` OperationSpec[], nullable — Operations array to build transaction from Mutually exclusive with transaction_xdr field
      - union
        - object
          - `amount` string, required — Amount in stroops, encoded as a decimal string to preserve precision.
          - `asset` union, required
            - object
              - …
            - object
              - …
            - object
              - …
          - `destination` string, required
          - `type` 'payment', required
        - object
          - `args` unknown[], required
            - unknown
          - `auth` union — Authorization specification for Soroban operations
            - object — No authorization required
              - …
            - object — Use the transaction source account for authorization
              - …
            - object — Use specific addresses for authorization
              - …
            - object — Advanced format - provide complete XDR auth entries as base64-encoded strings
              - …
          - `contract_address` string, required
          - `function_name` string, required
          - `type` 'invoke_contract', required
        - object
          - `auth` union — Authorization specification for Soroban operations
            - object — No authorization required
              - …
            - object — Use the transaction source account for authorization
              - …
            - object — Use specific addresses for authorization
              - …
            - object — Advanced format - provide complete XDR auth entries as base64-encoded strings
              - …
          - `constructor_args` unknown[], nullable
            - unknown
          - `salt` string, nullable
          - `source` union, required — Represents the source for contract creation
            - object
              - …
            - object
              - …
          - `type` 'create_contract', required
          - `wasm_hash` string, required
        - object
          - `auth` union — Authorization specification for Soroban operations
            - object — No authorization required
              - …
            - object — Use the transaction source account for authorization
              - …
            - object — Use specific addresses for authorization
              - …
            - object — Advanced format - provide complete XDR auth entries as base64-encoded strings
              - …
          - `type` 'upload_wasm', required
          - `wasm` union, required — Represents different ways to provide WASM code
            - object
              - …
            - object
              - …
    - `source_account` string, nullable — Source account address (required when operations are provided) For sponsored transactions, this should be the user's account address
    - `transaction_xdr` string, nullable — Pre-built transaction XDR (base64 encoded, signed or unsigned) Mutually exclusive with operations field. For Soroban gas abstraction: pass XDR containing InvokeHostFunction operation.

## Response `200`

Fee estimate retrieved successfully

- ApiResponseSponsoredTransactionQuoteResponse
  - `data` union — Network-agnostic fee estimate response for gasless transactions. Contains network-specific fee estimate results.
    - SolanaFeeEstimateResult
      - `conversion_rate` string, required
      - `estimated_fee` string, required
    - StellarFeeEstimateResult
      - `conversion_rate` string, required — Conversion rate from XLM to token (as string)
      - `fee_in_token` string, required — Estimated fee in token amount (raw units as string)
      - `fee_in_token_ui` string, required — Estimated fee in token amount (decimal UI representation as string)
      - `max_fee_in_token` string, nullable — Maximum fee in token amount (raw units as string). Only present for Soroban gas abstraction - includes slippage buffer.
      - `max_fee_in_token_ui` string, nullable — Maximum fee in token amount (decimal UI representation as string). Only present for Soroban gas abstraction - includes slippage buffer.
  - `error` string
  - `metadata` PluginMetadata
    - `logs` LogEntry[], nullable
      - `level` 'log' | 'info' | 'error' | 'warn' | 'debug' | 'result', required
      - `message` string, required
    - `traces` unknown[], nullable
      - unknown
  - `pagination` PaginationMeta
    - `current_page` integer, required
    - `per_page` integer, required
    - `total_items` integer, required
  - `success` boolean, required

## Other responses

- `400` — Bad Request - Invalid request parameters
- `401` — Unauthorized
- `404` — Not Found
- `429` — Too Many Requests
- `500` — Internal server error

## Changes

- **2026-06-05** `97fada1b2001` — 2 breaking
  - added the pattern `^-?[0-9]+$` to the request property `oneOf[#/components/schemas/StellarFeeEstimateRequestParams]/operations/items/oneOf[subschema #1]/amount`
  - the `oneOf[#/components/schemas/StellarFeeEstimateRequestParams]/operations/items/oneOf[subschema #1]/amount` request property type changed from `integer` to `string`, and format from `int64` to no format
- **2026-02-09** `6408963b7c93` — 2 info
  - added the optional property `data/oneOf[#/components/schemas/StellarFeeEstimateResult]/max_fee_in_token` to the response with the `200` status
  - added the optional property `data/oneOf[#/components/schemas/StellarFeeEstimateResult]/max_fee_in_token_ui` to the response with the `200` status
- **2025-12-02** `b62ae34bc27a` — 1 info
  - endpoint added
- **2025-10-31** `5487da58bf15` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/openzeppelin/apis/openzeppelin-relayer-api/changes/api/v1/relayers/:relayer_id/transactions/sponsored/quote/post.md)

---

[API](https://skmtc.dev/openzeppelin/apis/openzeppelin-relayer-api.md) · [All operations](https://skmtc.dev/openzeppelin/apis/openzeppelin-relayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openzeppelin/openzeppelin-relayer-api/revisions/e6e7514284f5/schema)
