Skip to main content

Overview

You’ll find API endpoints and key usage notes below. If you ever need help you can reach out to us.

Use Cases

Shinami’s Gas Station API lets you easily sponsor transactions for your users. APT is pulled from a fund you create to power these transactions, managed in Shinami’s dashboard. Shinami facilitates sponsored transactions based on logic determined by you, the app developer. Examples include sponsoring each user’s initial transaction(s) for better onboarding and sponsoring transactions of a particular type that you want to encourage.

Authentication, Rate Limits, and Error Handling

Authentication You authenticate via an access key passed in a header "X-Api-Key: ACCESS_KEY") or in the request url (https://api.us1.shinami.com/aptos/gas/v1/ACCESS_KEY). We recommend using a request header and not putting access keys in your request URLs for reduced visibility (in logs, etc). These steps are done automatically by our TypeScript SDK. See our Authentication and API Keys guide for how to set up a Gas-Station access key.
Call Shinami’s Gas Station from your backend serverShinami Gas Station does not support CORS requests, so you will get a CORS error if you make requests from your frontend. Use your backend server to integrate with Shinami’s Gas Station. This limits exposure of your sponsorship access keys. If these keys are leaked, bad actors have the ability to sponsor transactions from your fund until it has been drained or you disable the key in our dashboard.For a tutorial on how to combine frontend signing with backend sponsorship, see our Frontend signing + backend sponsorship tutorial.
Rate Limits When you surpass the QPS limit for a key, we return a JSON-RPC error code -32010. We recommend implementing retries with a backoff to handle any rate limits errors that arise. You can also consider batching multiple Move calls into a Move script. You can also adjust the rate limits of your keys to better balance your QPS allotment across your keys. Error Handling See our Error Reference for guidance on the errors you may receive from our services, including a section on errors specific to the Aptos Gas Station API.

Send your first request

For a quick sample request that doesn’t require building a transaction, ask for the balance of the fund your access key is tied to with gas_getFund.

Tutorials with E2E sample code

Check out our TypeScript tutorial for more code samples and details on the end-to-end flow of creating, sponsoring, and executing a transaction. Also, since our Gas Station does not support CORS (browser) requests for security reasons, our Frontend signing + backend sponsorship tutorial .

Methods

gas_sponsorTransaction

Sponsor a transaction by having your Shinami Gas Station fund act as the feePayer. Important notes
  1. Gas Station doesn’t support CORS, so you must send requests from your backend. For an overview of all the ways to integrate frontend signing with backend sponsorship, see our Frontend Signing + Backend Sponsorship guide, including tips on serializing and deserializing the necessary data types as you pass them between FE and BE.
  2. You need to create a Gas Station fund in your Shinami dashboard before you create an access key. When you create a gas station API access key, you assign it to a network (e.g. Testnet) and a fund on that network. For how to do that and find the deposit address, see our Aptos Gas Station Help Center page.
  3. Shinami sponsorship fees: See our Aptos Billing FAQ.
  4. Orderless transactions: We currently don’t support sponsoring orderless transactions but plan to add this support in the future. If you need this support, please reach out to us at support@shinami.com.
Request Parameters Example Request Template The TypeScript example uses the Shinami Clients SDK, which you can install with:
Replace all instances of {{name}} with the actual value for that name.
Example Response
TypeScript SDK Response Fields
Notes:transaction.feePayerAddress is updated in-place upon a successful return.
cURL Response Fields

gas_sponsorAndSubmitSignedTransaction

This method first sponsors a transaction with your Shinami Gas Station fund and then submits the transaction to an Aptos fullnode for execution. Therefore, you need to obtain all necessary signatures - with wildcard fee payer address 0x0 - before calling this method. Important notes
  1. Gas Station doesn’t support CORS, so you must send requests from your backend. For an overview of all the ways to integrate frontend signing with backend sponsorship, see our Frontend Signing + Backend Sponsorship guide, including tips on serializing and deserializing the necessary data types as you pass them between FE and BE.
  2. You need to create a Gas Station fund in your Shinami dashboard before you create an access key. When you create a gas station API access key, you assign it to a network (e.g. Testnet) and a fund on that network. For how to do that and find the deposit address, see our Aptos Gas Station Help Center page.
  3. Shinami sponsorship fees: See our Aptos Billing FAQ.
  4. Orderless transactions: We currently don’t support sponsoring orderless transactions but plan to add this support in the future. If you need this support, please reach out to us at support@shinami.com.
Request Parameters Example Request Template The TypeScript example uses the Shinami Clients SDK, which you can install with:
Replace all instances of {{name}} with the actual value for that name.
Example Response
Response Fields

gas_getFund

Get the balance for the Gas Station fund tied to the request’s API access key. When you create a Gas Station access key, you link it to exactly one Gas Station fund. So, when you make this request, we return the balance for the fund that’s tied to the access key you use for the request. To check which fund a Gas Station access key is tied too, see the Aptos Gas Station FAQ page of our Help Center Request Parameters None. Example Request Template The TypeScript example uses the Shinami Clients SDK, which you can install with:
Replace all instances of {{name}} with the actual value for that name.
Example Response
Response Fields

gas_encodeAndSponsorTransaction

Sponsors a JSON transaction request by providing fee payer info, and encodes it into message bytes for signing. Intended to be used only by clients without BCS encoding capability. If you’re using the Aptos TypeScript SDK you should use sponsorTransaction instead. The full transaction flow for using this API is as follows:
  1. Construct the transaction JSON.
  2. Call this API to get the encoded message bytes for signing, as well as fee payer address and signature.
  3. Sender (and any secondary signers) sign the message bytes.
  4. Submit the transaction JSON together with all signatures to an Aptos fullnode for execution (an example of this call and response is shown in the cURL - submit sponsored tx example tabs).
Important notes
  1. Gas Station doesn’t support CORS, so you must send requests from your backend. For an overview of all the ways to integrate frontend signing with backend sponsorship, see our Frontend Signing + Backend Sponsorship guide, including tips on serializing and deserializing the necessary data types as you pass them between FE and BE.
  2. You need to create a Gas Station fund in your Shinami dashboard before you create an access key. When you create a gas station API access key, you assign it to a network (e.g. Testnet) and a fund on that network. For how to do that and find the deposit address, see our Aptos Gas Station Help Center page.
  3. Shinami sponsorship fees: See our Aptos Billing FAQ.
Request Parameters Example Request Template Replace all instances of {{name}} with the actual value for that name.
Example Response
Response Fields

Appendix

How to build, sponsor, sign, and submit a transaction

This section shows an example of how to build, sponsor, sign, and submit a simple transaction using the Shinami Clients SDK and the Aptos TS SDK. For a high-level image of the sponsorship flow see here. For multiple end-to-end examples, see our Gas Station TypeScript Tutorial. Key requirements
  1. Build your transaction with the fee payer address set to 0x0 (this is what happens when you set withFeePayer: true as shown below). The sender and any secondary signers can sign the transaction with this address, or with the actual feePayer’s address you obtain from Shinami upon a successful sponsorship.
  2. The transaction’s expiration timestamp must be set to a time within the next hour (as is required by our Gas Station). When you control the generation of the sender’s signature, as with an embedded wallet you control for the user, you can likely use the SDK default, which is 20 seconds from now. When you need to wait on a signature you don’t control, as with a connected wallet where the user must approve a signing message, you can explicitly set it as in the example below.
Replace all instances of {{name}} with the actual value for that name.
Last modified on June 5, 2026