GeminiGemini
SandboxGet API key
  • Crypto Trading
  • Prediction Markets
  • SDKs & Tools
Changelog
Gemini Crypto Exchange LogoGemini Crypto Exchange Logo

© 2026 Gemini Space Station, Inc.

Overview
TypeScript SDK
    QuickstartAuthenticationWebSocketError HandlingPatterns & Recipes
    API Reference
      Overview
      Market Data
      Trading
      Prediction Markets
      Account Services
      Clearing & Instant
      PerpetualsMarginWebSocket
    Deep Dives
API Reference

TypeScript SDK — REST API Reference

Complete reference for every REST namespace on the GeminiMarkets client. Each namespace groups related operations and is accessed as a property on the client instance.

Namespace map

AccessorOperationsDescription
client.marketData15Public and authenticated market data — tickers, order books, candles, symbols, trades, fee promos, and funding-amount reports
client.trading12Order lifecycle, active/past order queries, trade history, volume stats, session heartbeat, and wrapped orders
client.predictions31Prediction market events, orders, positions, combos, volume, liquidity rewards, and maker rebates
client.perpetuals6Perpetual-contract positions, margin, risk stats, and funding payment history
client.margin3Margin account details, borrow rates, and order previews
client.clearingInstant10OTC clearing workflows, broker orders, instant-execution quotes, and clearing trade history
client.accountServices28Balances, transfers, deposits, withdrawals, staking, approved addresses, payment methods, and account management
Total105

Conventions

Path parameters are fields, not URL segments

URL path parameters like /v1/book/{symbol} become fields in the first argument. For simple GET endpoints the path fields are top-level:

Code
const ticker = await client.marketData.getTicker({ symbol: "BTCUSD" });

For authenticated POST endpoints that have both path and body parameters, the SDK uses an input object with path and body keys:

Code
const result = await client.trading.wrapOrder({ path: { symbol: "BTCUSD" }, body: { amount: "1.0", side: "buy" }, });

Transport fields are stripped

You never pass nonce or request — the SDK adds those automatically for authenticated requests.

RequestOptions

Every method accepts an optional RequestOptions parameter as the last argument:

Code
interface RequestOptions { signal?: AbortSignal; // cancel with an AbortController timeoutMs?: number; // per-request deadline in milliseconds } const order = await client.trading.getOrderStatus( { order_id: 12345n }, { timeoutMs: 5_000 }, );

Retry policy

  • GET operations (public or authenticated) automatically retry on 429, 502, 503, and 504 with exponential backoff.
  • POST mutations are never retried by the SDK — a failed mutation could have been applied server-side. Handle retries in your own code if idempotency is guaranteed.

Client-side validation

Some operations validate the request body locally before sending. If validation fails, the SDK throws a ValidationError synchronously — no network request is made. Validated methods are marked on their individual reference pages. See the Request Validation deep dive for details.

Prices and quantities are strings

Most prices, amounts, and quantities in both requests and responses are decimal strings (e.g. "50000.00"), never floating-point numbers. However, some fields use plain number — notably Balance.amount, Balance.available, FxRate.rate, and candle OHLCV values. Some IDs and timestamps are bigint. See Data Types for the complete list.

Full request/response schemas

This reference documents method signatures, HTTP details, and usage patterns. For the complete request and response JSON schemas, see the API Specifications.

Reference pages

  • Market Data — Symbols & Pricing · Books, Trades & Candles · Networks & Derivatives
  • Trading — Order Lifecycle · History & Volume
  • Predictions — Events & Discovery · Order Management · Positions & Terms · Combos · Volume & Metrics · Rewards & Rebates
  • Perpetuals — Perpetuals
  • Margin — Margin
  • Clearing — Clearing Orders · Instant Orders
  • Account Services — Balances & Account · Addresses & Deposits · Withdrawals & Transfers · Banking · Staking · OAuth
  • WebSocket — WebSocket Reference

Related guides

  • Authentication — API key setup and auth strategies
  • Error Handling — error types, retry guidance, and error metadata
  • Patterns — pagination, streaming, and common workflows
Last modified on August 14, 2026
Patterns & RecipesOverview
On this page
  • Namespace map
  • Conventions
    • Path parameters are fields, not URL segments
    • Transport fields are stripped
    • RequestOptions
    • Retry policy
    • Client-side validation
    • Prices and quantities are strings
    • Full request/response schemas
  • Reference pages
  • Related guides
TypeScript
TypeScript
TypeScript