Step 1: Open the Console
👉 https://console.defindex.io/ Create your account with an email and a password of at least 15 characters, and accept the terms of use. The console then emails you a 6-digit code: enter it to verify your email. Keys are created only for a verified email. If you already have an account, log in. Accounts created before sign-up asked for this code are already verified.Step 2: Create the Key
In the console, open the API Keys section, give the key a name (where it will run, for exampleprod-backend) and click Create API Key.
The key looks like sk_1234567890abcdef..., and it is the only credential your backend needs. Copy it when it is shown: the console shows the full key once, and after that only its prefix.
An account can hold up to 10 keys. Create one per service or environment, so you can stop one without touching the others. Creating a key never affects the keys you already have.
Keep it secret. The key carries your account’s permissions. Store it in an environment variable, never commit it, and never ship it in client-side code.
Step 3: Use the API Key in Requests
Include the key as a Bearer token in theAuthorization header:
GET /health and GET /vault/discover?network=mainnet need no key. Everything else answers 401 Unauthorized without a valid one. The JSON body carries a code: MISSING_CREDENTIAL when no key arrived, INVALID_API_KEY when the key was not accepted.
Send the key exactly as above. An x-api-key header is ignored, so it answers 401 with MISSING_CREDENTIAL, and a key without the Bearer prefix answers 403.
Key Lifetime and Rotation
The API key does not expire on a timer. It works until you stop it from the API Keys section of the console:- Disable stops it until you enable it again.
- Revoke stops it for good. A revoked key moves to the Revoked list, where you can delete it.
POST /api-keys/generate, each call replaces every key that route issued before, including any key made with the console’s earlier Generate API Key button. Only keys created with Create API Key are left alone.
If requests that used to work start answering 401 with code: INVALID_API_KEY, the key was revoked, disabled (the message then reads API key disabled) or replaced, not expired. Check its status in the console.
To rotate a key without downtime, create a new one and deploy it next to the old one, check that the new key’s Last Used moves, then revoke the old one.
refresh_tokenis unrelated to your API key./loginand/refreshissue short-lived JWT access tokens, which is how the console authenticates its own session. If you authenticate with an API key, you never call/refresh.