Skip to main content
The unkey.py SDK provides full access to Unkey’s API for managing keys, verifying requests, and rate limiting.

Installation

Requirements: Python 3.9+

Quick Start

Initialize the client

Never expose your root key in client-side code or commit it to version control.

Verify an API Key

Check if a user’s API key is valid:

Verification response fields

FastAPI example

Flask example


Create API Keys

Issue new keys for your users:
The full API key is only returned once at creation. Unkey stores only a hash.

Update Keys

Modify an existing key:

Delete Keys

Permanently revoke a key:
Or disable temporarily:

Async Support

All methods have async variants with _async suffix:

Async FastAPI


Error Handling


Rate Limiting

Rate limiting is included in key verification, but you can also use the standalone rate limit API:

Full Reference

GitHub

Complete auto-generated API reference
Last modified on May 6, 2026