create_api_key
Create a Portkey API key with configurable type, scopes, and limits. Use org keys for broad access or workspace keys for scoped permissions.
Instructions
Create a Portkey API key for auth. Org keys grant broader access; workspace keys are scoped. The secret is only returned once, and using the key grants access immediately according to its scopes, defaults, and limits. Workspace keys require workspace_id and user keys require user_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Key type: 'organisation' for org-wide access or 'workspace' for workspace-scoped | |
| sub_type | Yes | Sub-type: 'user' for user-associated keys or 'service' for service accounts | |
| name | Yes | Display name for the API key | |
| description | No | Optional description for the key | |
| workspace_id | No | Workspace ID (required for workspace-type keys) | |
| user_id | No | User ID (required for user sub-type keys) | |
| scopes | Yes | Permission scopes for the key (e.g., ['logs.read', 'analytics.read']) | |
| credit_limit | No | Credit limit for usage | |
| alert_threshold | No | Alert threshold percentage (0-100) | |
| rate_limit_rpm | No | Rate limit in requests per minute | |
| default_config_id | No | Default configuration ID to use with this key | |
| default_metadata | No | Default metadata key-value pairs | |
| alert_emails | No | Email addresses for alerts | |
| expires_at | No | Expiration date in ISO 8601 format |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool call succeeded and returned structured data | |
| data | No | Structured success payload when ok is true | |
| error | No | Structured error payload when ok is false |