API

X-API-Key Authentication Guide

Overview

vDEX supports two authentication methods for accessing protected endpoints:

  1. Bearer Token (JWT) - For client-side applications (web, mobile)

  2. X-API-Key - For server-side applications (trading bots, automated systems)

This guide focuses on X-API-Key authentication for server-to-server communication.

Getting Your API Key

Your API key is automatically generated when you first log in to the platform. To retrieve it:

  1. Provide your wallet address for verification

  2. We'll send you your API key securely

Self-custodial API key generation is coming soon.

API Key Format

vdex_<64-hexadecimal-characters>

Example:
vdex_f7e6d5c4b3a2918273645f5e4d3c2b1a0f9e8d7c6b5a4938271605f4e3d2c1b0

How to Use

Basic Usage

Add the X-API-Key header to your HTTP requests:

Available Endpoints

All authenticated endpoints support both Bearer token and X-API-Key authentication:

For complete API documentation, visit: https://d3p6ozwmy1xgo4.cloudfront.net/index.html#/arrow-up-right

Environment Variable Setup

.env File

Load in Your Application

Node.js:

Python:

Go:

Error Responses

Authentication Errors

Solution: Ensure X-API-Key header is present

Solution: Verify your API key is correct

Placing an Order and Getting Balance (JavaScript/TypeScript)

Use your X-API-Key in the X-API-Key header. Examples below use Node 18+ native fetch.

  • Replace base_asset_id, initial_margin_asset_id, and other fields with valid values for your market. You can query supported pairs via GET /v2/tokens/supported-pairs.

  • For market orders, set order_type to MarketOpen and omit price.

cURL quick examples

  • Get balances:

  • Place order:

Last updated