Skip to main content
Glama

Set a model key's gateway, supply, price, speed or input:output ratio

update_key
Destructive

Set a model key's gateway, supply, price, speed or input:output ratio

Changes one of the account's own model keys: gateway sets or clears the gateway it runs through by default (a gateway's name from the list_gateways tool, or null for none; requests on the key then go through it, and a request naming another with the x-klinn-gateway header is refused with 403 gateway_locked), communitySupply sets whether community-supplied capacity may serve its requests (false keeps every request on our own routes), and maxPrice sets or clears its default limit order ({input, output, cache} USD per 1M tokens; prompt, completion and input_cache_read are accepted too: a request nothing in the market is within is refused with 422 no_offer_under_limit and billed nothing). minDiscount sets or clears its default minimum discount (0 to 100: its requests are served only at least that many percent under a model's list price; the same 422 when nothing in the market is). speed sets or clears its default speed ({sort, minThroughput, maxLatencySecs}: a request's own settings and its gateway's come first; see /docs/speed). priceFallover sets whether its requests may go to a dearer source when none can serve them at the model's price (false keeps them at the model's price, null returns to the default, on; see /docs/errors#fallover). ioRatio sets or clears its expected input:output ratio (a number such as 15, or a string such as "15:1" or "1:4": routes are ranked at the prompt divided by it instead of at max_tokens; a request's own x-klinn-io-ratio header and its gateway's io_ratio come first; see /docs/speed#io-ratio). Each field changes only when given; give at least one. New requests follow within about a minute. A name no gateway of yours has is 400 invalid_request; a revoked key, a customer's key or an unknown id is 404. Returns the key.

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": {
      "id": "<id>"
    },
    "name": "update_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe key id.
speedNoThe key's default speed ({sort, minThroughput, maxLatencySecs}); null clears it. A request's own settings and its gateway's come first. New requests follow within about a minute.
gatewayNoThe name of the gateway the key's requests run through by default (one of GET /gateways), or null for none.
ioRatioNoThe key's expected input:output ratio, as a number of input tokens per output token (15) or a string such as "15:1" or "1:4"; null clears it. A request's own x-klinn-io-ratio header and its gateway's io_ratio come first. New requests follow within about a minute.
maxPriceNoThe key's default limit order: the most its requests are billed per 1M tokens, per leg; null clears it. A request's own limit and its gateway's come first. New requests follow within about a minute.
minDiscountNoThe key's default minimum discount, 0 to 100: its requests are served only at least this many percent under a model's list price; null clears it. A request's own and its gateway's can only make it stricter. New requests follow within about a minute.
priceFalloverNoWhether the key's requests may go to a dearer source when none can serve them at the model's price: false keeps them at the model's price, true allows it, null returns to the default (on). The request's own allow_price_fallover setting, and any price limit, come first. New requests follow within about a minute.
communitySupplyNoWhether community-supplied capacity may serve the key's requests; false keeps every request on our own routes. New requests follow within about a minute.

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?

The annotations already declare destructive=true and readOnly=false, and the description adds substantial behavior beyond that: specific 400/404/403/422 error cases, billing behavior for rejected requests, precedence rules for request and gateway settings, propagation timing, and the fact that it returns the key. This gives the agent a rich operational picture.

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?

The purpose is front-loaded and the length is defensible for an eight-parameter mutation with many nested options. However, it is delivered as one dense paragraph with noticeable duplication of schema descriptions, which makes it harder to scan than it could be.

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?

The description covers all eight parameters, clearing behavior, request-versus-gateway precedence, timing, and important error outcomes. Because there is no output schema, the single sentence 'Returns the key' is slightly thin, but otherwise the definition is complete for a complex mutation tool.

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 100%, so the schema already documents all eight parameters and the description largely restates those details. It still adds useful semantics beyond the schema, including that gateway names come from list_gateways, the 403 gateway_locked case when a request names another gateway, and 404 behavior for revoked/customer/unknown keys.

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 title and opening sentence state a specific verb (Set/Changes) and resource (one of the account's own model keys), then enumerate the mutable fields. This clearly distinguishes the tool as key-level configuration rather than gateway, account, customer or budget configuration.

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 explains the context (the account's own model keys), the partial-update rule (each field changes only when given; give at least one), and points to list_gateways for gateway names. It does not explicitly say when to use this instead of update_gateway or set_key_budget, so it falls short of full when-to-use/when-not-to-use guidance.

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