Skip to main content
Unkey’s API provides programmatic access for all resources within our platform. Use it to create and manage API keys, verify authentications, configure rate limits, and more.

Base URL

All API requests should be made to:
https://api.unkey.com

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 requestId for 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:
{
  "meta": {
    "requestId": "req_123456"
  },
  "data": {
    // Actual response data here
  }
}
meta
object
required
Operational metadata for the request
data
object
required
The actual response data specific to each endpoint. The structure varies by endpoint.

Paginated Response

List endpoints return paginated results with cursor-based pagination:
{
  "meta": {
    "requestId": "req_123456"
  },
  "data": [
    // Array of results
  ],
  "pagination": {
    "cursor": "next_page_token",
    "hasMore": true
  }
}
pagination
object
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 a 429 Too Many Requests response. Implement exponential backoff when retrying requests to avoid continued rate limiting.
Our SDKs include automatic retry logic with exponential backoff for rate-limited requests.

Request IDs

Every API response includes a unique requestId in the meta object. This identifier is essential for debugging and support:
  • Include the requestId when reporting issues to support
  • Use it to trace requests through your logs
  • Reference it when debugging unexpected behavior
Store request IDs in your application logs to correlate API responses with your application’s 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
Refer to individual endpoint documentation to understand idempotency behavior for specific operations.

Build docs developers (and LLMs) love