Create a quote
curl --request POST \
--url https://godirekt.xyz/api/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"fromChainId": 8453,
"toChainId": 56,
"fromToken": "0x0000000000000000000000000000000000000000",
"toToken": "0x0000000000000000000000000000000000000000",
"amount": "1",
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec"
}
'import requests
url = "https://godirekt.xyz/api/quote"
payload = {
"fromChainId": 8453,
"toChainId": 56,
"fromToken": "0x0000000000000000000000000000000000000000",
"toToken": "0x0000000000000000000000000000000000000000",
"amount": "1",
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromChainId: 8453,
toChainId: 56,
fromToken: '0x0000000000000000000000000000000000000000',
toToken: '0x0000000000000000000000000000000000000000',
amount: '1',
recipient: '0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec'
})
};
fetch('https://godirekt.xyz/api/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://godirekt.xyz/api/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fromChainId' => 8453,
'toChainId' => 56,
'fromToken' => '0x0000000000000000000000000000000000000000',
'toToken' => '0x0000000000000000000000000000000000000000',
'amount' => '1',
'recipient' => '0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://godirekt.xyz/api/quote"
payload := strings.NewReader("{\n \"fromChainId\": 8453,\n \"toChainId\": 56,\n \"fromToken\": \"0x0000000000000000000000000000000000000000\",\n \"toToken\": \"0x0000000000000000000000000000000000000000\",\n \"amount\": \"1\",\n \"recipient\": \"0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://godirekt.xyz/api/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fromChainId\": 8453,\n \"toChainId\": 56,\n \"fromToken\": \"0x0000000000000000000000000000000000000000\",\n \"toToken\": \"0x0000000000000000000000000000000000000000\",\n \"amount\": \"1\",\n \"recipient\": \"0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://godirekt.xyz/api/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fromChainId\": 8453,\n \"toChainId\": 56,\n \"fromToken\": \"0x0000000000000000000000000000000000000000\",\n \"toToken\": \"0x0000000000000000000000000000000000000000\",\n \"amount\": \"1\",\n \"recipient\": \"0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"quoteId": "5af8532c-5bf4-45c2-b099-1b36e96e91a3",
"expiresIn": 300,
"send": {
"depositAddress": "0x7fa491b5765b5eea6b113a9121c311d780f8c61b",
"chain": {
"id": 8453,
"name": "Base"
},
"token": {
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"name": "Ether",
"decimals": 18
},
"amount": "1"
},
"receive": {
"chain": {
"id": 56,
"name": "BNB Chain"
},
"token": {
"address": "0x0000000000000000000000000000000000000000",
"symbol": "BNB",
"name": "Binance Coin",
"decimals": 18
},
"estimatedAmount": "3.119712602260738657",
"estimatedAmountUsd": "1992.034702"
},
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec",
"fees": {
"totalUsd": "13.4972",
"gas": {
"amount": "0.000000144979173281",
"usd": "0.000291",
"currency": "ETH"
},
"relayer": {
"amount": "0.001729747908604578",
"usd": "3.469103",
"currency": "ETH"
},
"app": {
"amount": "0.005",
"usd": "10.027770",
"currency": "ETH"
}
},
"estimatedTime": "1s",
"steps": 1,
"statusUrl": "/api/status/5af8532c-5bf4-45c2-b099-1b36e96e91a3",
"depositNote": "Send exactly this amount to the deposit address. Execution begins automatically."
}Create Quote
Generate a one-time deposit address for a cross-chain payment.
POST
/
api
/
quote
Create a quote
curl --request POST \
--url https://godirekt.xyz/api/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"fromChainId": 8453,
"toChainId": 56,
"fromToken": "0x0000000000000000000000000000000000000000",
"toToken": "0x0000000000000000000000000000000000000000",
"amount": "1",
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec"
}
'import requests
url = "https://godirekt.xyz/api/quote"
payload = {
"fromChainId": 8453,
"toChainId": 56,
"fromToken": "0x0000000000000000000000000000000000000000",
"toToken": "0x0000000000000000000000000000000000000000",
"amount": "1",
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromChainId: 8453,
toChainId: 56,
fromToken: '0x0000000000000000000000000000000000000000',
toToken: '0x0000000000000000000000000000000000000000',
amount: '1',
recipient: '0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec'
})
};
fetch('https://godirekt.xyz/api/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://godirekt.xyz/api/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fromChainId' => 8453,
'toChainId' => 56,
'fromToken' => '0x0000000000000000000000000000000000000000',
'toToken' => '0x0000000000000000000000000000000000000000',
'amount' => '1',
'recipient' => '0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://godirekt.xyz/api/quote"
payload := strings.NewReader("{\n \"fromChainId\": 8453,\n \"toChainId\": 56,\n \"fromToken\": \"0x0000000000000000000000000000000000000000\",\n \"toToken\": \"0x0000000000000000000000000000000000000000\",\n \"amount\": \"1\",\n \"recipient\": \"0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://godirekt.xyz/api/quote")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fromChainId\": 8453,\n \"toChainId\": 56,\n \"fromToken\": \"0x0000000000000000000000000000000000000000\",\n \"toToken\": \"0x0000000000000000000000000000000000000000\",\n \"amount\": \"1\",\n \"recipient\": \"0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://godirekt.xyz/api/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fromChainId\": 8453,\n \"toChainId\": 56,\n \"fromToken\": \"0x0000000000000000000000000000000000000000\",\n \"toToken\": \"0x0000000000000000000000000000000000000000\",\n \"amount\": \"1\",\n \"recipient\": \"0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"quoteId": "5af8532c-5bf4-45c2-b099-1b36e96e91a3",
"expiresIn": 300,
"send": {
"depositAddress": "0x7fa491b5765b5eea6b113a9121c311d780f8c61b",
"chain": {
"id": 8453,
"name": "Base"
},
"token": {
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"name": "Ether",
"decimals": 18
},
"amount": "1"
},
"receive": {
"chain": {
"id": 56,
"name": "BNB Chain"
},
"token": {
"address": "0x0000000000000000000000000000000000000000",
"symbol": "BNB",
"name": "Binance Coin",
"decimals": 18
},
"estimatedAmount": "3.119712602260738657",
"estimatedAmountUsd": "1992.034702"
},
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec",
"fees": {
"totalUsd": "13.4972",
"gas": {
"amount": "0.000000144979173281",
"usd": "0.000291",
"currency": "ETH"
},
"relayer": {
"amount": "0.001729747908604578",
"usd": "3.469103",
"currency": "ETH"
},
"app": {
"amount": "0.005",
"usd": "10.027770",
"currency": "ETH"
}
},
"estimatedTime": "1s",
"steps": 1,
"statusUrl": "/api/status/5af8532c-5bf4-45c2-b099-1b36e96e91a3",
"depositNote": "Send exactly this amount to the deposit address. Execution begins automatically."
}Example request
curl --location 'https://godirekt.xyz/api/quote' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"fromChainId": 8453,
"toChainId": 56,
"fromToken": "0x0000000000000000000000000000000000000000",
"toToken": "0x0000000000000000000000000000000000000000",
"amount": "1",
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec"
}'
Example response
{
"success": true,
"quoteId": "5af8532c-5bf4-45c2-b099-1b36e96e91a3",
"expiresIn": 300,
"send": {
"depositAddress": "0x7fa491b5765b5eea6b113a9121c311d780f8c61b",
"chain": { "id": 8453, "name": "Base" },
"token": {
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"name": "Ether",
"decimals": 18
},
"amount": "1"
},
"receive": {
"chain": { "id": 56, "name": "BNB Chain" },
"token": {
"address": "0x0000000000000000000000000000000000000000",
"symbol": "BNB",
"name": "Binance Coin",
"decimals": 18
},
"estimatedAmount": "3.119712602260738657",
"estimatedAmountUsd": "1992.034702"
},
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec",
"fees": {
"totalUsd": "13.4972",
"gas": { "amount": "0.000000144979173281", "usd": "0.000291", "currency": "ETH" },
"relayer": { "amount": "0.001729747908604578", "usd": "3.469103", "currency": "ETH" },
"app": { "amount": "0.005", "usd": "10.027770", "currency": "ETH" }
},
"estimatedTime": "1s",
"steps": 1,
"statusUrl": "/api/status/5af8532c-5bf4-45c2-b099-1b36e96e91a3",
"depositNote": "Send exactly this amount to the deposit address. Execution begins automatically."
}
Response fields
| Field | Description |
|---|---|
quoteId | Use this to poll /api/status/:id |
expiresIn | Seconds before the quote expires (300 = 5 mins) |
send.depositAddress | Address the user must send funds to |
send.amount | Exact amount to send |
receive.estimatedAmount | Estimated tokens the recipient gets |
receive.estimatedAmountUsd | USD value of received amount |
fees.totalUsd | Total fees in USD |
statusUrl | Shorthand URL to check payment status |
depositNote | Human-readable instruction to show the user |
Example request
curl --location 'https://godirekt.xyz/api/quote' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"fromChainId": 8453,
"toChainId": 56,
"fromToken": "0x0000000000000000000000000000000000000000",
"toToken": "0x0000000000000000000000000000000000000000",
"amount": "1",
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec"
}'
Example response
{
"success": true,
"quoteId": "5af8532c-5bf4-45c2-b099-1b36e96e91a3",
"expiresIn": 300,
"send": {
"depositAddress": "0x7fa491b5765b5eea6b113a9121c311d780f8c61b",
"chain": { "id": 8453, "name": "Base" },
"token": {
"address": "0x0000000000000000000000000000000000000000",
"symbol": "ETH",
"name": "Ether",
"decimals": 18
},
"amount": "1"
},
"receive": {
"chain": { "id": 56, "name": "BNB Chain" },
"token": {
"address": "0x0000000000000000000000000000000000000000",
"symbol": "BNB",
"name": "Binance Coin",
"decimals": 18
},
"estimatedAmount": "3.119712602260738657",
"estimatedAmountUsd": "1992.034702"
},
"recipient": "0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec",
"fees": {
"totalUsd": "13.4972",
"gas": { "amount": "0.000000144979173281", "usd": "0.000291", "currency": "ETH" },
"relayer": { "amount": "0.001729747908604578", "usd": "3.469103", "currency": "ETH" },
"app": { "amount": "0.005", "usd": "10.027770", "currency": "ETH" }
},
"estimatedTime": "1s",
"steps": 1,
"statusUrl": "/api/status/5af8532c-5bf4-45c2-b099-1b36e96e91a3",
"depositNote": "Send exactly this amount to the deposit address. Execution begins automatically."
}
Response fields
| Field | Description |
|---|---|
quoteId | Use this to poll /api/status/:id |
expiresIn | Seconds before the quote expires (300 = 5 mins) |
send.depositAddress | Address the user must send funds to |
send.amount | Exact amount to send |
receive.estimatedAmount | Estimated tokens the recipient gets |
receive.estimatedAmountUsd | USD value of received amount |
fees.totalUsd | Total fees in USD |
statusUrl | Shorthand URL to check payment status |
depositNote | Human-readable instruction to show the user |
Authorizations
Body
application/json
Source chain ID
Example:
8453
Destination chain ID
Example:
56
Token address on source chain. Use 0x000...000 for native token.
Example:
"0x0000000000000000000000000000000000000000"
Token address on destination chain. Use 0x000...000 for native token.
Example:
"0x0000000000000000000000000000000000000000"
Amount in human-readable units
Example:
"1"
Wallet address to receive funds on destination chain
Example:
"0xa110c77fa4b07ab601e63ecd65e99ddb8f1df6ec"
⌘I