# Gemini Developer Platform - Full Documentation Corpus > Full markdown content of every documentation page. See https://developer.gemini.com/llms.txt for the link index. # Last Updated: 2026-09-09T17:33:13.572Z --- URL: https://developer.gemini.com/troubleshooting.md # Troubleshooting Please use our [Sandbox](/get-started/sandbox) environment to develop and test your code. If your [private API request](/authentication/api-key#private-api-invocation) is failing, turn on debug logging so you can capture: - the request method and URL, with credentials and sensitive query parameters redacted - non-secret request headers, with API-key, authorization, payload, and signature values removed - the HTTP status code of the response - the response body after removing account identifiers and other sensitive data Never share API secrets, private keys, signed payloads, authorization tokens, or full unredacted request and response data. Make sure that you are not sending the JSON as the `POST` body. If you receive a `400` error that you are missing required data, then copy the base64 encoded string in `X-GEMINI-PAYLOAD` to a base64 decoder such as [https://www.base64decode.org/](https://www.base64decode.org/) and decode it. Compare the decoded JSON to the documentation for the endpoint you are trying to access. If you are receiving a `429` response, then see [Rate Limits](/rate-limit). ## Support If you still have a problem, use the [Gemini Support request form](/contact) with the following information: 1. Which environment did you try to make the request in, production or sandbox? 1. What URL were you trying to hit? 1. What IP address did you make the request from? 1. What date and time (including time zone) did you try to make the request? Please include, after redacting secrets and personal data: - relevant non-secret HTTP request headers - the redacted JSON response from the server If you leave any of this information out, the response to your support request may be delayed. --- URL: https://developer.gemini.com/tools.md # SDKs & Tools Build with Gemini using official SDKs and developer tools. The [Gemini Developer Platform](https://github.com/gemini/developer-platform) repository also brings together an MCP server, API samples, and agent skills. ## TypeScript SDK The official TypeScript SDK for the Gemini API is published as `@gemini-markets/sdk`. It has two entry points — `/server` for Node.js, Bun, and Deno, and `/browser` for frontend apps and edge runtimes. ```bash npm install @gemini-markets/sdk ``` - [Quickstart](/tools/typescript-sdk/quickstart) — install, create a client, make your first request - [Authentication](/tools/typescript-sdk/authentication) — HMAC, OAuth, and browser PKCE - [WebSocket](/tools/typescript-sdk/websocket) — real-time streams and live order books - [Error handling](/tools/typescript-sdk/errors) — error classes, diagnostics, and safe logging - [Patterns & recipes](/tools/typescript-sdk/patterns) — pagination, timeouts, heartbeat, and advanced configuration - [API Reference](/tools/typescript-sdk/reference/overview) — all 106 operations across 10 REST namespaces, with code examples - [WebSocket Reference](/tools/typescript-sdk/reference/websocket) — streams, methods, and wire format - [Deep dives](/tools/typescript-sdk/deep-dives/order-book) — order book reconstruction, RFQ, data types, request validation, sessions, transport ## Developer Platform Tools These tools are open source and work with the APIs documented here. Follow the setup instructions in the linked repository before using them with production credentials. | Tool | What it will help you do | | --- | --- | | [MCP server](https://github.com/gemini/developer-platform/tree/main/packages/mcp-server) | Connect Claude, ChatGPT, and other MCP clients to Gemini API tools. It includes public market-data tools and authenticated tools for orders, funds, accounts, margin, and staking. | | [API samples](https://github.com/gemini/developer-platform/tree/main/samples) | Run REST and WebSocket examples in TypeScript, Python, and Go. The samples include public and authenticated API usage. | | [Agent skills](https://github.com/gemini/developer-platform/tree/main/skills) | Add Gemini-focused skills to Claude Code, including an integration guide and terminal candlestick charts. | See the [developer-platform README](https://github.com/gemini/developer-platform#readme) for installation instructions, configuration, and examples. Use [demo environment credentials](/get-started/sandbox) when testing. ## API specifications Inspect machine-readable contracts and generate data models or client scaffolding through the canonical [API Specifications](/api-specifications) catalog. Generic generated clients do not implement Gemini's authenticated signing transport: private Prediction Markets requests encode the logical request payload in `X-GEMINI-PAYLOAD` and send an empty HTTP body. Use generated code alongside the [API Reference](/api-reference) for authentication, permissions, and product-specific behavior that schemas cannot fully express. ## Build with Gemini today - [Set up authentication](/authentication/api-key) - [Use the demo environment](/get-started/sandbox) - [Explore API specifications](/api-specifications) - [Build an agent with current APIs](/build/agent) --- URL: https://developer.gemini.com/roles.md # Roles Gemini uses role-based access control to enforce least-privilege permissions across API keys. Roles let you isolate responsibilities: - Grant trading capabilities to automated bots. - Restrict withdrawal permissions to treasury systems. - Limit monitoring and reporting tools to read-only access. Configure key roles in [API Settings](https://exchange.gemini.com/settings/api).
| Endpoint | URI | Trader can access? | Fund Manager can access? | Auditor can access? |
|---|---|---|---|---|
| [Create New Order](/rest/orders#create-new-order) | `/v1/order/new` | ✓ | ✗ | ✗ |
| [Cancel Order](/rest/orders#cancel-order) | `/v1/order/cancel` | ✓ | ✗ | ✗ |
| [Cancel All Session Orders](/rest/orders#cancel-all-session-orders) | `/v1/order/cancel/session` | ✓ | ✗ | ✗ |
| [Cancel All Active Orders](/rest/orders#cancel-all-active-orders) | `/v1/order/cancel/all` | ✓ | ✗ | ✗ |
| [Wrap Order](/rest/orders#wrap-order) | `/v1/wrap/:symbol` | ✓ | ✗ | ✗ |
| [Order Status](/rest/orders#get-order-status) | `/v1/order/status` | ✓ | ✗ | ✓ |
| [Get Active Orders](/rest/orders#list-active-orders) | `/v1/orders` | ✓ | ✗ | ✓ |
| [List Past Trades](/rest/orders#list-past-trades) | `/v1/mytrades` | ✓ | ✗ | ✓ |
| [Get Orders History](/rest/orders#list-past-orders) | `/v1/orders/history` | ✓ | ✗ | ✓ |
| [Get Trade Volume](/rest/orders#get-trading-volume) | `/v1/tradevolume` | ✓ | ✗ | ✓ |
| [Get Notional Volume](/rest/orders#get-notional-trading-volume) | `/v1/notionalvolume` | ✓ | ✗ | ✓ |
| [Heartbeat](/rest/session#heartbeat) | `/v1/heartbeat` | ✓ | ✗ | ✗ |
| [Get Available Balances](/rest/fund-management#get-available-balances) | `/v1/balances` | ✓ | ✓ | ✓ |
| [Get Notional Balances](/rest/fund-management#get-notional-balances) | `v1/notionalbalances/:currency` | ✓ | ✓ | ✓ |
| [Get Deposit Addresses](/rest/fund-management#list-deposit-addresses) | `/v1/addresses/:network` | ✓ | ✓ | ✓ |
| [New Deposit Address](/rest/fund-management#create-new-deposit-address) | `/v1/deposit/:network/newAddress` | ✗ | ✓ | ✗ |
| [Transfers](/rest/fund-management#list-past-transfers) | `/v2/transfers` | ✓ | ✓ | ✓ |
| [Custody Account Fees](/rest/fund-management#list-custody-fee-transfers) | `/v1/custodyaccountfees` | ✓ | ✓ | ✓ |
| [Withdraw Crypto Funds](/rest/fund-management#withdraw-crypto-funds) | `/v2/withdraw/:network/:ticker` | ✗ | ✓ | ✗ |
| [New Clearing Order](/rest/clearing#create-new-clearing-order) | `/v1/clearing/new` | ✓ | ✗ | ✗ |
| [Clearing Order Status](/rest/clearing#get-clearing-order) | `/v1/clearing/status` | ✓ | ✗ | ✓ |
| [Cancel Clearing Order](/rest/clearing#cancel-clearing-order) | `/v1/clearing/cancel` | ✓ | ✗ | ✗ |
| [Confirm Clearing Order](/rest/clearing#confirm-clearing-order) | `/v1/clearing/confirm` | ✓ | ✗ | ✗ |
| [Clearing Order List](/rest/clearing#list-clearing-orders) | `/v1/clearing/list` | ✓ | ✗ | ✗ |
| [Clearing Broker List](/rest/clearing#list-clearing-brokers) | `/v1/clearing/broker/list` | ✓ | ✗ | ✗ |
| [Clearing Trades](/rest/clearing#list-clearing-trades) | `/v1/clearing/trades` | ✓ | ✗ | ✗ |
| [Get Instant Quote](/rest/instant#get-instant-quote) | `/v1/instant/quote` | ✓ | ✗ | ✗ |
| [Execute Instant Order](/rest/instant#execute-instant-order) | `/v1/instant/execute` | ✓ | ✗ | ✗ |
| [Add A Bank](/rest/fund-management#add-bank) | `/v1/payments/addbank` | ✗ | ✓ | ✗ |
| [Add A Bank CAD](/rest/fund-management#add-bank-cad) | `/v1/payments/addbank/cad` | ✗ | ✓ | ✗ |
| [View Payment Methods](/rest/fund-management#list-payment-methods) | `/v1/payments/methods` | ✓ | ✓ | ✓ |
| [Account Detail](/rest/account-administration#get-account-detail) | `/v1/account` | ✓ | ✓ | ✓ |
| [List Approved Addresses](/rest/fund-management#list-approved-addresses) | `/v1/approvedAddresses/account/:network` | ✓ | ✓ | ✓ |
| [Create Approved Address](/rest/fund-management#create-new-approved-address) | `/v1/approvedAddresses/:network/request` | ✗ | ✓ | ✗ |
| [Remove Approved Address](/rest/fund-management#remove-approved-address) | `/v1/approvedAddresses/:network/remove` | ✗ | ✓ | ✗ |
| [FX Rate](/rest/market-data#fx-rate) | `/v2/fxrate/:symbol/:timestamp` | ✗ | ✗ | ✓ |
| Endpoint | URI | Administrator can access? | Trader can access? | Fund Manager can access? | Auditor can access? |
|---|---|---|---|---|---|
| [Create Account](/rest/account-administration#create-new-account) | `/v1/account/create` | ✓ | ✗ | ✗ | ✗ |
| [Rename Account](/rest/account-administration#rename-account) | `/v1/account/rename` | ✓ | ✗ | ✗ | ✗ |
| [Get Accounts](/rest/account-administration#list-accounts-in-group) | `/v1/account/list` | ✓ | ✓ | ✓ | ✓ |
| [Transfer Between Accounts](/rest/fund-management#transfer-between-accounts) | `/v1/account/transfer/:currency` | ✗ | ✗ | ✓ | ✗ |
| [Transactions](/rest/fund-management#get-transaction-history) | `/v1/transactions` | ✓ | ✓ | ✓ | ✓ |
/rest.yaml and /api/openapi.yaml. Rendered reference: [Crypto Trading REST API reference](/rest).
- Crypto Trading WebSocket AsyncAPI spec — source contract for the production `wss://ws.gemini.com` WebSocket request/response methods, market data streams, and authenticated streams. Compatibility alias: /websocket.yaml.
## Prediction Markets
- Prediction Markets OpenAPI spec — source contract for Prediction Markets REST APIs. Compatibility alias: /prediction-markets.yaml. Rendered reference: [Prediction Markets API reference](/prediction-markets-spec).
- Prediction Markets WebSocket AsyncAPI spec — shared WebSocket source contract covering Prediction Markets streams, authenticated streams, order methods, and combo RFQ messages. Compatibility alias: /websocket.yaml.
## WebSocket coverage
| Surface | Machine-readable coverage | Notes |
|---|---|---|
| Request/response envelope | Full | Standard `id`, `method`, `params`, `status`, `result`, and `error` shapes are modeled. |
| Utility methods (`conninfo`, `ping`, `time`) | Partial | Request envelopes are modeled; result bodies are broad because the docs do not enumerate every field. |
| Subscription methods (`SUBSCRIBE`, `UNSUBSCRIBE`, `LIST_SUBSCRIPTIONS`) | Full | Uppercase Prediction Markets and lowercase Trading variants are both accepted in the spec. |
| Market data streams | Full | Book ticker, partial depth, differential depth, and trade stream payloads are modeled. |
| Trading methods | Partial | `order.place`, `order.cancel`, `order.cancel_all`, and `order.cancel_session` requests are modeled; order lifecycle state is modeled on the `orderUpdate` stream. |
| Authenticated account streams | Full | Order, balance, and position stream payloads are modeled. |
| Contract lifecycle stream | Full | `contractStatus` payloads are modeled. |
| Combo RFQ streams and methods | Full | Public/private RFQ deliveries and quote submit/withdraw/confirm methods are modeled. |
| Archived WebSocket v1/v2 APIs | Docs-only | Archived APIs remain documented for reference but are intentionally excluded from the current AsyncAPI contract. |
## Agent usage
Agents should fetch /llms.txt first for the documentation index, then /specs/index.json for machine-readable API contracts. Use the catalog entry's `url` field as the canonical spec URL; root-level aliases remain available for existing integrations. For WebSocket coverage, read the AsyncAPI spec's `x-gemini-coverage` metadata before assuming a method response body is fully enumerated.
---
URL: https://developer.gemini.com/api-reference.md
# API Reference
Use API Reference when you already know which technical interface you need. Start with a protocol, then choose the product and capability documented by that interface.
## Scope labels
| Parameter | Type | Description |
|---|---|---|
| client_id | string | Unique id of your application. This is provided in your [API settings](https://exchange.gemini.com/settings/api) |
| response_type | string | The literal string "code" |
| redirect_uri | string | The URL users should be returned to when they authorize. Note, this URL must be included in your list of approved redirect_uris in your app registration |
| state | string | A random string that will be returned to you in the response. Required (and must be non-empty) for public clients to protect against CSRF; strongly recommended for confidential clients. |
| scope | string | A comma separated list of [scopes](#oauth-scopes) corresponding to the access you're requesting for your application. Note, these scopes must be included in your list of scopes in your app registration |
| code_challenge | string | Required for public clients. The PKCE code challenge: `BASE64URL-no-padding(SHA-256(code_verifier))`. Always 43 characters for the `S256` method. See [Public Clients and PKCE](#public-clients-and-pkce) |
| code_challenge_method | string | Required for public clients. The literal string "S256". `plain` is not accepted |
| Parameter | Type | Description |
|---|---|---|
| client_id | string | Unique id of your application. This is provided in your [API settings](https://exchange.gemini.com/settings/api) |
| client_secret | string | Secret of your application, provided when you register a confidential client in [API settings](https://exchange.gemini.com/settings/api). Confidential clients only — public clients must not send this, and a request that includes it will fail |
| code | string | The code you received from the authorization request |
| redirect_uri | string | This must match the `redirect_uri` provided in the authorization request |
| grant_type | string | The literal string "authorization_code" |
| code_verifier | string | Required for public clients. The original `code_verifier` you generated before the authorization request (43–128 characters from `[A-Za-z0-9-._~]`). Gemini hashes it and compares it to the `code_challenge` you sent |
| Field | Type | Description |
|---|---|---|
| access_token | string | A short-lived token to use in API call authentication. Is valid until the `expires_in` time reaches 0 |
| refresh_token | string | A refresh token to be used to generate new access tokens |
| token_type | string | The literal string "bearer" |
| scope | string | The [scopes](#oauth-scopes) the access token will have access to |
| expires_in | integer | The lifetime in seconds of the access token, as measured in seconds from the current time |
| Parameter | Type | Description |
|---|---|---|
| client_id | string | Unique id of your application |
| client_secret | string | Secret of your application. This is provided when you first register an app in [API settings](https://exchange.gemini.com/settings/api) |
| refresh_token | string | Your refresh token |
| grant_type | string | The literal string "refresh_token" |
| Parameter | Type | Description |
|---|---|---|
| access_token | string | A short-lived token to use in API call authentication |
| refresh_token | string | A refresh token to be used to generate new access tokens |
| token_type | string | The literal string "bearer" |
| scope | string | The [scopes](#oauth-scopes) the access token will have access to |
| expires_in | integer | The lifetime in seconds of the access token, as measured in seconds from the current time |
| Endpoint | URI | Scope |
|---|---|---|
| [Get Deposit Addresses](/rest/fund-management#list-deposit-addresses) | `/v1/addresses/:network` | `addresses:read, addresses:create` |
| [New Deposit Address](/rest/fund-management#create-new-deposit-address) | `/v1/deposit/:network/newAddress` | `addresses:create` |
| [List Approved Addresses](/rest/fund-management#list-approved-addresses) | `/v1/approvedAddresses/account/:network` | `addresses:read` |
| [Remove Approved Address](/rest/fund-management#remove-approved-address) | `/v1/approvedAddresses/:network/remove` | `addresses:create` |
| [Get Available Balances](/rest/fund-management#get-available-balances) | `/v1/balances` | `balances:read` |
| [Get Notional Balances](/rest/fund-management#get-notional-balances) | `v1/notionalbalances/:currency` | `balances:read` |
| [Add A Bank](/rest/fund-management#add-bank) | `/v1/payments/addbank` | `banks:create` |
| [Add A Bank CAD](/rest/fund-management#add-bank-cad) | `/v1/payments/addbank/cad` | `banks:create` |
| [View Payment Methods](/rest/fund-management#list-payment-methods) | `/v1/payments/methods` | `banks:read, banks:create` |
| [New Clearing Order](/rest/clearing#create-new-clearing-order) | `/v1/clearing/new` | `clearing:create` |
| [Cancel Clearing Order](/rest/clearing#cancel-clearing-order) | `/v1/clearing/cancel` | `clearing:create` |
| [Confirm Clearing Order](/rest/clearing#confirm-clearing-order) | `/v1/clearing/confirm` | `clearing:create` |
| [Clearing Order Status](/rest/clearing#get-clearing-order) | `/v1/clearing/status` | `clearing:read` |
| [Clearing Order List](/rest/clearing#list-clearing-orders) | `/v1/clearing/list` | `clearing:read` |
| [Clearing Broker List](/rest/clearing#list-clearing-brokers) | `/v1/clearing/broker/list` | `clearing:read` |
| [Clearing Trades](/rest/clearing#list-clearing-trades) | `/v1/clearing/trades` | `clearing:read` |
| [Withdraw Crypto Funds](/rest/fund-management#withdraw-crypto-funds) | `/v2/withdraw/:network/:ticker` | `crypto:send` |
| [List Past Trades](/rest/orders#list-past-trades) | `/v1/mytrades` | `history:read` |
| [Get Orders History](/rest/orders#list-past-orders) | `/v1/orders/history` | `history:read` |
| [Get Notional Volume](/rest/orders#get-notional-trading-volume) | `/v1/notionalvolume` | `history:read` |
| [Get Trade Volume](/rest/orders#get-trading-volume) | `/v1/tradevolume` | `history:read` |
| [Transfers](/rest/fund-management#list-past-transfers) | `/v2/transfers` | `history:read` |
| [Custody Account Fees](/rest/fund-management#list-custody-fee-transfers) | `/v1/custodyaccountfees` | `history:read` |
| [Create New Order](/rest/orders#create-new-order) | `/v1/order/new` | `orders:create` |
| [Cancel Order](/rest/orders#cancel-order) | `/v1/order/cancel` | `orders:create` |
| [Cancel All Session Orders](/rest/orders#cancel-all-session-orders) | `/v1/order/cancel/session` | `orders:create` |
| [Cancel All Active Orders](/rest/orders#cancel-all-active-orders) | `/v1/order/cancel/all` | `orders:create` |
| [Wrap Order](/rest/orders#wrap-order) | `/v1/wrap/:symbol` | `orders:create` |
| [Get Instant Quote](/rest/instant#get-instant-quote) | `/v1/instant/quote` | `orders:create` |
| [Execute Instant Order](/rest/instant#execute-instant-order) | `/v1/instant/execute` | `orders:create` |
| [Get Order Status](/rest/orders#get-order-status) | `/v1/order/status` | `orders:read` |
| [Get Active Orders](/rest/orders#list-active-orders) | `/v1/orders` | `orders:read` |
| [Account Detail](/rest/account-administration#get-account-detail) | `/v1/account` | `account:read` |
| [Get Terms Status](/rest-api/prediction-markets/terms/get-terms-status) | `/v1/prediction-markets/terms/status` | `orders:read` |
| [Accept Terms](/rest-api/prediction-markets/terms/accept-terms) | `/v1/prediction-markets/terms/accept` | `orders:create` |
| [Place Prediction Market Order](/rest-api/prediction-markets/order-management/place-order) | `/v1/prediction-markets/order` | `orders:create` |
| [Place Prediction Market Batch Orders](/rest-api/prediction-markets/order-management/place-batch-orders) | `/v1/prediction-markets/order/batch` | `orders:create` |
| [Cancel Prediction Market Order](/rest-api/prediction-markets/order-management/cancel-order) | `/v1/prediction-markets/order/cancel` | `orders:create` |
| [Cancel Prediction Market Batch Orders](/rest-api/prediction-markets/order-management/cancel-batch-orders) | `/v1/prediction-markets/order/batch/cancel` | `orders:create` |
| [Get Active Prediction Market Orders](/rest-api/prediction-markets/order-management/get-active-orders) | `/v1/prediction-markets/orders/active` | `orders:read` |
| [Get Prediction Market Order History](/rest-api/prediction-markets/order-management/get-order-history) | `/v1/prediction-markets/orders/history` | `orders:read` |
| [Get Prediction Market Positions](/rest-api/prediction-markets/positions/get-positions) | `/v1/prediction-markets/positions` | `orders:read` |
| [Prediction Market WebSocket Position Updates](/prediction-markets/websocket/streams#position-updates) | `positions@account`, `positions@account@1s` | `positions:read` or `predictions:positions:read` |
| [Get Settled Prediction Market Positions](/rest-api/prediction-markets/positions/get-settled-positions) | `/v1/prediction-markets/positions/settled` | `orders:read` |
| [Get Prediction Market Volume Metrics](/rest-api/prediction-markets/positions/get-volume-metrics) | `/v1/prediction-markets/metrics/volume` | `orders:read` |
| [List Maker Rebate Payouts](/rest-api/prediction-markets/rewards/list-maker-rebate-payouts) | `/v1/prediction-markets/maker-rebate/payouts` | `orders:read` |
| [Get Maker Rebate Lifetime Summary](/rest-api/prediction-markets/rewards/get-maker-rebate-lifetime-summary) | `/v1/prediction-markets/maker-rebate/summary/total` | `orders:read` |
| [Get Liquidity Rewards Daily Summary](/rest-api/prediction-markets/rewards/get-liquidity-rewards-daily-summary) | `/v1/prediction-markets/liquidity-rewards/summary/daily` | `orders:read` |
| [Get Liquidity Rewards Lifetime Summary](/rest-api/prediction-markets/rewards/get-liquidity-rewards-lifetime-summary) | `/v1/prediction-markets/liquidity-rewards/summary/total` | `orders:read` |
The API key you use to access this endpoint must have the Trader or Fund Manager role assigned. See Roles for more information.
), }, { heading: "Headers", children:The API key you use to access this endpoint must have the Trader or Fund Manager role assigned. See Roles for more information.
), }, { heading: "Headers", children:The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned. See Roles for more information.
), }, { heading: "Headers", children:The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned. See Roles for more information.
), }, { heading: "How to iterate through all transactions", children: (https://api.gemini.com/v1/staking/history with a JSON payload including sortAsc set to false and a limit of 500.datetime descending — the last element has the lowest timestamp. Call it X.until set to X-1, sortAsc still false, and limit of 500.until value.The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned. See Roles for more information.
), }, { heading: "Headers", children:The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
Gemini recommends using our WebSocket Order Events API to be notified when a trade executes on your account instead of polling this endpoint.
Under the terms of the Gemini API Agreement, polling this endpoint may be subject to rate limiting.
Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards. Trade info for all perpetuals orders submitted prior to this timing will not be available through this API.
> ) }} example={{ request: { method: "POST", url: "https://api.gemini.com/v1/mytrades", headers: [ { name: "X-GEMINI-APIKEY", value: "The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
To retrieve your full trade history walking backwards:
In the rare event that a trade has been reversed (broken), the trade that is broken will have this flag set. The field will contain one of these values:
The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
To retrieve your full order history walking backwards:
In the rare event that a trade has been reversed (broken), the trade that is broken will have this flag set. The field will contain one of these values:
Gemini recommends using our WebSocket Order Events API to maintain a current view of your active orders. It's both faster and more efficient than polling this endpoint.
Under the terms of the Gemini API Agreement, polling this endpoint may be subject to rate limiting.
Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards.
> ) }} example={{ request: { method: "POST", url: "https://api.gemini.com/v1/orders", headers: [ { name: "X-GEMINI-APIKEY", value: "The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
Any authenticated API key may call this endpoint. See Require Heartbeat for background on the heartbeat flag and session behavior.
> ), }, { heading: "Headers", children:The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
Gemini recommends using our WebSocket Order Events API to receive order status changes. It's much better because you'll be notified of order status changes as they happen.
Under the terms of the Gemini API Agreement, polling this endpoint may be subject to rate limiting.
Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards. Trade info for all perpetuals orders submitted prior to this timing, will not be available through this API.
> ) }} example={{ request: { method: "POST", url: "https://api.gemini.com/v1/order/status", headers: [ { name: "X-GEMINI-APIKEY", value: "The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
Master API keys do not support cancelation on disconnect via heartbeat.
Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards.
> }} exampleNode={The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
Set
Important
Margin trading amplifies both gains and losses. Monitor your account using the Margin Account Summary endpoint and preview order impacts with Order Preview before placing margin orders.
A Stop-Limit order is an order type that allows for order placement when a price reaches a specified level. Stop-Limit orders take in both a
The API doesn't directly support market orders because they provide you with no price protection.
Instead, use the "immediate-or-cancel" order execution option, coupled with an aggressive limit price (i.e. very high for a buy order or very low for a sell order), to achieve the same result.
> ), }, { heading: "Order execution options", children: ( <>Note that
If you specify more than one option (or an unsupported option) in the
No
The available limit order options are:
This order will only add liquidity to the order book.
If any part of the order could be filled immediately, the whole order will instead be canceled before any execution occurs.
If that happens, the response back from the API will indicate that the order has already been canceled (
Note: some other exchanges call this option "post-only".
This order will only remove liquidity from the order book.
It will fill whatever part of the order it can immediately, then cancel any remaining amount so that no part of the order is added to the order book.
If the order doesn't fully fill immediately, the response back from the API will indicate that the order has already been canceled (
This order will only remove liquidity from the order book.
It will fill the entire order immediately or cancel.
If the order doesn't fully fill immediately, the response back from the API will indicate that the order has already been canceled (
The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
Under unique circumstances, orders may be automatically cancelled by the exchange. These scenarios are detailed in the table below:
The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
Note that this cancels orders that were not placed using this API key. Enabled for perpetuals accounts from July 10th, 0100hrs ET onwards. Typically Cancel All Session Orders is preferable, so that only orders related to the current connected session are cancelled.
}} example={{ request: { method: "POST", url: "https://api.gemini.com/v1/order/cancel/all", headers: [ { name: "X-GEMINI-APIKEY", value: "The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader, Fund Manager or Auditor role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader, Fund Manager or Auditor role assigned. See Roles for more information.
The OAuth scope must have
This public API endpoint is limited to retrieving seven calendar days of data.
Please contact us for information about Gemini market data.
> ) }} example={{ request: { method: "GET", url: "https://api.gemini.com/v1/trades/BTCUSD", headers: [], }, }} sections={[ { heading: "Path Parameters", children:The API key you use to access this endpoint must have the Fund Manager or Auditor role assigned. See Roles for more information.
), }, { heading: "Path Parameters", children:The API key you use to access this endpoint must have the Auditor role assigned. See Roles for more information.
), }, { heading: "Supported Pairs", children: (
The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Fund Manager role assigned. See Roles for more information.
The OAuth scope must have
Gemini Custody withdrawals occur during the daily custody run. Custody-to-Exchange transfers receive pre-credit. Custody accounts request withdrawals to approved addresses and require approved IP controls.
Custody accounts do not support fiat transfers. Fiat transfers between non-derivative and derivatives accounts are prohibited.
> ), }} example={{ request: { method: "POST", url: "https://api.gemini.com/v1/account/transfer/btc", headers: [ { name: "X-GEMINI-APIKEY", value: "The API key you use to access this endpoint must be a Master level key with the Fund Manager role assigned. See Roles for more information.
), }, { heading: "Headers", children:The API key you use to access this endpoint must have the Fund Manager role assigned. See Roles for more information.
), }, { heading: "Headers", children:This endpoint can be accessed by either a Master or Account level key with any role assigned. See Roles for more information.
The OAuth scope must have
Under the terms of the Gemini API Agreement, polling this endpoint may be subject to rate limiting. This endpoint is currently restricted further than standard rate limiting to a rate of 1 request per 5 seconds per subaccount. This rate is subject to change.
This endpoint does not currently show cancelled advances, returned outgoing wires or ACH transactions, or other exceptional transaction circumstances.
Fiat transfers between non-derivative and derivatives accounts are prohibited.
> ), }} example={{ request: { method: "POST", url: "https://api.gemini.com/v2/transfers", headers: [ { name: "X-GEMINI-APIKEY", value: "The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned. See Roles for more information.
The OAuth scope must have
This endpoint can be accessed with any role assigned. See Roles for more information.
), }, { heading: "Headers", children:The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned, with master account scope. See Roles for more information.
The OAuth scope must have
Under the terms of the Gemini API Agreement, polling this endpoint may be subject to rate limiting.
Gemini is currently in the process of introducing new API architecture that will impact how decimal balances are returned from this endpoint for fiat and crypto assets.
As a result of this change, requests routed via the new architecture will return fiat balances and crypto balances truncated to 15 and 19 decimal places, respectively. It is recommended that users floor the values returned from this endpoint to the correct precision until the migration has been completed.
> ), }} example={{ request: { method: "POST", url: "https://api.gemini.com/v1/notionalbalances/usd", headers: [ { name: "X-GEMINI-APIKEY", value: "The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader, Fund Manager, Auditor, WealthManager, or Administrator role assigned. See Roles for more information.
), }, { heading: "Headers", children:Under the terms of the Gemini API Agreement, polling this endpoint may be subject to rate limiting.
Gemini is currently in the process of introducing new API architecture that will impact how decimal balances are returned from this endpoint for fiat and crypto assets.
As a result of this change, requests routed via the new architecture will return fiat balances and crypto balances truncated to 15 and 19 decimal places, respectively. It is recommended that users floor the values returned from this endpoint to the correct precision until the migration has been completed.
> ), }} example={{ request: { method: "POST", url: "https://api.gemini.com/v1/balances", headers: [ { name: "X-GEMINI-APIKEY", value: "The API key you use to access this endpoint must have the Trader, Fund Manager, or Auditor role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Fund Manager role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Fund Manager role assigned. See Roles for more information.
), }, { heading: "Headers", children:The API key you use to access this endpoint must have the Fund Manager role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Fund Manager role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
fromDate=2024-04-10&toDate=2024-04-25&numRows=1000 — returns the lesser of the date-range record count and numRows.fromDate=2024-04-10&toDate=2024-04-25 — returns all records in the date range.numRows=1000 — returns up to 1000 records starting from now.The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
fromDate=2024-04-10&toDate=2024-04-25&numRows=1000 — returns the lesser of the date-range record count and numRows.fromDate=2024-04-10&toDate=2024-04-25 — returns all records in the date range.numRows=1000 — returns up to 1000 records starting from now.symbol=BTCGUSDPERP&fromDate=2024-04-10&toDate=2024-04-25&numRows=1000 — returns the lesser of the date-range record count and numRows.symbol=BTCGUSDPERP&fromDate=2024-04-10&toDate=2024-04-25 — returns all records in the date range.symbol=BTCGUSDPERP&numRows=1000 — returns up to 1000 records starting from now.symbol=BTCGUSDPERP — returns the default maximum of 8760 records starting from now.The API key you use to access this endpoint must have the Trader or Auditor role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have
The API key you use to access this endpoint must have the Trader role assigned. See Roles for more information.
The OAuth scope must have