# List the API keys of your account.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=GET
ENDPOINT=/accounts/me/keys
QUERY=''
BODY='' # GET has no body: the signature covers the empty string
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type ApiKey = {
apiKeyId: string;
status: "active" | "rotating" | "expired" | "revoked";
createdAt: string;
expiresAt: string | null;
revokedAt: string | null;
};
const { keys } = await olympexRequest<{ keys: ApiKey[] }>("GET", "/accounts/me/keys");
for (const key of keys) {
const until = key.status === "rotating" ? `, signs until ${key.expiresAt} UTC` : "";
console.log(`${key.apiKeyId} ${key.status}${until}`);
}
from sign_request import olympex_request # /authentication/sign-requests
keys = olympex_request("GET", "/accounts/me/keys")["keys"]
for key in keys:
until = f", signs until {key['expiresAt']} UTC" if key["status"] == "rotating" else ""
print(f"{key['apiKeyId']} {key['status']}{until}")
{
"success": true,
"data": {
"keys": [
{
"apiKeyId": "00000000-0000-4000-8000-000000000000",
"status": "rotating",
"createdAt": "2026-10-30T13:06:44.205Z",
"expiresAt": "2026-10-31T13:06:45.989Z",
"revokedAt": null
},
{
"apiKeyId": "00000000-0000-4000-8000-000000000001",
"status": "active",
"createdAt": "2026-10-30T13:06:45.989Z",
"expiresAt": null,
"revokedAt": null
}
]
},
"meta": {
"requestId": "GDxwLh7gIAMEZIA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000001"
}
}
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many key administration requests",
"details": []
},
"meta": {
"requestId": "GQ0byj1UoAMESSw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
List API keys
List the API keys of your account with their status, to see which keys can sign and when a rotated key stops working.
# List the API keys of your account.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=GET
ENDPOINT=/accounts/me/keys
QUERY=''
BODY='' # GET has no body: the signature covers the empty string
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type ApiKey = {
apiKeyId: string;
status: "active" | "rotating" | "expired" | "revoked";
createdAt: string;
expiresAt: string | null;
revokedAt: string | null;
};
const { keys } = await olympexRequest<{ keys: ApiKey[] }>("GET", "/accounts/me/keys");
for (const key of keys) {
const until = key.status === "rotating" ? `, signs until ${key.expiresAt} UTC` : "";
console.log(`${key.apiKeyId} ${key.status}${until}`);
}
from sign_request import olympex_request # /authentication/sign-requests
keys = olympex_request("GET", "/accounts/me/keys")["keys"]
for key in keys:
until = f", signs until {key['expiresAt']} UTC" if key["status"] == "rotating" else ""
print(f"{key['apiKeyId']} {key['status']}{until}")
{
"success": true,
"data": {
"keys": [
{
"apiKeyId": "00000000-0000-4000-8000-000000000000",
"status": "rotating",
"createdAt": "2026-10-30T13:06:44.205Z",
"expiresAt": "2026-10-31T13:06:45.989Z",
"revokedAt": null
},
{
"apiKeyId": "00000000-0000-4000-8000-000000000001",
"status": "active",
"createdAt": "2026-10-30T13:06:45.989Z",
"expiresAt": null,
"revokedAt": null
}
]
},
"meta": {
"requestId": "GDxwLh7gIAMEZIA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000001"
}
}
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many key administration requests",
"details": []
},
"meta": {
"requestId": "GQ0byj1UoAMESSw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
GET /accounts/me/keys lists every API key of the account that signs the request: the active key, keys in the grace period of a rotation, and expired and revoked keys. Each entry has its status and timestamps. Secret keys are never returned, so this list can’t recover a lost one.
The API console doesn’t call the key endpoints: run them from your server, where your credentials live.
Statuses
status | Meaning | Signs requests |
|---|---|---|
active | The current key. A new account starts with one, and each rotation creates a new one. | Yes |
rotating | The old key of a graceful rotation, in its grace period. | Until expiresAt |
expired | A rotating key whose grace period has ended. | No |
revoked | Revoked with POST /accounts/me/keys/{apiKeyId}/revoke, or by a compromised rotation. A revoked key can’t be restored. | No |
status when you call, so a rotating key becomes expired at expiresAt without any other change. expiresAt is null until a key is rotated. A key revoked by a compromised rotation has expiresAt and revokedAt set to the time of that rotation. Show every time in UTC.
Use the list
- Check a rotation. After a rotation, the list shows the old key as
rotatingwith the end of its grace period, and the new key asactive. Call it with the new key to confirm that the new key works. - Before you revoke. The account must keep its
activekey: revokerotatingandexpiredkeys, and rotate theactivekey instead of revoking it. - Find keys to clean up. Revoke a
rotatingkey as soon as your services use the new key, instead of waiting forexpiresAt. - Don’t poll it. An account can list its keys 30 times per minute, on every plan. Over that, the API answers
429RATE_LIMIT_EXCEEDED: wait about a minute.
# List the API keys of your account.
# Needs openssl, curl and OLYMPEX_API_KEY_ID, OLYMPEX_SECRET_KEY, OLYMPEX_PASSPHRASE.
METHOD=GET
ENDPOINT=/accounts/me/keys
QUERY=''
BODY='' # GET has no body: the signature covers the empty string
TS="${OLYMPEX_TIMESTAMP:-$(date +%s)}"
NONCE="${OLYMPEX_NONCE:-$(openssl rand -hex 12)}"
BODY_HASH="$(printf '%s' "$BODY" | openssl dgst -sha256 -binary | openssl base64 -A | tr '+/' '-_' | tr -d '=')"
VALUE_INFO="$(printf '%s\n%s\n%s' "$TS" "$NONCE" "$BODY_HASH")"
MESSAGE="$(printf 'OLPX-HMAC-SHA256-V2\n%s\n%s\n%s\n%s\n%s\n%s' "$TS" "$NONCE" "$METHOD" "/api/v1$ENDPOINT" "$QUERY" "$BODY_HASH")"
curl -sS -X "$METHOD" "https://api-rest.olympex.io/api/v1$ENDPOINT${QUERY:+?$QUERY}" \
-H "content-type: application/json" \
-H "x-api-key-id: $OLYMPEX_API_KEY_ID" \
-H "x-value-info: $(printf '%s' "$VALUE_INFO" | openssl base64 -A)" \
-H "x-passphrase: $OLYMPEX_PASSPHRASE" \
-H "x-signature: $(printf '%s' "$MESSAGE" | openssl dgst -sha256 -hmac "$OLYMPEX_SECRET_KEY" -binary | od -An -v -tx1 | tr -d ' \n')"
import { olympexRequest } from "./sign-request.ts"; // /authentication/sign-requests
type ApiKey = {
apiKeyId: string;
status: "active" | "rotating" | "expired" | "revoked";
createdAt: string;
expiresAt: string | null;
revokedAt: string | null;
};
const { keys } = await olympexRequest<{ keys: ApiKey[] }>("GET", "/accounts/me/keys");
for (const key of keys) {
const until = key.status === "rotating" ? `, signs until ${key.expiresAt} UTC` : "";
console.log(`${key.apiKeyId} ${key.status}${until}`);
}
from sign_request import olympex_request # /authentication/sign-requests
keys = olympex_request("GET", "/accounts/me/keys")["keys"]
for key in keys:
until = f", signs until {key['expiresAt']} UTC" if key["status"] == "rotating" else ""
print(f"{key['apiKeyId']} {key['status']}{until}")
{
"success": true,
"data": {
"keys": [
{
"apiKeyId": "00000000-0000-4000-8000-000000000000",
"status": "rotating",
"createdAt": "2026-10-30T13:06:44.205Z",
"expiresAt": "2026-10-31T13:06:45.989Z",
"revokedAt": null
},
{
"apiKeyId": "00000000-0000-4000-8000-000000000001",
"status": "active",
"createdAt": "2026-10-30T13:06:45.989Z",
"expiresAt": null,
"revokedAt": null
}
]
},
"meta": {
"requestId": "GDxwLh7gIAMEZIA=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000001"
}
}
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many key administration requests",
"details": []
},
"meta": {
"requestId": "GQ0byj1UoAMESSw=",
"version": "v1",
"accountType": "integrator",
"apiKeyId": "00000000-0000-4000-8000-000000000000"
}
}
{
"message": "Forbidden"
}
Authorizations
Your API key ID (UUID). See Sign requests.
Lowercase hex HMAC-SHA256 (signature v2), keyed with your secret key string (UTF-8, not decoded), of seven lines joined with \n, with no trailing newline: OLPX-HMAC-SHA256-V2, timestamp, nonce, the uppercase method, path, canonicalQuery and bodyHash. path is the request path including /api/v1, without the query string, for example /api/v1/limit-order/<id>. canonicalQuery is the query parameters decoded (+ is a space), sorted by key and then by value, re-encoded per RFC 3986 and joined with &, or the empty string when there is no query. Headers signed for one request are rejected on any other. See Sign requests.
Was this page helpful?
