Get Fee
Returns the relay fee amount for the given operation. Withdraw, transfer, and swap all compute this fee automatically, so calling this endpoint first is optional — use it to show the fee to a user before they confirm, or to lock in an exact feeAmount by passing it into the transaction request.
Read-only — requires an active session. Pass sessionId and nonce as query parameters and include x-hinkal-request-signature: secp256k1_sign(SHA256("GET /get-fee\n" + queryString)) in the headers.
Solana-specific parameters:
amounts[]— provide the transaction amounts so the server can calculate the exact nullifier count (used to estimate ATA creation costs).mintFrom— for Solana swap fee estimation, pass the input token address so the server can estimate the OKX Associated Token Account cost.
Session identifier UUID from POST /create-session
ffd74231-0672-48c7-bd82-9f72a803578bPer-request UUID. Echoed back in the response.
3e0c5b91-e133-4aaa-bad1-ade100b3de2aChain ID (e.g. 10 for Optimism, 501 for Solana mainnet)
10Token address used to pay the fee
0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85Token addresses involved in the operation
["0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"]External action id string (e.g. "Transact", "Okx", "Lifi")
Transact(Solana only) Transaction amounts used to calculate nullifier count for accurate fee estimation. Provide the amounts that will be used in the subsequent transaction.
["1000000"](Solana swap only) Input token mint address for OKX ATA cost estimation.
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vHex-encoded compact secp256k1 signature: secp256k1_sign(SHA256(binding + "\n" + payload)), where binding is "<METHOD> <routePath>" (this route's own method and path, e.g. "POST /refresh-cache" or "GET /balance") and payload is JSON.stringify(body) for POST requests or the raw query string for GET requests. Binding the route into the signed digest stops a signature captured for one endpoint from being replayed against another. See Authentication for the full signing scheme.
Fee amount
Validation error
Invalid signature or reused nonce
Server error
GET /get-fee?sessionId=ffd74231-0672-48c7-bd82-9f72a803578b&nonce=3e0c5b91-e133-4aaa-bad1-ade100b3de2a&chainId=10&feeToken=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85&tokenAddresses=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85&externalActionId=Transact HTTP/1.1
Host: api.hinkal.io
x-hinkal-request-signature: text
Accept: */*
{
"success": true,
"feeAmount": "1000",
"nonce": "3e0c5b91-e133-4aaa-bad1-ade100b3de2a"
}Last updated

