Skip to main content

Overview

All Yield.xyz API requests require authentication using an API key. API keys are passed in the x-api-key header.

Get Your API Key

Sign up to create your API key

API Key Format

API keys follow this format:
Test keys only work with testnets. Production keys work with mainnets.

Making Authenticated Requests

Include your API key in the x-api-key header:

Error Responses

401 Unauthorized

Invalid or missing API key:
Common causes:
  • API key is missing from the header
  • API key is invalid or expired
  • API key has been revoked
  • Wrong header name (use x-api-key, not X-API-KEY or Authorization)

403 Forbidden

API key is valid but lacks required permissions:
Common causes:
  • Geoblocking restrictions
  • Read-only key used for write operations
  • API key disabled in dashboard

429 Rate Limited

Too many requests:
Response headers:

Best Practices

Never commit API keys to version control. Use environment variables:
.env
Make API calls from your backend, not client-side JavaScript:
Use different API keys for development, staging, and production:
Generate new keys periodically and revoke old ones in your dashboard.
Track API usage in your dashboard to detect anomalies or unauthorized access.

Rate Limits

Rate limits vary by plan:

View Rate Limits

Learn more about rate limits and plans

Environments

Production

Use production keys (live_...) for mainnet transactions.

Staging

Use test keys (test_...) for testing against staging environment.

Testing Authentication

Verify your API key works:
Success response:

Next Steps

Create API Key

Step-by-step guide to creating your first API key

List Yields

Make your first API call

Project Setup

Complete integration guide