GeminiGemini
Demo environmentGet API key
  • Overview
  • Crypto Trading
  • Prediction Markets
  • Perpetuals
  • Stocks
  • API Reference
  • SDKs & Tools
Changelog
Gemini logoGemini logo

© 2026 Gemini Space Station, Inc.

TypeScript SDK — REST API Reference

Complete reference for every REST namespace on the client returned by createClient(). Each namespace groups related operations and is accessed as a property on the client instance.

Namespace map

AccessorOperationsDescription
client.marketData16Public and authenticated market data — tickers, order books, candles, symbols, trades, fee promos, next funding timestamps, 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.clearing8OTC clearing workflows, counterparty orders, broker orders, and clearing trade history
client.instant2Instant-execution quote requests and order executions
client.account16Balances, account details, roles, subaccounts, banking, deposit and approved-address management, and OAuth revocation
client.staking6Staking balances, rates, rewards, event history, stake, and unstake
client.transfers6Withdrawals, internal transfers, transfer and transaction history, custody-fee transfers, and gas-fee estimates
Total106

Conventions

100% Flat Unified Parameter Objects

All SDK methods accept a single flat parameter object containing all path parameters, query parameters, and request body fields combined:

Code
// Path parameter (symbol) in flat object const ticker = await client.marketData.getTicker({ symbol: "BTCUSD" }); // Path parameter (symbol) + body fields (amount, side) all in one flat object const result = await client.trading.wrapOrder({ symbol: "BTCUSD", amount: "1.0", side: "buy", });

You never need nested path, query, or body wrapper objects. All parameters are flat, fully typed, and validated.

Transport fields are handled automatically

You never pass nonce or request — the SDK injects transport authentication parameters 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 — Balances & Account · Addresses & Deposits · Banking · OAuth
  • Staking — Staking
  • Transfers — Withdrawals & Transfers
  • 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
On this page
  • Namespace map
  • Conventions
    • 100% Flat Unified Parameter Objects
    • Transport fields are handled automatically
    • RequestOptions
    • Retry policy
    • Client-side validation
    • Prices and quantities are strings
    • Full request/response schemas
  • Reference pages
  • Related guides
TypeScript
TypeScript