Copy page
Copy page
POST
/
keys
Try it
Create a new API key
cURL
curl
--request
POST
\
--url
https://openrouter.ai/api/v1/keys
\
--header
'Authorization: Bearer <token>'
\
--header
'Content-Type: application/json'
\
--data
'
{
"expires_at": "2027-12-31T23:59:59Z",
"include_byok_in_limit": true,
"limit": 50,
"limit_reset": "monthly",
"name": "My New API Key"
}
'
import requests url = "https://openrouter.ai/api/v1/keys" payload = { "expires_at": "2027-12-31T23:59:59Z", "include_byok_in_limit": True, "limit": 50, "limit_reset": "monthly", "name": "My New API Key" } headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.text)

Images
Interns
API Keys
GET
Get current API key
GET
List API keys
POST
Create a new API key
GET
Get a single API key
DEL
Delete an API key
PATCH
Update an API key
Anthropic Messages
Models
Observability
Organization
Presets
Private Endpoints
Providers
Rerank
Responses
SCIM
SystemOne
Tools
Vault
Video Generation
Workspaces
Create a new API key
cURL
curl
--request
POST
\
--url
https://openrouter.ai/api/v1/keys
\
--header
'Authorization: Bearer <token>'
\
--header
'Content-Type: application/json'
\
--data
'
{
"expires_at": "2027-12-31T23:59:59Z",
"include_byok_in_limit": true,
"limit": 50,
"limit_reset": "monthly",
"name": "My New API Key"
}
'
