Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.deribit.com/llms.txt

Use this file to discover all available pages before exploring further.

Every request to the REST Order Gateway must carry an Authorization header. There is no session or token layer — each request re-authenticates independently.

Authorization Header Format

Authorization: Basic {clientId}:{clientSecret}
The header has two parts:
  1. The literal prefix Basic (case-sensitive, with a trailing space).
  2. Your clientId and clientSecret joined by a single colon (:).
This is not standard HTTP Basic Auth. RFC 7617 Basic auth expects Basic base64(user:pass). The Starbase REST Order Gateway does not decode base64 — it reads the bytes after Basic directly. Sending a base64-encoded blob will cause authentication to fail.

Example

Given these credentials:
FieldValue
Client IDatUkltkq
Client Secretxn-v4JVKYJxC5v8UgxVvwoBbQ-k_GvkgZFUXJgle3Ow
The header you send is:
Authorization: Basic atUkltkq:xn-v4JVKYJxC5v8UgxVvwoBbQ-k_GvkgZFUXJgle3Ow
curl -X GET "https://195.138.37.137:4410/api/v2/private/cancel_all" \
  -H "Authorization: Basic atUkltkq:xn-v4JVKYJxC5v8UgxVvwoBbQ-k_GvkgZFUXJgle3Ow"

Error Responses

Any authentication failure returns HTTP 401. The table below maps each failure cause to its error message:
CauseError message
Header missing or not starting with Basic Missing or invalid Authorization header
Credential string contains no colonInvalid credentials format. Expected clientId:clientSecret
Deribit rejects the credentialsAuthentication failed
Treat every 401 as terminal for that request. Retry only after fixing the header or credentials — do not retry an invalid request blindly.

Practical Checklist

1

Use HTTPS

The credentials are sent as plaintext, so HTTPS is required to protect them in transit.
2

Send the header on every request

There is no session or token reuse. Every request must include the Authorization header.
3

Do not base64-encode

Send clientId:clientSecret as plaintext after Basic . Do not base64-encode, URL-encode the colon, or add whitespace around the credentials.
4

Obtain a REST Order Entry API key

Your API key must have the REST Order Entry scope. See Creating a Starbase API Key for steps.

Next Steps

Creating a Starbase API Key

Generate credentials with the REST Order Entry scope

Placing a New Order

Submit your first order via the REST Order Gateway

Rate Limits

Per-gateway rate limit rules for REST requests

Gateway Connectivity

Gateway addresses, ports, and connection rules