Base URL
All API requests should be made to:SDKs
While you can interact with the Unkey API directly via HTTP, we provide official SDKs to make integration easier:TypeScript/JavaScript
Official SDK for Node.js and browser environments
Python
Official SDK for Python applications
Go
Official SDK for Go applications
Elixir
Community SDK for Elixir applications
Response Envelope
All responses follow a consistent envelope structure that separates operational metadata from actual data. This design provides several benefits:- Debugging: Every response includes a unique
requestIdfor tracing issues - Consistency: Predictable response format across all endpoints
- Extensibility: Easy to add new metadata without breaking existing integrations
- Error Handling: Unified error format with actionable information
Success Response
Successful API responses follow this structure:Operational metadata for the request
The actual response data specific to each endpoint. The structure varies by endpoint.
Paginated Response
List endpoints return paginated results with cursor-based pagination:Pagination information for list endpoints
Rate Limits
The Unkey API implements rate limiting to ensure fair usage and platform stability. Rate limits are applied at the workspace level. If you exceed the rate limit, you’ll receive a429 Too Many Requests response. Implement exponential backoff when retrying requests to avoid continued rate limiting.
Request IDs
Every API response includes a uniquerequestId in the meta object. This identifier is essential for debugging and support:
- Include the
requestIdwhen reporting issues to support - Use it to trace requests through your logs
- Reference it when debugging unexpected behavior
Idempotency
Many Unkey API endpoints are idempotent, meaning making the same request multiple times will produce the same result. This is particularly important for:- Network retry logic
- Recovering from failures
- Ensuring data consistency