AddGasSponsor
curl --request POST \
--url https://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"projectId": 123,
"address": "<string>",
"name": "<string>",
"active": true
}
'import requests
url = "https://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor"
payload = {
"projectId": 123,
"address": "<string>",
"name": "<string>",
"active": True
}
headers = {
"X-Access-Key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Access-Key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({projectId: 123, address: '<string>', name: '<string>', active: true})
};
fetch('https://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor', 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://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor",
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([
'projectId' => 123,
'address' => '<string>',
'name' => '<string>',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Access-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://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor"
payload := strings.NewReader("{\n \"projectId\": 123,\n \"address\": \"<string>\",\n \"name\": \"<string>\",\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor")
.header("X-Access-Key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": 123,\n \"address\": \"<string>\",\n \"name\": \"<string>\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": 123,\n \"address\": \"<string>\",\n \"name\": \"<string>\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"gasSponsor": {
"id": 123,
"gasTankId": 123,
"projectId": 123,
"chainId": 123,
"address": "<string>",
"name": "<string>",
"active": true,
"updatedAt": "<string>",
"createdAt": "<string>",
"deletedAt": "<string>"
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Endpoints
AddGasSponsor
POST
/
rpc
/
Relayer
/
AddGasSponsor
AddGasSponsor
curl --request POST \
--url https://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"projectId": 123,
"address": "<string>",
"name": "<string>",
"active": true
}
'import requests
url = "https://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor"
payload = {
"projectId": 123,
"address": "<string>",
"name": "<string>",
"active": True
}
headers = {
"X-Access-Key": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Access-Key': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({projectId: 123, address: '<string>', name: '<string>', active: true})
};
fetch('https://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor', 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://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor",
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([
'projectId' => 123,
'address' => '<string>',
'name' => '<string>',
'active' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Access-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://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor"
payload := strings.NewReader("{\n \"projectId\": 123,\n \"address\": \"<string>\",\n \"name\": \"<string>\",\n \"active\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-Key", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")
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://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor")
.header("X-Access-Key", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": 123,\n \"address\": \"<string>\",\n \"name\": \"<string>\",\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://amoy-relayer.sequence.app/rpc/Relayer/AddGasSponsor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Access-Key"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": 123,\n \"address\": \"<string>\",\n \"name\": \"<string>\",\n \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"gasSponsor": {
"id": 123,
"gasTankId": 123,
"projectId": 123,
"chainId": 123,
"address": "<string>",
"name": "<string>",
"active": true,
"updatedAt": "<string>",
"createdAt": "<string>",
"deletedAt": "<string>"
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
AddGasSponsor registers a new gas sponsor for your project on the Relayer’s chain. Once a sponsor is active, the Transactions API relays matching transactions from your users without charging them gas — the cost is drawn from your project’s gas tank balance.
You can sponsor:
- A wallet address — any transaction sent from that wallet on this chain is sponsored.
- A contract address — any user’s interaction with that contract on this chain is sponsored.
- An arbitrary address — native-token transfers to that address are sponsored.
Authentication
AddGasSponsor is a privileged write endpoint. Every request must include both headers:
| Header | Value | Where to find it |
|---|---|---|
X-Access-Key | Public API Access Key | Sequence Builder → Settings → API Keys → Public API Access Keys |
Authorization | Bearer <admin-api-secret-key> | Sequence Builder → Settings → API Keys → Admin API Secret Keys |
403 PermissionDenied. Sending only the secret key returns 401 AccessKeyNotFound. Both keys must be present.
The Admin API Secret Key is a privileged JWT credential. Only use it from a trusted backend — never expose it in a browser, mobile app, or public repository.
You have no API Keys), create the missing key with + Add Public API Access Key or + Add Admin API Secret Key before calling this endpoint.
Endpoint URL
AddGasSponsor is exposed on each network’s Relayer host. Use the host matching the chain you want to sponsor on — for example:
- Base mainnet:
https://base-relayer.sequence.app/rpc/Relayer/AddGasSponsor - Polygon mainnet:
https://polygon-relayer.sequence.app/rpc/Relayer/AddGasSponsor - Arbitrum mainnet:
https://arbitrum-relayer.sequence.app/rpc/Relayer/AddGasSponsor
Example request
cURL
curl -X POST https://base-relayer.sequence.app/rpc/Relayer/AddGasSponsor \
-H "Content-Type: application/json" \
-H "X-Access-Key: $SEQUENCE_ACCESS_KEY" \
-H "Authorization: Bearer $SEQUENCE_ADMIN_SECRET_KEY" \
-d '{
"projectId": 43551,
"address": "0xYourContractOrWalletAddress",
"name": "Free mint contract",
"active": true
}'
Common errors
| Status | error | Meaning |
|---|---|---|
401 | AccessKeyNotFound | The X-Access-Key header is missing or does not match a Public API Access Key on this project. |
403 | PermissionDenied | The request is missing the Admin API Secret Key, or the key does not have write permission for this project. |
400 | InvalidArgument | projectId or address is missing or malformed. |
Authorizations
Public project access key for authenticating requests obtained on Sequence Builder. Example Test Key: AQAAAAAAAEGvyZiWA9FMslYeG_yayXaHnSI
Secret JWT token for authenticating requests obtained from Sequence Builder - should not be exposed publicly.
Was this page helpful?