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.

API Reference overview
REST
    Orders
    Market Data
    Margin Trading
    Staking
    Clearing
    Instant Orders
    Fund Management
    Derivatives
    Prediction markets
    Common
      OAuth
        Authorization RequestGet Access TokenRefresh Access TokenRevoke Access Token
      Admin
WebSocket
    Core protocol
      IntroductionCoreAuthenticationCoreMessage formatCore
      Shared streams
        Book tickerL2 partial depthL2 differential depthTrade streamOrder eventsBalance updates
      Shared methods
    Prediction-market extensions
      Streams
        Position updatesPredictionContract statusPrediction
      Combo RFQ
        OverviewPredictionWebSocket streamsPredictionQuote methodsPredictionMaker integrationPredictionExamplesPrediction
FIX
Authentication and account context
Prediction markets schemas

Authorization Request

REST APIsCommonOAuthAuthorization Request

Authorization Request

GEThttps://exchange.gemini.com/auth

Initiates the OAuth 2.0 authorization code grant flow. Redirect the user to Gemini to authenticate and authorize requested scopes. After authorization, Gemini redirects the user to your redirect URI with an authorization code to exchange for access and refresh tokens.

Public clients

Public clients (no
Code
client_secret
) must use PKCE: send
Code
code_challenge
,
Code
code_challenge_method=S256
, and a non-empty
Code
state
. See Public Clients and PKCE.
GETauth
curl --request GET \
  --url 'https://exchange.gemini.com/auth?client_id=my_id&response_type=code&redirect_uri=www.example.com%2Fredirect&state=82350325&scope=balances%3Aread%2Corders%3Acreate'

URL Parameters

client_idstring·required
Unique ID of your application from your API settings.
response_typestring·required
The literal string "code".Example: code
redirect_uristring·required
The callback URL where Gemini redirects users after authorization. Must match an approved redirect URI configured in your API settings.
statestring·required
An opaque string used to protect against CSRF attacks. Gemini returns this value unchanged in the callback redirect. Verify that the returned state matches the original request before exchanging the code.
scopestring·required
A comma-separated list of OAuth scopes corresponding to the access you are requesting. These scopes must be included in your list of scopes in your app registration.
code_challengestring
Required for public clients. The PKCE code challenge:
Code
BASE64URL-no-padding(SHA-256(code_verifier))
. Always 43 characters for the
Code
S256
method. See Public Clients and PKCE.
code_challenge_methodstring
Required for public clients. The literal string
Code
S256
.
Code
plain
is not accepted.
Example: S256

Responses

Redirect to redirect_uri with authorization code and state

codestring
A temporary authorization code to be exchanged for access and refresh tokens.
statestring
The state value you provided in the request. Verify this matches before trusting the response.
Example Responses
https://www.example.com/redirect?code=90123465-86ee-44ef-b4e3-835cc89bc8a3&state=82350325
PreviousOAuthNextGet Access Token