{"openapi":"3.1.0","info":{"title":"Sunrise API","description":"Authenticated API for Sunrise.","version":"1.0.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}],"paths":{"/v1/tokens":{"get":{"operationId":"getTokens","tags":["Tokens"],"summary":"List tokens","description":"Returns Sunrise-supported tokens on Solana.","responses":{"200":{"description":"Sunrise-supported tokens.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[true],"type":"boolean"},"data":{"type":"object","properties":{"count":{"type":"integer","minimum":0,"description":"Number of tokens in this response."},"tokens":{"type":"array","items":{"type":"object","properties":{"chain":{"type":"string","description":"Blockchain where the token is issued."},"address":{"type":"string","description":"Solana mint address."},"symbol":{"type":"string","description":"Token ticker symbol."},"name":{"type":"string","description":"Display name of the token."},"decimals":{"type":"integer","minimum":0,"description":"Number of decimal places used by the token."},"platform":{"type":"string","description":"Platform associated with the token."},"assetClass":{"type":"string","description":"Asset classification of the token."},"issuer":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Issuer associated with the token, when available."},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Token icon URL, when available."},"tokenProgram":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Solana token program address, when available."}},"required":["chain","address","symbol","name","decimals","platform","assetClass","issuer","icon","tokenProgram"]},"description":"Sunrise tokens."},"pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"description":"Maximum number of tokens returned per page."},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for the next page, or null when no page remains."}},"required":["limit","nextCursor"]}},"required":["count","tokens"]},"timestamp":{"type":"string"}},"required":["success","data","timestamp"]}}}},"400":{"description":"Invalid query parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"429":{"description":"Rate limited: verification_rate_limited means the local verification budget was exceeded; rate_limited means Unkey quota or upstream throttling.","headers":{"X-Sunrise-RateLimit-Scope":{"description":"Local per-key verification budget exceeded; back off requests for this key.","schema":{"type":"string","enum":["key"]}},"Retry-After":{"description":"Seconds to wait; present for local verification throttling.","schema":{"type":"integer","example":60}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"enum":["verification_rate_limited","rate_limited"],"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"502":{"description":"Token service unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"default":{"description":"Token service error.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}}},"parameters":[{"in":"query","name":"issuer","schema":{"type":"string"},"description":"Exact token issuer ID. Currently supported: backpack_securities. Unsupported issuers return 400. Keep unchanged across pages."},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1,"maxLength":2048,"pattern":"^[A-Za-z0-9_-]+$"},"description":"Cursor returned by the previous page."}],"x-required-permission":"tokens.public.read","x-required-permissions":["api.access","tokens.public.read"]}},"/v1/quotes":{"post":{"operationId":"getQuotes","tags":["Quotes"],"summary":"Get quotes","description":"Returns pricing quotes. Include wallet addresses to receive an unsigned transaction for execution.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"fromToken":{"type":"string","minLength":1,"description":"Input token mint address."},"toToken":{"type":"string","minLength":1,"description":"Output token mint address."},"fromAddress":{"type":"string","minLength":1,"description":"Wallet address sending the input token."},"toAddress":{"type":"string","minLength":1,"description":"Wallet address receiving the output token."},"fromAmount":{"type":"string","minLength":1,"description":"Input amount in the token's base units."}},"required":["fromToken","toToken","fromAmount"],"additionalProperties":false}}},"description":"Quote parameters.","required":true},"responses":{"200":{"description":"Available quotes from the supported routes.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[true],"type":"boolean"},"data":{"type":"object","properties":{"quotes":{"type":"array","items":{"type":"object","properties":{"quoteId":{"type":"string","minLength":1,"description":"Identifier to pass when executing the quote."},"routeName":{"type":"string","minLength":1,"description":"Liquidity route used by the quote."},"providerRequestId":{"type":"string","minLength":1,"description":"Provider request identifier to echo when executing."},"unsignedTransaction":{"type":"string","minLength":1,"description":"Base64-encoded Solana transaction to sign, when wallet addresses are provided."},"fromToken":{"type":"string","minLength":1,"description":"Input token mint address."},"toToken":{"type":"string","minLength":1,"description":"Output token mint address."},"fromAmount":{"type":"string","description":"Input amount in the token's base units."},"fromAmountUSD":{"type":"number","description":"Estimated USD value of the input."},"toAmount":{"type":"string","description":"Estimated output amount in the token's base units."},"toAmountUSD":{"type":"number","description":"Estimated USD value of the output."},"slippageBps":{"type":"integer","description":"Estimated slippage in basis points."}},"required":["quoteId","routeName","fromToken","toToken","fromAmount","toAmount"]},"description":"Available swap quotes."}},"required":["quotes"]},"timestamp":{"type":"string"}},"required":["success","data","timestamp"]}}}},"400":{"description":"Invalid quote request.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"403":{"description":"Quote request blocked by Sunrise policy.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"413":{"description":"Quote request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"429":{"description":"Rate limited: verification_rate_limited means the local verification budget was exceeded; rate_limited means Unkey quota or upstream throttling.","headers":{"X-Sunrise-RateLimit-Scope":{"description":"Local per-key verification budget exceeded; back off requests for this key.","schema":{"type":"string","enum":["key"]}},"Retry-After":{"description":"Seconds to wait; present for local verification throttling.","schema":{"type":"integer","example":60}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"enum":["verification_rate_limited","rate_limited"],"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"502":{"description":"Sunrise unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"default":{"description":"Sunrise quote error.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}}},"x-required-permission":"quotes.read","x-required-permissions":["api.access","quotes.read"]}},"/v1/execute":{"post":{"operationId":"executeQuote","tags":["Execution"],"summary":"Execute quote","description":"Submits a signed transaction using the quote ID, route name, and optional provider request ID returned by the quote endpoint. Poll this endpoint with the same request until the transaction status is CONFIRMED.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"signedTransaction":{"type":"string","minLength":1,"description":"Base64-encoded transaction signed by the connected Solana wallet.\n\n```ts\nimport { getBase64Decoder, getBase64Encoder } from \"@solana/kit\";\n\nconst [signed] = await wallet.features[\"solana:signTransaction\"].signTransaction({\n  account,\n  chain: \"solana:mainnet\",\n  transaction: new Uint8Array(getBase64Encoder().encode(quote.unsignedTransaction)),\n});\n\nconst signedTransaction = getBase64Decoder().decode(signed.signedTransaction);\n```"},"quoteId":{"type":"string","minLength":1,"description":"Quote identifier returned by the quote endpoint."},"routeName":{"type":"string","minLength":1,"description":"Liquidity route returned with the quote."},"providerRequestId":{"type":"string","minLength":1,"description":"Provider request identifier returned with the quote."}},"required":["signedTransaction"],"additionalProperties":false}}},"description":"Signed quote execution parameters.","required":true},"responses":{"200":{"description":"Transaction submission status.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[true],"type":"boolean"},"data":{"type":"object","properties":{"txHash":{"type":"string","description":"Submitted Solana transaction signature."},"status":{"enum":["CONFIRMED","SUBMITTED"],"type":"string","description":"Current transaction submission status."}},"required":["txHash","status"]},"timestamp":{"type":"string"}},"required":["success","data","timestamp"]}}}},"400":{"description":"Invalid execution request.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"403":{"description":"Execution request blocked by Sunrise policy.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"413":{"description":"Execution request too large.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"429":{"description":"Rate limited: verification_rate_limited means the local verification budget was exceeded; rate_limited means Unkey quota or upstream throttling.","headers":{"X-Sunrise-RateLimit-Scope":{"description":"Local per-key verification budget exceeded; back off requests for this key.","schema":{"type":"string","enum":["key"]}},"Retry-After":{"description":"Seconds to wait; present for local verification throttling.","schema":{"type":"integer","example":60}}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"enum":["verification_rate_limited","rate_limited"],"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"502":{"description":"Sunrise unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}},"default":{"description":"Sunrise execution error.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"enum":[false],"type":"boolean"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"timestamp":{"type":"string"}},"required":["success","error","timestamp"],"additionalProperties":false}}}}},"x-required-permission":"transactions.execute","x-required-permissions":["api.access","transactions.execute"]}}},"servers":[{"url":"https://api.sunrise.xyz"}]}