Management API Keys
Manage API keys programmatically
OpenRouter provides endpoints to programmatically manage your API keys, enabling key creation and management for applications that need to distribute or rotate keys automatically.
To use the key management API, you first need to create a Management API key:
Management keys cannot be used to make API calls to OpenRouter’s completion endpoints - they are exclusively for administrative operations.
Common scenarios for programmatic key management include:
All key management endpoints are under /api/v1/keys and require a Management API key in the Authorization header.
API responses return JSON objects containing key information:
When creating a new key, the response will include the key string itself. Read more in the API reference.