Skip to content

API Key Setup

Here's a detailed guide on how to get your API keys from MEXC. If you already have them, feel free to skip to the next section.

Step 1: Access the API Management Page

  1. Go to Deribit's API Management page
  2. Log in to your Deribit account if you haven't already
  3. You'll be taken to the API key management page

Step 2: Create a New API Key

  1. Click on + Add New Key > Deribit-generated key > Next
  2. You should see a dialog to select permissions for a new API key:
1) API Management Page 2) Select permissions
API Management Page Select Permissions

Security Note: Only enable the permissions you actually need. If you only need read-only access, don't enable trading permissions.

Step 3: Save Your API Keys

After creating the API key, click on "Show keys" to see the created credentials.

Save API Keys

Step 4: Configure Your Environment

Create a .env file in your project root:

DERIBIT_CLIENT_ID=your_client_id_here
DERIBIT_CLIENT_SECRET=your_client_secret_here

Then load it in your code:

import os
from dotenv import load_dotenv
from deribit import Deribit

load_dotenv()

async with Deribit.new() as client:
  ...

Option B: Direct Usage

from deribit import Deribit

CLIENT_ID = "your_client_id_here"
CLIENT_SECRET = "your_client_secret_here"

async with Deribit.new(CLIENT_ID, CLIENT_SECRET) as client:
  ...

Next Steps

Now that you have your API keys set up, you're ready to start trading! Check out: