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), speed a default speed (how its requests pick among routes: cheapest, balanced, fastest or a custom floor and ceiling; see /docs/speed), and ioRatio its expected input:output ratio (15 or "15:1": routes are ranked at the prompt divided by it instead of at max_tokens; see /docs/speed#io-ratio). 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?

Goes well beyond the annotations: discloses that the `secret` is returned exactly once and that an Idempotency-Key replay yields `secret: null`, and states both quota limits with the resulting 409 limit_reached. That is exactly the operational context an agent needs before a mutation that the destructiveHint/readOnlyHint flags cannot convey.

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?

Front-loads the single most important fact (secret returned once) before the parameter narrative, and each sentence carries information. It is dense and long for a single paragraph, and the per-parameter clauses could be more scannable, but nothing is filler.

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 9-parameter mutation with no output schema, the description covers defaults, one-shot secret disclosure, idempotent replay behavior, quotas and the failure code. It leaves out only response shape beyond `secret` and any auth/permission requirements.

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, but the description adds conceptual meaning the schema only gestures at: maxPrice as a default limit order billed per 1M tokens, minDiscount as a percentage under list price, speed as a routing policy (cheapest/balanced/fastest or custom), and ioRatio as prompt-divided ranking. It explains intent rather than restating field constraints.

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?

States a specific verb and resource ('Creates a model key') and immediately scopes it to the account itself, then contrasts that with customer keys 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?

Clearly frames the account-level use case and points to the customer-key path for the alternative case, plus gives hard ceilings (500 keys/account, 1,000/day) that tell an agent when a call will fail. It does not name the sibling tool create_customer_key explicitly, leaving the agent to map the path to the tool.

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