Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
typeYesKey type: 'organisation' for org-wide access or 'workspace' for workspace-scoped
sub_typeYesSub-type: 'user' for user-associated keys or 'service' for service accounts
nameYesDisplay name for the API key
descriptionNoOptional description for the key
workspace_idNoWorkspace ID (required for workspace-type keys)
user_idNoUser ID (required for user sub-type keys)
scopesYesPermission scopes for the key (e.g., ['logs.read', 'analytics.read'])
credit_limitNoCredit limit for usage
alert_thresholdNoAlert threshold percentage (0-100)
rate_limit_rpmNoRate limit in requests per minute
default_config_idNoDefault configuration ID to use with this key
default_metadataNoDefault metadata key-value pairs
alert_emailsNoEmail addresses for alerts
expires_atNoExpiration date in ISO 8601 format

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds behavioral details beyond annotations: the secret is returned only once, and the key grants access immediately. This informs the agent's expectations. Annotations already indicate it is not read-only (readOnlyHint=false), and the description aligns with that.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is four sentences, front-loading purpose and key distinctions. Every sentence adds essential information: purpose, type scoping, behavioral trait, required IDs. No redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (14 params, 4 required) and the presence of an output schema, the description covers the core aspects: purpose, key type differences, one-time secret, immediate activation, and required fields. It leaves param details to the schema, which is appropriate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, the description adds value by highlighting relationships: workspace_id required for workspace-type, user_id required for user sub-type. It also groups parameters by role, providing context beyond the raw schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description directly states the tool's purpose ('Create a Portkey API key for auth') and clarifies the two types (org vs workspace) and their scoping, which distinguishes this from other tools. The verb 'create' and resource 'API key' are specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance on when to use org vs workspace keys and notes required IDs for workspace/user keys. However, it does not explicitly mention when not to use this tool or contrast it with update_api_key or list_api_keys, though the context of creation is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/s-b-e-n-s-o-n/portkey-admin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server