Authentication

How to authenticate with the Lavarage API.

API Key Authentication

The Lavarage API uses API keys passed via the x-api-key HTTP header.

curl https://api.lavarage.xyz/api/v1/positions \
  -H "x-api-key: lav_sk_your_api_key_here"

Public Endpoints (No Key Required)

These endpoints are freely accessible:

EndpointDescription
GET /healthService health check
GET /api/v1/offersBrowse liquidity pools
GET /api/v1/offers/utilizationPool utilization metrics
GET /api/v1/offers/:publicKeySingle offer details
GET /api/v1/tokensToken list with prices
GET /api/v1/tokens/:addressSingle token details
POST /api/v1/offers/matchMatch best offer for token pair
GET /api/v1/offers/topTop tokens by activity
GET /api/v1/offers/latestLatest tokens
POST /api/v1/offers/resolve-feedResolve Switchboard oracle feed
GET /api/v1/referral/*Referral read endpoints

Protected Endpoints (Key Required)

All position, order, staking, and partner management endpoints require a valid API key.

Getting an API Key

  1. Contact the team at lavarage.io to get a partner account
  2. Use the Partners API to generate additional keys:
curl -X POST https://api.lavarage.xyz/api/v1/partners/keys \
  -H "x-api-key: YOUR_EXISTING_KEY"

The raw key is only returned once — store it securely.

Key Management

  • List keys: GET /api/v1/partners/keys
  • Revoke a key: DELETE /api/v1/partners/keys/:id

Revoking a key is permanent and immediate.

Security Best Practices

  • Never expose API keys in client-side code
  • Use environment variables for key storage
  • Rotate keys periodically using the Partners API
  • Revoke compromised keys immediately