Unkey Keys API

API key management operations

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Developer Identity & Credential Management BC-4270.40

Operations 15

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /v2/keys.addPermissions Add permissions to an API key · Add Key Permissions #
Ask an LLM
“How do I grant an existing key an extra permission without touching its roles?”
“Can I upgrade a key's permissions through the API?”
Tell an agent
Add permissions {permissions} to key {keyId}.
Grant key {keyId} the permission {permissions} for a privilege upgrade.
POST /v2/keys.addRoles Add roles to an API key · Add Key Roles #
Ask an LLM
“How do I attach a role to an existing key?”
“Can I give a key a new role without changing its direct permissions?”
Tell an agent
Add roles {roles} to key {keyId}.
Attach role {roles} to key {keyId} for a feature set.
POST /v2/keys.createKey Create an API key · Create API Key #
Ask an LLM
“How do I generate a new API key for a user?”
“Can I create a key with a specific prefix, rate limit and expiry?”
Tell an agent
Create a key for API {apiId}.
Create key {name} for API {apiId} with prefix {prefix}.
POST /v2/keys.deleteKey Delete an API key · Delete API Keys #
Ask an LLM
“How do I permanently remove an API key?”
“Can I delete a key without a soft delete first?”
Tell an agent destructive · confirm first
Delete key {keyId}.
Permanently delete key {keyId} with permanent set to {permanent}.
POST /v2/keys.getKey Get an API key's details · Get API Key #
Ask an LLM
“What permissions and roles does a given key have?”
“Can I recover the plaintext value of a key I created as recoverable?”
Tell an agent
Get key {keyId}.
Show key {keyId} with decrypt set to {decrypt}.
POST /v2/keys.migrateKeys Migrate keys into an API · Migrate API Key(s) #
Ask an LLM
“How do I move keys from my old system into an API?”
“Can I migrate several keys into a new API at once?”
Tell an agent
Migrate keys {keys} into API {apiId} using migration {migrationId}.
Insert keys {keys} into API {apiId} via migration {migrationId}.
POST /v2/keys.removePermissions Remove permissions from an API key · Remove Key Permissions #
Ask an LLM
“How do I take a permission away from a key?”
“Can I revoke a single permission without touching the key's roles?”
Tell an agent
Remove permissions {permissions} from key {keyId}.
Revoke permission {permissions} on key {keyId}.
POST /v2/keys.removeRoles Remove roles from an API key · Remove Key Roles #
Ask an LLM
“How do I detach a role from a key?”
“Can I strip a role without affecting the key's direct permissions?”
Tell an agent
Remove roles {roles} from key {keyId}.
Detach role {roles} from key {keyId}.
POST /v2/keys.rerollKey Generate a new key from an existing one · Reroll Key #
Ask an LLM
“How do I rotate a key to a new token while keeping its settings?”
“Can I set an expiration on the original key when rerolling?”
Tell an agent
Reroll key {keyId} with expiration {expiration}.
Rotate key {keyId} so the original is revoked after {expiration}.
POST /v2/keys.setPermissions Replace all permissions on a key · Set Key Permissions #
Ask an LLM
“How do I reset a key's permissions to a known set?”
“Can I overwrite every direct permission on a key in one call?”
Tell an agent
Set permissions {permissions} on key {keyId}.
Replace all direct permissions on key {keyId} with {permissions}.
POST /v2/keys.setRoles Replace all roles on a key · Set Key Roles #
Ask an LLM
“How do I replace every role on a key with a new list?”
“Can I reset a key's roles to a known state atomically?”
Tell an agent
Set roles {roles} on key {keyId}.
Replace all roles on key {keyId} with {roles}.
POST /v2/keys.updateCredits Update a key's credit quota · Update Key Credits #
Ask an LLM
“How do I top up a key's credit balance?”
“Can I set a key's credits to unlimited?”
Tell an agent
Update key {keyId} credits with operation {operation} and value {value}.
Set key {keyId} credits to {value} using operation {operation}.
POST /v2/keys.updateKey Update an API key's settings · Update Key Settings #
Ask an LLM
“How do I rename an existing key or change its rate limits?”
“Can I disable a key without deleting it?”
Tell an agent
Update key {keyId} with name {name}.
Set key {keyId} enabled to {enabled}.
POST /v2/keys.verifyKey Verify an API key · Verify API Key #
Ask an LLM
“How do I check that an incoming API key is valid and has a permission?”
“Can I consume credits while verifying a key?”
Tell an agent
Verify key {key}.
Verify key {key} with permission {permissions} and consume {credits} credits.
POST /v2/keys.whoami Identify the key behind a hash · Get API Key by Hash #
Ask an LLM
“What key does this hash belong to?”
“Can I look up an API key by its hash?”
Tell an agent
Who am I with key {key}.
Look up the key hash {key}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/unkey:unkey-keys-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

unkey-keys-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: Unkey's API provides programmatic access for all resources within our platform.
  title: Unkey Keys API
  version: 2.0.0
servers:
- url: https://api.unkey.com
security:
- rootKey: []
tags:


# --- truncated at 32 KB (127 KB total) ---
# Full source: https://artifacts.apis.io/unkey/openapi/unkey-keys-api-openapi.yml