| title | Authentication |
|---|---|
| description | Learn about API key authentication and plan-based rate limiting |
The SolixDB API uses API key authentication for all endpoints. You need an API key to make requests, and rate limits are based on your subscription plan.
- Sign up at dashboard.solixdb.xyz
- Navigate to the API Keys section
- Create a new API key
- Copy your API key (you'll only see it once!)
You can provide your API key in two ways:
Include your API key in the x-api-key header:
const response = await fetch('https://api.solixdb.xyz/v1/rpc', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getTransactions',
params: [{ limit: 10 }]
})
});import requests
response = requests.post(
'https://api.solixdb.xyz/v1/rpc',
headers={
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
json={
'jsonrpc': '2.0',
'id': 1,
'method': 'getTransactions',
'params': [{'limit': 10}]
}
)Alternatively, you can pass the API key as a query parameter:
curl -X POST "https://api.solixdb.xyz/v1/rpc?api-key=YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransactions",
"params": [{"limit": 10}]
}'If your API key is invalid or missing, you'll receive a 401 Unauthorized response:
{
"error": "Unauthorized",
"message": "API key is required. Provide it via x-api-key header or api-key query parameter."
}Status Code: 401 Unauthorized
Common causes:
- Missing API key header
- Invalid or inactive API key
- API key has been revoked
Rate limits are based on your subscription plan:
| Plan | Requests per Minute | Features |
|---|---|---|
| Free | 100 | Basic access to all endpoints |
| x402 | 500 | Higher rate limits, priority support |
| Enterprise | 2000 | Highest rate limits, dedicated support, custom features |
Every API response includes rate limit information in the headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 2025-07-20T12:01:00Z
X-RateLimit-Plan: free
Retry-After: 5
- X-RateLimit-Limit: Maximum requests allowed per minute for your plan
- X-RateLimit-Remaining: Remaining requests in the current window
- X-RateLimit-Reset: ISO 8601 timestamp when the rate limit window resets
- X-RateLimit-Plan: Your current subscription plan (free/x402/enterprise)
- Retry-After: Seconds to wait before retrying (only present on 429 responses)
async function makeRequest(url, apiKey, body) {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': apiKey
},
body: JSON.stringify(body)
});
// Check rate limit headers
const limit = parseInt(response.headers.get('X-RateLimit-Limit'));
const remaining = parseInt(response.headers.get('X-RateLimit-Remaining'));
const plan = response.headers.get('X-RateLimit-Plan');
console.log(`Plan: ${plan}, Limit: ${limit}/min, Remaining: ${remaining}`);
// If using more than 80% of budget, slow down
if (remaining < limit * 0.2) {
console.warn('Rate limit nearly exhausted, consider slowing down');
}
return response;
}