Skip to main content
Glama

Create a model key

create_key
Destructive

Create a model key

Creates a model key for the account itself. The secret is returned once, in this response; a replay with the same Idempotency-Key returns the key with secret: null. Customer keys are created under /customers/{id}/keys. maxPrice gives it a default limit order (the most its requests are billed per 1M tokens), minDiscount a default minimum discount (its requests are served only at least that many percent under a model's list price), and speed a default speed (how its requests pick among routes: cheapest, balanced, fastest or a custom floor and ceiling; see /docs/speed). At most 500 model keys per account, and 1,000 new ones a day (revoked ones count): past either, 409 limit_reached.

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>"
    },
    "name": "create_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
speedNoThe key's default speed (see Key.speed); null or left out for none.
ioRatioNoThe key's expected input:output ratio (see Key.ioRatio), as a number of input tokens per output token or a string such as "15:1"; null or left out for none.
maxPriceNoThe key's default limit order (see Key.maxPrice); null or left out for none.
minDiscountNoThe key's default minimum discount, 0 to 100 (see Key.minDiscount); null or left out for none.
allowedModelsNoLimit the key to these model ids; null or empty for all.
priceFalloverNoThe key's price fall-over (see Key.priceFallover); null or left out for the default (on).
idempotencyKeyNoOptional. A unique string so that repeating this call never creates twice.
monthlyLimitUsdNoSpend cap per calendar month; null or 0 for none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations, it discloses the one-time secret return, the idempotency replay behavior (secret: null), hard quotas (500 keys per account, 1,000 new per day, revoked ones counting) and the resulting 409 limit_reached, plus 400 on conflicting price leg names and 422 no_offer_under_limit. That is substantial operational context the structured fields do not carry.

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

Conciseness4/5

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

Purpose and the account-vs-customer distinction are front-loaded, followed by parameter semantics and limits. The middle sentences are dense and run long, but essentially every clause carries information an agent would otherwise have to guess.

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?

For a nine-parameter creation tool with no output schema, the description covers return shape (secret once), limits, and key error codes, which is enough to call it safely. It stops short of stating auth requirements or what fields besides secret come back, but the essential picture 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 already 89%, so the baseline is 3; the description goes further by explaining what maxPrice, minDiscount and speed mean as defaults inherited by the key's requests, and links speed to /docs/speed. It adds real semantic meaning for the highest-impact optional parameters.

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 opens with a specific verb and resource, then immediately scopes it: "Creates a model key for the account itself," and explicitly contrasts that with customer keys created under /customers/{id}/keys. An agent can distinguish this from create_customer_key without opening either schema.

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?

It clearly states the account-level context and points to the customer-scoped alternative, so selection between the two is well supported. It doesn't cover other adjacent operations such as update_key or budget tools, but the core when-to-use guidance is present.

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