Need an account? Sign up free — takes 30 seconds.
1
Create an API
An API in Unkey is a container for your keys. Head to your dashboard and create one, or use one you already have.Copy your API ID — it looks like
api_xxxx.2
Create a root key
Root keys authenticate your requests to the Unkey API (for creating and managing keys).
- Go to Settings → Root Keys
- Click Create New Root Key
- Give it a name and select the permissions you need
- Copy the key — you won’t see it again
3
Create an API key
Now let’s create a key that your users would use to authenticate:Save the returned
key value — that’s what you’ll verify in the next step.4
Verify the key
This is what you’ll do on every API request to check if a key is valid:A successful response looks like:
What’s in the verification response?
Thedata object contains everything you need to make authorization decisions:
Fields marked with
? are optional and only included when relevant (e.g., credits only appears if you set a usage limit).Next steps
Now integrate Unkey into your actual application:Next.js
Protect API routes with middleware
Express
Add key verification to Express routes
Hono
Edge-ready API key verification
Go
Integrate with Go servers
Add rate limiting
Protect endpoints from abuse
Set usage limits
Cap requests per key for billing tiers
Add permissions
Fine-grained access control
SDK Reference
Full TypeScript SDK docs