Skip to main content

API Keys

All Earn API endpoints require an API key. Pass it via the X-API-Key header on every request. Use the API key that was requested when you created your organization (or contact the Turtle team if you need one). Once you have it, copy it and store it securely. There are two types of API keys:
  • Publishable Key (pk_live_) — Use in browser/client-side applications.
  • Secret Key (sk_live_) — Use from your backend only. Never expose in client-side code.

Publishable Key

curl https://earn.turtle.xyz/v1/opportunities \
  -H "X-API-Key: pk_live_xxxxx"

Secret Key (for server-side integrations)

Use this from your backend. Never expose it in client-side code.
curl https://earn.turtle.xyz/v1/opportunities \
  -H "X-API-Key: sk_live_xxxxx"

Rate Limits

Rate limit information is returned in response headers:
HeaderDescription
X-RateLimit-LimitHourly cost unit budget
X-RateLimit-RemainingCost units remaining this hour
X-RateLimit-UsedCost units consumed this hour
X-Monthly-LimitMonthly cost unit cap (if configured)
X-Monthly-UsageCost units consumed this month
X-Monthly-RemainingCost units remaining this month
When a limit is exceeded, the API returns 429 Too Many Requests.