Set a model key's default gateway, community-supply switch or max price
update_keySet a model key's default gateway, community-supply switch or max price
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). 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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The key id. | |
| speed | No | The 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. | |
| gateway | No | The name of the gateway the key's requests run through by default (one of GET /gateways), or null for none. | |
| ioRatio | No | The 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. | |
| maxPrice | No | The 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. | |
| minDiscount | No | The 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. | |
| priceFallover | No | Whether 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. | |
| communitySupply | No | Whether community-supplied capacity may serve the key's requests; false keeps every request on our own routes. New requests follow within about a minute. |