openapi: 3.2.0 info: title: REST Session API description: 'The Gemini Crypto Exchange REST API allows programmatic access to trade cryptocurrencies and manage your account on the Gemini Exchange platform. The API provides both public and private endpoints for market data, order management, and account operations.' version: 1.0.0 contact: name: Gemini Trading Support email: trading@gemini.com servers: - url: https://api.gemini.com description: Production server - url: https://api.sandbox.gemini.com description: Sandbox server for testing tags: - name: Session paths: /v1/heartbeat: post: x-zudoku-playground-enabled: false tags: - Session summary: Heartbeat operationId: sendHeartbeat description: This will prevent a session from timing out and canceling orders if the require heartbeat flag has been set. Note that this is only required if no other private API requests have been made. The arrival of any message resets the heartbeat timer. parameters: - $ref: '#/components/parameters/apiKeyAuth' - $ref: '#/components/parameters/signatureAuth' - $ref: '#/components/parameters/payloadAuth' - $ref: '#/components/parameters/contentType' - $ref: '#/components/parameters/contentLength' - $ref: '#/components/parameters/cacheControl' security: - apiKeyAuth: [] signatureAuth: [] payloadAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/Heartbeat' example: request: /v1/heartbeat nonce: responses: '200': description: The heartbeat was received successfully content: application/json: schema: type: object properties: result: type: string example: ok description: ok example: result: ok '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/ApiKeyIpFilteringFailure' '404': $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/TooManyRequests' '500': $ref: '#/components/responses/InternalError' components: responses: ApiKeyIpFilteringFailure: description: ApiKey fails IP Filtering Check content: application/json: schema: type: object $ref: '#/components/schemas/ErrorResponse' example: result: error reason: ApiKeyIpFilteringFailure message: ApiKey fails IP Filtering Check for some accounts BadRequest: description: Bad request - malformed request or invalid parameters content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: result: error reason: InvalidSignature message: Invalid signature for this request TooManyRequests: description: Too many requests - you have exceeded the rate limit content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: result: error reason: Too Many Requests message: Too Many Requests NotFound: description: Resource not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: result: error reason: EndpointNotFound message: API entry point not found InternalError: description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: result: error reason: Internal Server Error message: Unexpected server error occurred. Unauthorized: description: Unauthorized - missing or invalid authentication content: application/json: schema: type: object $ref: '#/components/schemas/ErrorResponse' example: result: error reason: MissingApikeyHeader message: Must provide 'X-GEMINI-APIKEY' header parameters: contentType: name: Content-Type in: header required: false schema: type: string default: text/plain signatureAuth: name: X-GEMINI-SIGNATURE in: header required: true description: HEX-encoded HMAC-SHA384 of payload signed with API secret schema: type: string apiKeyAuth: name: X-GEMINI-APIKEY in: header required: true description: Your API key schema: type: string payloadAuth: name: X-GEMINI-PAYLOAD in: header required: true description: Base64-encoded JSON payload schema: type: string contentLength: name: Content-Length in: header required: false schema: type: string default: '0' cacheControl: name: Cache-Control in: header required: false schema: type: string default: no-cache schemas: Heartbeat: type: object properties: request: type: string description: The literal string `/v1/heartbeat` nonce: oneOf: - type: string description: 'Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------|-----------------------|------------------------| | string (seconds) | `''1495127793''` | `POST` only | | string (milliseconds) | `''1495127793000''` | `POST` only | ' - type: integer format: int64 description: 'Gemini strongly recommends using milliseconds instead of seconds for timestamps. | Timestamp format | Example | Supported request type | |-----------------------------|---------------------------|------------------------| | whole number (seconds) | `1495127793` | `GET`, `POST` | | whole number (milliseconds) | `1495127793000` | `GET`, `POST` | ' description: The nonce, as described in [Private API Invocation](/authentication/api-key#private-api-invocation) ErrorResponse: type: object properties: result: type: string description: Error reason: type: string description: A short description message: type: string description: Detailed error message securitySchemes: apiKeyAuth: type: apiKey in: header name: X-GEMINI-APIKEY description: Your API key payloadAuth: type: apiKey in: header name: X-GEMINI-PAYLOAD description: Base64-encoded JSON payload signatureAuth: type: apiKey in: header name: X-GEMINI-SIGNATURE description: HEX-encoded HMAC-SHA384 of payload signed with API secret