Skip to main content
Glama

create_api_key

Create API keys for Portkey authentication with configurable type, scopes, rate limits, and expiration. Keys grant immediate access according to specified defaults and 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?

Annotations already indicate this is a write operation (readOnlyHint: false). The description adds crucial behavioral details: the secret is returned only once and grants immediate access. No contradiction with annotations.

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?

Two sentences totaling 52 words, clearly structured with the main action first and important details following. No unnecessary information.

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

Completeness4/5

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

Covers key behavioral aspects (secret one-time return, immediate access) and distinguishes key types. Does not detail output schema (handled by schema) or error cases, but adequate for a creation tool with many parameters.

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

Parameters3/5

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

Schema coverage is 100%, so the description adds limited value. It reinforces that workspace_id is required for workspace-type keys and user_id for user sub-type, which is already hinted in the 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?

Description clearly states the tool creates a Portkey API key for authentication, distinguishes between organization and workspace keys, and notes the secret is returned only once. This is specific and differentiates from siblings like update_api_key and delete_api_key.

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?

Description explains when to use org vs workspace keys and the requirement for workspace_id or user_id for certain types. It provides useful context but does not explicitly mention when not to use this tool or compare with alternatives.

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