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

© 2026 Gemini Space Station, Inc.

Get Access Token

REST APIsCommonOAuthGet Access Token

Get Access Token

POSThttps://exchange.gemini.com/auth/token

Once you have received an authorization code from the Authorization Request, you can exchange it for access and refresh tokens. Access tokens are short-lived (24 hour expiration) and are used as authentication against Gemini APIs, while refresh tokens never expire and are used to regenerate access tokens.

POSTauth/token
curl --request POST \
  --url https://exchange.gemini.com/auth/token \
  --header 'Content-Type: application/json' \
  --data '
{
  "client_id": "my_id",
  "client_secret": "my_secret",
  "code": "90123465-86ee-44ef-b4e3-835cc89bc8a3",
  "redirect_uri": "www.example.com/redirect",
  "grant_type": "authorization_code"
}
'

Request Body

client_idstring·required
Unique ID of your application. This is provided in your API settings.
client_secretstring·required
Secret of your application. This is provided when you first register an app in API settings.
codestring·required
The authorization code received from the Authorization Request.
redirect_uristring·required
Must match the redirect_uri provided in the Authorization Request.
grant_typestring·required
The literal string "authorization_code".Example: authorization_code
Example request body
{
  "client_id": "my_id",
  "client_secret": "my_secret",
  "code": "90123465-86ee-44ef-b4e3-835cc89bc8a3",
  "redirect_uri": "www.example.com/redirect",
  "grant_type": "authorization_code"
}

Responses

Access and refresh tokens successfully issued

access_tokenstring
A short-lived token to use in API call authentication. Valid until the expires_in time reaches 0.
refresh_tokenstring
A refresh token to be used to generate new access tokens.
token_typestring
The literal string "Bearer".
scopestring
The OAuth scopes the access token will have access to.
expires_ininteger
The lifetime in seconds of the access token, as measured from the current time.
Example Responses
{
  "access_token": "d9af2411-3e85-41bb-89f4-cf53750f04df",
  "refresh_token": "215c5a89-6df7-457b-ba0b-70695da8c91f",
  "token_type": "Bearer",
  "scope": "balances:read,orders:create",
  "expires_in": 86399
}
PreviousAuthorization RequestNextRefresh Access Token
Last modified on May 5, 2026