API Keys (AuthN and AuthZ)
Discover how Admin and Workspace API Keys are used to manage access and operations in Portkey.
API Keys
Portkey uses two types of API keys to manage access to resources and operations: Admin API Keys and Workspace API Keys. These keys play crucial roles in authenticating and authorizing various operations within your organization and workspaces.
Admin API Keys
Admin API Keys operate at the organization level and provide broad access across all workspaces within an organization.
Key features of Admin API Keys:
- Created and managed by organization owners and admins
- Provide access to organization-wide operations
- Can perform actions across all workspaces in the organization
- Used for administrative tasks and integrations that require broad access
- When making updates to entities, can specify a workspace_id to target specific workspaces
Admin API Keys should be carefully managed and their use should be limited to necessary administrative operations due to their broad scope of access.
Admin API Key Permission Scopes
Organization Management
Organization Management
Scope | Description |
---|---|
organisation_users.create | Create new users in the organization |
organisation_users.read | View organization user details |
organisation_users.update | Modify organization user settings |
organisation_users.delete | Remove users from the organization |
organisation_users.list | List all organization users |
organisation_service_api_keys.create | Create new organization service API keys |
organisation_service_api_keys.update | Modify organization service API keys |
organisation_service_api_keys.read | View organization service API key details |
organisation_service_api_keys.delete | Delete organization service API keys |
organisation_service_api_keys.list | List all organization service API keys |
audit_logs.list | Access system-wide audit logs |
Workspace Management
Workspace Management
Scope | Description |
---|---|
workspaces.create | Create new workspaces |
workspaces.read | View workspace details |
workspaces.update | Modify workspace settings |
workspaces.delete | Delete workspaces |
workspaces.list | List all workspaces |
workspace_service_api_keys.create | Create new workspace service API keys |
workspace_service_api_keys.update | Modify workspace service API keys |
workspace_service_api_keys.read | View workspace service API key details |
workspace_service_api_keys.delete | Delete workspace service API keys |
workspace_service_api_keys.list | List all workspace service API keys |
workspace_user_api_keys.create | Create new workspace user API keys |
workspace_user_api_keys.update | Modify workspace user API keys |
workspace_user_api_keys.read | View workspace user API key details |
workspace_user_api_keys.delete | Delete workspace user API keys |
workspace_user_api_keys.list | List all workspace user API keys |
workspace_users.create | Create new workspace users |
workspace_users.read | View workspace user details |
workspace_users.update | Update workspace user settings |
workspace_users.delete | Remove users from workspace |
workspace_users.list | List workspace users |
Resource Management
Resource Management
Scope | Description |
---|---|
prompts.create | Create new prompt templates |
prompts.read | View prompt template details |
prompts.update | Modify existing prompt templates |
prompts.delete | Delete prompt templates |
prompts.list | List available prompt templates |
prompts.publish | Publish prompt templates |
configs.create | Create new configurations |
configs.update | Update existing configurations |
configs.delete | Delete configurations |
configs.read | View configuration details |
configs.list | List available configurations |
virtual_keys.create | Create new virtual keys |
virtual_keys.update | Update existing virtual keys |
virtual_keys.delete | Delete virtual keys |
virtual_keys.duplicate | Duplicate existing virtual keys |
virtual_keys.read | View virtual key details |
virtual_keys.list | List available virtual keys |
virtual_keys.copy | Copy virtual keys between workspaces |
Analytics and Logs
Analytics and Logs
Scope | Description |
---|---|
analytics.view | Access analytics data |
logs.export | Export logs to external systems |
logs.list | List available logs |
logs.view | View log details |
Workspace API Keys
Workspace API Keys are scoped to a specific workspace and are used for operations within that workspace only.
Key features of Workspace API Keys:
- Two types: Service Account and User
- Service Account: Used for automated processes and integrations
- User: Associated with individual user accounts for personal access
- Scoped to a single workspace by default
- Can only execute actions within the workspace they belong to
- Used for most day-to-day operations and integrations within a workspace
- Completion APIs are always scoped by workspace and can only be accessed using Workspace API Keys
- Can be created and managed by workspace managers
Workspace API Keys provide a more granular level of access control, allowing you to manage permissions and resource usage at the project or team level.
Workspace API Key Permission Scopes
Workspace Management
Workspace Management
Scope | Description |
---|---|
workspaces.read | View workspace details |
workspaces.update | Modify workspace settings |
workspaces.list | List available workspaces |
workspace_service_api_keys.create | Create new workspace service API keys |
workspace_service_api_keys.update | Modify workspace service API keys |
workspace_service_api_keys.read | View workspace service API key details |
workspace_service_api_keys.delete | Delete workspace service API keys |
workspace_service_api_keys.list | List all workspace service API keys |
workspace_user_api_keys.create | Create new workspace user API keys |
workspace_user_api_keys.update | Modify workspace user API keys |
workspace_user_api_keys.read | View workspace user API key details |
workspace_user_api_keys.delete | Delete workspace user API keys |
workspace_user_api_keys.list | List all workspace user API keys |
workspace_users.create | Create new workspace users |
workspace_users.read | View workspace user details |
workspace_users.update | Update workspace user settings |
workspace_users.delete | Remove users from workspace |
workspace_users.list | List workspace users |
LLM Operations
LLM Operations
Scope | Description |
---|---|
completions.write | Create and manage completions (includes /chat/completions, /completions, /images, /audio) |
prompts.create | Create new prompt templates |
prompts.read | View prompt template details |
prompts.update | Modify existing prompt templates |
prompts.delete | Delete prompt templates |
prompts.list | List available prompt templates |
prompts.publish | Publish prompt templates |
prompts.render | Render prompt templates |
Resources
Resources
Scope | Description |
---|---|
configs.create | Create new configurations |
configs.update | Update existing configurations |
configs.delete | Delete configurations |
configs.read | View configuration details |
configs.list | List available configurations |
virtual_keys.create | Create new virtual keys |
virtual_keys.update | Update existing virtual keys |
virtual_keys.delete | Delete virtual keys |
virtual_keys.duplicate | Duplicate existing virtual keys |
virtual_keys.read | View virtual key details |
virtual_keys.list | List available virtual keys |
virtual_keys.copy | Copy virtual keys between workspaces |
Analytics and Logs
Analytics and Logs
Scope | Description |
---|---|
analytics.view | Access analytics data |
logs.export | Export logs to external systems |
logs.list | List available logs |
logs.view | View log details |
logs.write | Create and modify logs |
Using API Key Scopes
When creating or updating API keys, you can define specific permission scopes based on your security requirements:
Both types of API keys play important roles in Portkey’s security model, enabling secure and efficient access to resources while maintaining proper separation of concerns between organization-wide administration and workspace-specific operations.