create_key
Mint a new named API key; the plaintext is returned ONCE. Requires admin scope.
Delegate safely (WP-SCOPE): optional scopes (subset of read|spend|admin; omit for
full power) + daily_credit_cap (credits/day; omit for uncapped) hand a sub-agent a
key that can only do what you allow. Args: name (1-100), api_key (an admin-scoped
key). Returns {api_key (store it), prefix, name, scopes, daily_credit_cap,
created_at}. Errors: unauthorized, forbidden, invalid_request, rate_limited.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Label for the new key, 1-100 chars, shown by list_keys so you can tell delegated keys apart. Defaults to 'key'. | key |
| scopes | No | Powers the new key gets: read (free reads), spend (charged generate/score/remix), admin (key + account + webhook management). OMIT for a full-power key; pass a subset to hand a sub-agent strictly less power than you hold. | |
| api_key | No | API key for this call. Omit to fall back to the Authorization: Bearer / X-API-Key request header (streamable-HTTP only), then the VHGENGINE_API_KEY env var (the stdio default). No key resolvable -> unauthorized. | |
| daily_credit_cap | No | Credits this key may spend per UTC day, 1-100000; further charges on it are refused once reached (other keys are unaffected). Omit for uncapped. list_keys reports spent_today against this. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | The label you gave it. | |
| prefix | No | First 12 chars, used by list_keys / revoke_key / get_usage(key_prefix=...). | |
| scopes | No | Powers granted, a subset of read/spend/admin (all three = full power). | |
| api_key | No | The plaintext key. Store it now; it is never readable again. | |
| created_at | No | Creation time, ISO-8601 UTC. | |
| daily_credit_cap | No | Per-UTC-day spend ceiling, or null for uncapped. |