Skip to main content
Glama

Mint an API key

create_api_key

Mints a runtime API key for the project. The full key is returned only on initial creation when return_secret is not false; the user MCP tool defaults false. Optional allowed_ips restricts the key to those addresses. Each entry is an IP address or CIDR range (for example 203.0.113.7 or 198.51.100.0/24). Public addresses only, up to 100 entries, ranges no wider than /8 (IPv4) or /16 (IPv6). An empty list accepts calls from any IP. Calls from any other address get 403 with code ip_not_allowed. A change takes up to a minute to apply. Reuse idempotency_key with identical arguments after uncertain results. A replay returns existing metadata without a secret; changed arguments or a deleted key return 409. Requires the apikeys:write scope. Runtime secrets are omitted by default; call_model uses the returned key ID. For local application setup use opper keys create --project --name --output (native OAuth, private file delivery). Supply idempotency_key and reuse it with identical arguments on retries.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "uuid": "<uuid>"
    },
    "name": "create_api_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNopersonal (the default) or project. A project key needs the project_keys:manage permission.
nameYes
uuidYesProject UUID
allowed_ipsNoIP addresses or CIDR ranges the key accepts calls from (for example 203.0.113.7 or 198.51.100.0/24). Public addresses only; up to 100 entries; ranges no wider than /8 for IPv4 or /16 for IPv6. Empty accepts any IP. Calls from any other address get 403 ip_not_allowed. A change takes up to a minute to apply.
return_secretNoDefault false: keep the runtime secret on the server and return its ID for the matching model-call tool. For local application setup use opper keys create to install a key privately. Set true only when the user explicitly needs the raw secret and the client can deliver it privately; raw tool results may enter the model conversation.
idempotency_keyNoGenerate a unique operation ID (for example UUID) before creation. Reuse it and the exact original arguments after a timeout or uncertain result; never generate a new ID merely to retry. A changed payload or deleted original resource returns 409. Key replays return metadata without the raw secret.

Output Schema

NameRequiredDescriptionDefault
dataNo
metaNoEmpty for a single resource. Endpoint-specific context appears here rather than as a sibling of `data`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Adds a lot beyond annotations: secret returned only at creation time, 403 `ip_not_allowed` on disallowed calls, up to a minute for allowlist changes to propagate, 409 on changed payload or deleted key, and the `apikeys:write` scope requirement. But it claims replay semantics that a reader may read as conditional idempotency even though the annotations say `idempotentHint=false`; the description does not resolve that apparent tension, which matters for a write tool. The `idempotency_key` and `allowed_ips` details are also largely duplicated in the schema, which weakens the value added here.

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

Conciseness3/5

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

It covers essential information, but the idempotency guidance is repeated word for word ("Reuse idempotency_key with identical arguments after uncertain results" and then the closing "Supply idempotency_key and reuse it with identical arguments on retries"). The IP-allowlist constraints also restate what is already in the `allowed_ips` schema description, so the paragraph is longer than it needs to be for the value it adds.

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?

For a credential-minting mutation with real security consequences, it covers the safety-critical facts an agent needs: what is returned and when, the required scope, error codes, propagation delay, and retry-safety semantics. Because an output schema exists, it doesn't need to explain return values, so what remains is complete.

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?

Schema coverage is 83%, so the schema already carries most parameter documentation. The description still adds real semantic weight: public-address-only rules, the /8 and /16 width caps, the 100-entry limit, what an empty list means, and the security rationale for `return_secret`. The phrase "returned only on initial creation when return_secret is not false" is slightly ambiguous about default behavior and conflicts with the schema's declared default of false.

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

Purpose4/5

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

"Mints a runtime API key for the project" gives a specific verb and resource, and the description distinguishes the create path from call_model ("call_model uses the returned key ID") and from the CLI path. It stops short of naming how it differs from create_organization_personal_key, even though the `kind` parameter says it can mint personal keys too, which leaves a small gap for sibling selection.

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?

Gives concrete when-to-use guidance for the most consequential choice: keep `return_secret` false by default and set it true only under stated conditions, plus a clear "use opper keys create instead" path for local app setup. It also explains when to reuse `idempotency_key` and what a replay returns. It does not say when to choose this over update_api_key or list_api_keys, but those are aimed at different lifecycle stages, so it is not misleading.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources