Create a model key
create_keyCreate 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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| speed | No | The key's default speed (see Key.speed); null or left out for none. | |
| ioRatio | No | The 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. | |
| maxPrice | No | The key's default limit order (see Key.maxPrice); null or left out for none. | |
| minDiscount | No | The key's default minimum discount, 0 to 100 (see Key.minDiscount); null or left out for none. | |
| allowedModels | No | Limit the key to these model ids; null or empty for all. | |
| priceFallover | No | The key's price fall-over (see Key.priceFallover); null or left out for the default (on). | |
| idempotencyKey | No | Optional. A unique string so that repeating this call never creates twice. | |
| monthlyLimitUsd | No | Spend cap per calendar month; null or 0 for none. |