Gelato
  • Introduction
    • Gelato, The Web3 Cloud Platform
  • Smart Wallets
    • Introduction
      • Understanding EIP-7702
      • Understanding ERC-4337
      • ERC-4337 vs EIP-7702
    • Templates & Examples
    • How-To Guides
      • Create a Sponsor API Key
      • Sponsor gas for your users
      • Allow users to pay gas with erc20
      • Allow users to pay gas with native
      • Create Dynamic's Environment Id
      • Use Dynamic/Privy signers with React SDK
      • Estimate Gas for your transactions
    • React SDK
    • Demo
    • Supported Networks
  • Rollup As A Service
    • Introduction
    • Rollup Stacks
      • Arbitrum Orbit
        • Run a Full Orbit Node
      • OP Stack
        • Run OP Node
    • Deploy your Rollup
    • Customization
      • Data Availability
        • Celestia
        • Avail
        • Eigen DA
      • Custom Gas Token
      • Marketplace
        • Gelato Services
        • Data Indexers
        • Block Explorers
        • Oracles
        • Bridges
        • Account Abstraction
        • On & Off-ramp
        • Community
        • Identity & KYC
        • Others
      • Verifier Node Package
    • Public Testnet
  • RPC Nodes
    • Introduction
    • Compute Units
    • Using RPC Nodes
    • Supported Networks
    • Pricing and Plans
    • FAQ
  • Web3 Services
    • Web3 Functions
      • Understanding Web3 Functions
        • Trigger Types
        • Typescript Function
        • Solidity Function
        • Automated Transactions
      • Security Considerations
      • Template & Use Cases
      • Quick Start
        • Writing Typescript Functions
          • Event Trigger
          • Private Typescript Functions
          • Callbacks
        • Test, Deploy & Run Typescript functions
        • Writing Solidity Functions
        • Test, Deploy & Run Solidity Functions
        • Initiate an Automated Transaction
      • Create a Web3 Function Task
        • Using the UI
        • Using the Safe App
        • Using a Smart Contract
        • Using the Automate SDK
      • Analytics & Monitoring
      • Supported Networks
      • Subscription & Payments
      • Legacy Automate Migration Guide
    • Relay
      • What is Relaying?
      • Security Considerations
        • ERC-2771 Delegatecall Vulnerability
      • Templates
      • Quick Start
        • Sponsored Calls
        • Non-Sponsored Calls
      • ERC-2771 (recommended)
        • SponsoredCallERC2771
        • CallWithSyncFeeERC2771
          • Relay Context Contracts ERC2771
      • Non-ERC-2771
        • SponsoredCall
        • CallWithSyncFee
          • Relay Context Contracts
      • Relay API
      • Gelato's Fee Oracle
      • Tracking your Relay Request
      • Supported Networks
      • Subscriptions and Payments
        • 1Balance & Relay
        • SyncFee Payment Tokens
        • Relay Pricing
      • ERC2771 Migration Guide
    • VRF
      • Understanding VRF
      • How does Gelato VRF Work?
      • Security Considerations
      • Template
      • Quick Start
      • Create a VRF Task
        • Create a Fallback VRF
        • Migrating from Chainlink VRF
      • Supported Networks
      • Pricing & Rate Limits
    • Oracles
      • Understanding Gelato Oracles
      • Quick Start
      • Data Providers
        • Stork
        • Choas Labs
      • Migrating from Chainlink Oracles
      • Available Price Feeds
      • Supported Networks
      • Pricing & Rate Limits
    • Account Abstraction
      • Understanding ERC-4337
      • Introduction to Gelato Bundler
      • Templates & Examples
      • Quick Start
      • Supported Networks
      • Bundler API Endpoints
        • eth_sendUserOperation
        • eth_estimateUserOperationGas
        • eth_getUserOperationByHash
        • eth_getUserOperationReceipt
        • eth_supportedEntryPoints
        • eth_maxPriorityFeePerGas
        • eth_chainId
    • 1Balance
      • 1Balance Alerts
      • Subscription Plans
      • Subscription Notifications
      • USDC Addresses
    • AI Agents
    • Teams
  • GELATO DAO
    • DAO & Token (GEL)
    • GEL Token Contracts
    • Governance Process
  • Social Media
Powered by GitBook
On this page
  1. Web3 Services
  2. Relay

Relay API

How to communicate directly with the Gelato Relay API

PreviousRelay Context ContractsNextGelato's Fee Oracle

Last updated 1 month ago

The Gelato Relay API endpoint URL is https://api.gelato.digital/

The Swagger UI is located at

Oracle queries

Relay Endpoints

Informational

Sending Relay Requests:

Each relay request method possesses optional parameters such as the gasLimit , and retries.

Task Tracking

Debug Endpoint

How to use it with Tenderly

If you'd like to use the debug endpoint with tenderly, you can make use of the debug endpoint and by adding the following parameters

  • tenderlyUsername

  • tenderlyProjectName

the request URL should look like this: https://api.gelato.digital/tasks/status/{yourRelayTaskId}/debug?tenderlyUsername={yourUserName}&tenderlyProjectName={yourProjectName}

Everything will already be pre-set, all you need to do is click on "Simulate" and check what might have been the point of failure:

What to do if the calldata is too big?

In this case you would have to manually copy and paste the to, from, callData, blockNumber etc into the Tenderly UI or Foundry

/call-with-sync-fee/: for more information, please click .

/call-with-sync-fee-erc2771/: for more information, please click .

/sponsored-call/: for more information, please click .

/sponsored-call-erc2771/: for more information, please click .

If the calldata is too big which may result in the following error upon clicking on the url returned by the api response:

here
here
here
here
https://api.gelato.digital/api-docs

Get the estimated fee in payment token with respect to the gas limit and priority

get
Path parameters
chainIdnumberRequired

Id of the chain where the fee is estimated

Query parameters
paymentTokenstringRequired

Payment Token

gasLimitnumberRequired

Gas limit

isHighPrioritybooleanRequired

Priority | if high: true, otherwise: false

gasLimitL1numberOptional

Gas limit for Layer 1 | For OP stack chains input BigInt(0)

Responses
200
Successful Retrieval
application/json
404
Oracle Not Found
get
GET /oracles/{chainId}/estimate?paymentToken=text&gasLimit=1&isHighPriority=true HTTP/1.1
Host: 
Accept: */*
{
  "estimatedFee": "text",
  "decimals": 1
}

Retrieve debug information for a specific task

get
Path parameters
taskIdstringRequired

The ID of the task to retrieve debug information for.

Query parameters
tenderlyUsernamestringRequired

Username for Tenderly account.

tenderlyProjectNamestringRequired

Project name on Tenderly.

Responses
200
Successful response with debug information.
application/json
400
Bad request if the task ID or parameters are missing or incorrect.
404
Not found if the task ID does not exist.
get
GET /tasks/status/{taskId}/debug HTTP/1.1
Host: api.gelato.digital
Accept: */*
{
  "data": {
    "to": "text",
    "from": "text",
    "calldata": "text",
    "blockNumber": 1,
    "gasLimit": 1,
    "chainId": 1,
    "taskId": "text"
  },
  "debugger": {
    "tenderly": "text"
  }
}

Get list of chains where the oracle is available

get
Responses
200
Successful Retrieval
application/json
get
GET /oracles HTTP/1.1
Host: 
Accept: */*
200

Successful Retrieval

{
  "oracles": [
    "text"
  ]
}

Get all the payment tokens on a chain

get
Path parameters
chainIdnumberRequired

Id of the chain where payments tokens are retrieved

Responses
200
Successful Retrieval
application/json
404
Oracle Not Found
get
GET /oracles/{chainId}/paymentTokens HTTP/1.1
Host: 
Accept: */*
{
  "paymentTokens": [
    "text"
  ]
}

Get the conversion rate from the native token to the requested token

get
Path parameters
chainIdnumberRequired

Id of the chain where the conversion rate is estimated

Query parameters
tostringOptional

Token in which the conversion rate is estimated from the native token of the selected chain. If a value is not provided, it will default to the USDC address on the selected chain

Responses
200
Successful Conversion Rate Response
application/json
400
Bad Request
404
Oracle Not Found
get
GET /oracles/{chainId}/conversionRate HTTP/1.1
Host: 
Accept: */*
{
  "chainId": "text",
  "from": "text",
  "to": "text",
  "conversionRate": 1,
  "details": {
    "numerator": "text",
    "denominator": "text"
  }
}

Get list of chains where relay v2 is available

get
Responses
200
Successful Retrieval
application/json
get
GET /relays/v2 HTTP/1.1
Host: 
Accept: */*
200

Successful Retrieval

{
  "relays": [
    "text"
  ]
}

Get task status of the relay v2 task id

get
Path parameters
taskIdstringRequired

Id of the task whose status is retrieved

Responses
200
Successful Retrieval
application/json
404
Status Not Found
500
Service Not Available
get
GET /tasks/status/{taskId} HTTP/1.1
Host: 
Accept: */*
{
  "task": {
    "chainId": 1,
    "taskId": "text",
    "taskState": "CheckPending",
    "creationDate": "text",
    "lastCheckDate": "text",
    "lastCheckMessage": "text",
    "transactionHash": "text",
    "executionDate": "text",
    "blockNumber": 1
  }
}
  • Oracle queries
  • GETGet list of chains where the oracle is available
  • GETGet the estimated fee in payment token with respect to the gas limit and priority
  • GETGet all the payment tokens on a chain
  • GETGet the conversion rate from the native token to the requested token
  • Relay Endpoints
  • GETGet list of chains where relay v2 is available
  • POSTPlace a relay v2 callWithSyncFee request
  • POSTPlace a relay v2 callWithSyncFeeERC2771 request
  • POSTPlace a relay v2 sponsoredCall request
  • POSTPlace a relay v2 sponsoredCallERC2771 request
  • Task Tracking
  • GETGet task status of the relay v2 task id
  • Debug Endpoint
  • GETRetrieve debug information for a specific task
  • How to use it with Tenderly

Place a relay v2 callWithSyncFee request

post

Please find more information here: https://docs.gelato.network/developer-products/gelato-relay-sdk/sdk-methods/relaywithsyncfee

Body
chainIdnumberRequired
targetstringRequired
datastringRequired
feeTokenstringRequired
sponsorApiKeystringOptional
gasLimitstringOptional
retriesnumberOptional
Responses
201
Successfully placed a callWithSyncFee request
application/json
400
Validation Error
404
Service Not Found
post
POST /relays/v2/call-with-sync-fee HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 114

{
  "chainId": 1,
  "target": "text",
  "data": "text",
  "feeToken": "text",
  "sponsorApiKey": "text",
  "gasLimit": "text",
  "retries": 1
}
{
  "taskId": "text"
}

Place a relay v2 callWithSyncFeeERC2771 request

post

Please find more information here: https://docs.gelato.network/developer-products/gelato-relay-sdk/sdk-methods/relaywithsyncfeeERC2771

Body
chainIdnumberRequired
targetstringRequired
datastringRequired
userstringRequired
userNoncenumberRequired
userDeadlinenumberRequired
userSignaturestringRequired
feeTokenstringRequired
isRelayContextbooleanOptional
sponsorApiKeystringOptional
gasLimitstringOptional
retriesnumberOptional
Responses
201
Successfully placed a callWithSyncFeeERC2771 request
application/json
400
Validation Error
404
Service Not Found
post
POST /relays/v2/call-with-sync-fee-erc2771 HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 204

{
  "chainId": 1,
  "target": "text",
  "data": "text",
  "user": "text",
  "userNonce": 1,
  "userDeadline": 1,
  "userSignature": "text",
  "feeToken": "text",
  "isRelayContext": true,
  "sponsorApiKey": "text",
  "gasLimit": "text",
  "retries": 1
}
{
  "taskId": "text"
}

Place a relay v2 sponsoredCall request

post

Please find more information here: https://docs.gelato.network/developer-products/gelato-relay-sdk/sdk-methods/relaywithsponsoredcall

Body
chainIdnumberRequired
targetstringRequired
datastringRequired
sponsorApiKeystringRequired
gasLimitstringOptional
retriesnumberOptional
Responses
201
Successfully placed a sponsoredCall relay request
application/json
400
Validation Error
404
Service Not Found
post
POST /relays/v2/sponsored-call HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 96

{
  "chainId": 1,
  "target": "text",
  "data": "text",
  "sponsorApiKey": "text",
  "gasLimit": "text",
  "retries": 1
}
{
  "taskId": "text"
}

Place a relay v2 sponsoredCallERC2771 request

post

Please find more information here: https://docs.gelato.network/developer-products/gelato-relay-sdk/sdk-methods/relaywithsponsoreduserauthcall

Body
chainIdnumberRequired
targetstringRequired
datastringRequired
userstringRequired
userNoncenumberRequired
userDeadlinenumberRequired
userSignaturestringRequired
sponsorApiKeystringRequired
gasLimitstringOptional
retriesnumberOptional
Responses
201
Successfully placed a sponsoredCallERC2771 relay request
application/json
400
Validation Error
404
Service Not Found
post
POST /relays/v2/sponsored-call-erc2771 HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 164

{
  "chainId": 1,
  "target": "text",
  "data": "text",
  "user": "text",
  "userNonce": 1,
  "userDeadline": 1,
  "userSignature": "text",
  "sponsorApiKey": "text",
  "gasLimit": "text",
  "retries": 1
}
{
  "taskId": "text"
}