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

ScopeDescription
organisation_users.createCreate new users in the organization
organisation_users.readView organization user details
organisation_users.updateModify organization user settings
organisation_users.deleteRemove users from the organization
organisation_users.listList all organization users
organisation_service_api_keys.createCreate new organization service API keys
organisation_service_api_keys.updateModify organization service API keys
organisation_service_api_keys.readView organization service API key details
organisation_service_api_keys.deleteDelete organization service API keys
organisation_service_api_keys.listList all organization service API keys
audit_logs.listAccess system-wide audit logs
ScopeDescription
workspaces.createCreate new workspaces
workspaces.readView workspace details
workspaces.updateModify workspace settings
workspaces.deleteDelete workspaces
workspaces.listList all workspaces
workspace_service_api_keys.createCreate new workspace service API keys
workspace_service_api_keys.updateModify workspace service API keys
workspace_service_api_keys.readView workspace service API key details
workspace_service_api_keys.deleteDelete workspace service API keys
workspace_service_api_keys.listList all workspace service API keys
workspace_user_api_keys.createCreate new workspace user API keys
workspace_user_api_keys.updateModify workspace user API keys
workspace_user_api_keys.readView workspace user API key details
workspace_user_api_keys.deleteDelete workspace user API keys
workspace_user_api_keys.listList all workspace user API keys
workspace_users.createCreate new workspace users
workspace_users.readView workspace user details
workspace_users.updateUpdate workspace user settings
workspace_users.deleteRemove users from workspace
workspace_users.listList workspace users
ScopeDescription
prompts.createCreate new prompt templates
prompts.readView prompt template details
prompts.updateModify existing prompt templates
prompts.deleteDelete prompt templates
prompts.listList available prompt templates
prompts.publishPublish prompt templates
configs.createCreate new configurations
configs.updateUpdate existing configurations
configs.deleteDelete configurations
configs.readView configuration details
configs.listList available configurations
virtual_keys.createCreate new virtual keys
virtual_keys.updateUpdate existing virtual keys
virtual_keys.deleteDelete virtual keys
virtual_keys.duplicateDuplicate existing virtual keys
virtual_keys.readView virtual key details
virtual_keys.listList available virtual keys
virtual_keys.copyCopy virtual keys between workspaces
ScopeDescription
analytics.viewAccess analytics data
logs.exportExport logs to external systems
logs.listList available logs
logs.viewView 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

ScopeDescription
workspaces.readView workspace details
workspaces.updateModify workspace settings
workspaces.listList available workspaces
workspace_service_api_keys.createCreate new workspace service API keys
workspace_service_api_keys.updateModify workspace service API keys
workspace_service_api_keys.readView workspace service API key details
workspace_service_api_keys.deleteDelete workspace service API keys
workspace_service_api_keys.listList all workspace service API keys
workspace_user_api_keys.createCreate new workspace user API keys
workspace_user_api_keys.updateModify workspace user API keys
workspace_user_api_keys.readView workspace user API key details
workspace_user_api_keys.deleteDelete workspace user API keys
workspace_user_api_keys.listList all workspace user API keys
workspace_users.createCreate new workspace users
workspace_users.readView workspace user details
workspace_users.updateUpdate workspace user settings
workspace_users.deleteRemove users from workspace
workspace_users.listList workspace users
ScopeDescription
completions.writeCreate and manage completions (includes /chat/completions, /completions, /images, /audio)
prompts.createCreate new prompt templates
prompts.readView prompt template details
prompts.updateModify existing prompt templates
prompts.deleteDelete prompt templates
prompts.listList available prompt templates
prompts.publishPublish prompt templates
prompts.renderRender prompt templates
ScopeDescription
configs.createCreate new configurations
configs.updateUpdate existing configurations
configs.deleteDelete configurations
configs.readView configuration details
configs.listList available configurations
virtual_keys.createCreate new virtual keys
virtual_keys.updateUpdate existing virtual keys
virtual_keys.deleteDelete virtual keys
virtual_keys.duplicateDuplicate existing virtual keys
virtual_keys.readView virtual key details
virtual_keys.listList available virtual keys
virtual_keys.copyCopy virtual keys between workspaces
ScopeDescription
analytics.viewAccess analytics data
logs.exportExport logs to external systems
logs.listList available logs
logs.viewView log details
logs.writeCreate 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.

Organizations

Workspaces

User Roles & Permissions