ExchangeRebel Fee Oracle API

The Fee Oracle API from ExchangeRebel — 6 operation(s) for fee oracle.

GitHub OpenAPI

Operations 6

POST /toll/fees/estimate Estimate a Solana transaction's total fee cost #
POST /toll/fees/optimize Return an unsigned, fee-optimized version of a transaction #
GET /toll/fees/fees Current network fee percentiles (free) #
GET /toll/fees/health Upstream RPC status, latency, toll schedule #
POST /toll/fees/recipe Fuse fee estimate + optimize into one recipe #
POST /toll/fees/recipe/preflight Free pre-check twin: exact $0.01 price first #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/exchangerebel-com:exchangerebel-com-fee-oracle-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

exchangerebel-com-fee-oracle-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: ExchangeRebel — pay-per-call APIs for AI agents (x402 on…
  version: 1.0.0
  contact:
    name: 'ExchangeRebel (operator: Rebel Data)'
    url: https://exchangerebel.com
    email: sound.money.investing@gmail.com
  x-guidance: 'All paid operations use x402 on Solana: call without payment to get a 402 challenge (SOL recipient + USDC token account + fresh memo), pay with the memo attached via the Solana Memo program, then retry with header X-Payment-Tx: <signature> and ?toll_memo=<memo>. Challenges are dual-version: the PAYMENT-REQUIRED header carries the x402 v2 PaymentRequired object and the response body carries the same challenge in x402 v1 form for compatibility. Free operations (security: []) include each service''s /health catalog with full response shapes. Prices in x-payment-info are USD per call unless the summary says otherwise (RPC is per 1,000-request block; Telegram provisioning is per bot-month; transcription is per minute of audio).'
  description: '67 data and utility APIs behind x402 tolls, settled in SOL or USDC on Solana. Call a paid endpoint without payment to receive a 402 x402 challenge (recipient + fresh memo), pay with the memo attached via the Solana Memo program, then retry with the X-Payment-Tx header and toll_memo query parameter. Free catalog/health endpoints are marked without x-payment-info. Full catalogs: GET /toll/discovery and each service''s /health.'
servers:
- url: https://exchangerebel.com
tags:
- name: Fee Oracle
paths:
  /toll/fees/estimate:
    post:
      tags:
      - Fee Oracle
      summary: Estimate a Solana transaction's total fee cost
      responses:
        '200':
          description: Success. Response shape is documented in the service catalog (GET /health on the service).
          content:
            application/json:
              example:
                priority: medium
                percentile_used: p75
                micro_lamports: 9000
                compute_units: 540
                cu_estimated: true
                compute_units_consumed: 450
                base_fee_lamports: 5000
                priority_fee_lamports: 5
                total_fee_lamports: 5005
                confidence: high
                sample_size: 3
                breakdown:
                  consumed_cu: 450
                  recommended_cu_limit: 540
                  buffer: +20%
                  micro_lamports_per_cu: 9000
                  percentile: p75
                inputs_summary:
                  sources:
                  - solana-rpc:simulateTransaction
                  - solana-rpc:getRecentPrioritizationFees
                  sample_size: 3
                envelope:
                  v: 1
                  service: fee-oracle
                  source: solana-rpc
                  grade: derived
                  max_age_seconds: 10
                  changes:
                    supported: false
        '402':
          description: 'Payment Required (x402). The PAYMENT-REQUIRED response header carries the x402 v2 PaymentRequired object (base64 JSON: scheme, CAIP-2 network, amount, asset, payTo, plus the bazaar discovery extension); the response body carries the same challenge in x402 v1 form for compatibility, naming the SOL recipient and USDC token account on Solana plus a fresh memo. To pay on this service''s rail: pay with the memo attached (Solana Memo program), then retry with header ''X-Payment-Tx: <transaction signature>'' and query parameter ''toll_memo=<memo>''.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                transaction_base64:
                  type: string
                  description: string (or use accounts)
                accounts:
                  type: array
                  description: array of pubkeys
                  items:
                    type: string
                priority:
                  type: string
                  description: low|medium|high
      x-payment-info:
        protocols:
        - x402
        price:
          mode: fixed
          currency: USD
          amount: '0.005'
      security:
      - x402Payment: []
      operationId: postTollFeesEstimate
      x-operation-id-source: derived
  /toll/fees/optimize:
    post:
      tags:
      - Fee Oracle
      summary: Return an unsigned, fee-optimized version of a transaction
      responses:
        '200':
          description: Success. Response shape is documented in the service catalog (GET /health on the service).
          content:
            application/json:
              example:
                optimized_transaction_base64: AAEAAgQHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADBkZv5SEXMv/srbpyw5vnvIzlu8X3EmssQ5s6QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwMABQIcAgAAAwAJAygjAAAAAAAAAgIAAQwCAAAAQEIPAAAAAAA=
                unsigned: true
                signing_note: This transaction is UNSIGNED (signature count = 0). Sign it with your keypair before submitting. We never touch private keys.
                compute_units_consumed: 450
                compute_units_recommended: 540
                micro_lamports: 9000
                priority: medium
                original_fee_lamports: 17600
                optimized_fee_lamports: 5005
                savings_pct: 71.56
                saved_lamports: 12595
                confidence: high
                baseline:
                  cu_limit: 1400000
                  micro_lamports: 9000
                  had_compute_budget_ix: false
                inputs_summary:
                  sources:
                  - solana-rpc:simulateTransaction
                  - solana-rpc:getRecentPrioritizationFees
                  sample_size: 3
                envelope:
                  v: 1
                  service: fee-oracle
                  source: solana-rpc
                  grade: derived
                  max_age_seconds: 10
                  changes:
                    supported: false
        '402':
          description: 'Payment Required (x402). The PAYMENT-REQUIRED response header carries the x402 v2 PaymentRequired object (base64 JSON: scheme, CAIP-2 network, amount, asset, payTo, plus the bazaar discovery extension); the response body carries the same challenge in x402 v1 form for compatibility, naming the SOL recipient and USDC token account on Solana plus a fresh memo. To pay on this service''s rail: pay with the memo attached (Solana Memo program), then retry with header ''X-Payment-Tx: <transaction signature>'' and query parameter ''toll_memo=<memo>''.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                transaction_base64:
                  type: string
                  description: string
                priority:
                  type: string
                  description: low|medium|high
      x-payment-info:
        protocols:
        - x402
        price:
          mode: fixed
          currency: USD
          amount: '0.005'
      security:
      - x402Payment: []
      operationId: postTollFeesOptimize
      x-operation-id-source: derived
  /toll/fees/fees:
    get:
      tags:
      - Fee Oracle
      summary: Current network fee percentiles (free)
      responses:
        '200':
          description: Success. Response shape is documented in the service catalog (GET /health on the service).
      security: []
      operationId: getTollFeesFees
      x-operation-id-source: derived
  /toll/fees/health:
    get:
      tags:
      - Fee Oracle
      summary: Upstream RPC status, latency, toll schedule
      responses:
        '200':
          description: Success. Response shape is documented in the service catalog (GET /health on the service).
      security: []
      operationId: getTollFeesHealth
      x-operation-id-source: derived
  /toll/fees/recipe:
    post:
      tags:
      - Fee Oracle
      summary: Fuse fee estimate + optimize into one recipe
      responses:
        '200':
          description: Success. Response shape is documented in the service catalog (GET /health on the service).
          content:
            application/json:
              example:
                cap: null
                cap_exceeded: false
                confidence: high
                cu_limit: 540
                escalation_ladder:
                  ceiling: null
                  rungs:
                  - after_seconds: 0
                    lamports: 5
                    micro_lamports: 9000
                    percentile: p75
                  - after_seconds: 30
                    lamports: 5
                    micro_lamports: 9000
                    percentile: p95
                  - after_seconds: 90
                    lamports: 5
                    micro_lamports: 9000
                    percentile: p99
                expected_total_fee:
                  lamports: 5005
                  sol: 5.005e-06
                fee_tiers:
                - chosen: false
                  micro_lamports: 5000
                  percentile: p50
                  priority_fee_lamports: 3
                  total_fee_lamports: 5003
                  urgency: economy
                - chosen: true
                  micro_lamports: 9000
                  percentile: p75
                  priority_fee_lamports: 5
                  total_fee_lamports: 5005
                  urgency: balanced
                - chosen: false
                  micro_lamports: 9000
                  percentile: p95
                  priority_fee_lamports: 5
                  total_fee_lamports: 5005
                  urgency: fast
                rewritten_tx: AA...
                urgency: balanced
        '402':
          description: 'Payment Required (x402). The PAYMENT-REQUIRED response header carries the x402 v2 PaymentRequired object (base64 JSON: scheme, CAIP-2 network, amount, asset, payTo, plus the bazaar discovery extension); the response body carries the same challenge in x402 v1 form for compatibility, naming the SOL recipient and USDC token account on Solana plus a fresh memo. To pay on this service''s rail: pay with the memo attached (Solana Memo program), then retry with header ''X-Payment-Tx: <transaction signature>'' and query parameter ''toll_memo=<memo>''.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fee_cap_lamports:
                  type: integer
                  description: integer - Optional max total fee in lamports. If the chosen tier's expected total fee exceeds it, the answer carries cap_exceeded:true and rewritten_tx:null — never an over-cap transaction.
                transaction_base64:
                  type: string
                  description: string (required) - Unsigned Solana transaction, base64 (same field as /estimate and /optimize). Required.
                urgency:
                  type: string
                  description: string - economy=p50, balanced=p75, fast=p95 priority-fee percentile; selects the tier baked into rewritten_tx.
              required:
              - transaction_base64
      x-payment-info:
        protocols:
        - x402
        price:
          mode: fixed
          currency: USD
          amount: '0.01'
      security:
      - x402Payment: []
      operationId: postTollFeesRecipe
      x-operation-id-source: derived
  /toll/fees/recipe/preflight:
    post:
      tags:
      - Fee Oracle
      summary: 'Free pre-check twin: exact $0.01 price first'
      responses:
        '200':
          description: Success. Response shape is documented in the service catalog (GET /health on the service).
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fee_cap_lamports:
                  type: integer
                  description: integer - Optional max total fee in lamports. If the chosen tier's expected total fee exceeds it, the answer carries cap_exceeded:true and rewritten_tx:null — never an over-cap transaction.
                transaction_base64:
                  type: string
                  description: string (required) - Unsigned Solana transaction, base64 (same field as /estimate and /optimize). Required.
                urgency:
                  type: string
                  description: string - economy=p50, balanced=p75, fast=p95 priority-fee percentile; selects the tier baked into rewritten_tx.
              required:
              - transaction_base64
      security: []
      operationId: postTollFeesRecipePreflight
      x-operation-id-source: derived
components:
  securitySchemes:
    x402Payment:
      type: apiKey
      in: header
      name: X-Payment-Tx
      description: 'x402 toll payment proof: the Solana transaction signature of a payment carrying the memo from the 402 challenge; send together with ?toll_memo=<memo>. Payment itself is made on-chain in SOL or USDC to the recipient named in the challenge.'