provider_keys
Store, list, test, and remove encrypted model provider API keys, falling back to environment variables. Never returns keys, only hints and source.
Instructions
Model provider keys stored encrypted (table provider_keys; the portal's
Settings > Model keys). A stored key is used before the provider's
environment variable (GOOGLE_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY,
AZURE_OPENAI_API_KEY). No action ever returns a key: only its hint (last
four characters), who set it and when.
action: list (per provider: source = portal | environment | none, the
stored default key and named credentials; can_store is false, with the
reason in problem, when the server has no SECRET_KEY) | set (provider +
value, optional name; refused when SECRET_KEY is unset: a key is never
stored as plain text) | remove (provider, optional name, confirm=true;
the provider falls back to its environment variable) | test (provider,
optional name: asks the provider for its model list and returns
{ok, source, detail}, with the provider's own error on failure).
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": {
"action": "<action>"
},
"name": "provider_keys"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Config branch: which `environment` rows of the AI config DB to read/write. staging = the editable working set (default); prod = what production serves. | staging |
| name | No | '' = the provider's default key. A name stores a second, named credential that a model selects with extra_config.credential. | |
| value | No | set: the key to store. It is encrypted and never returned by any tool. | |
| action | Yes | list = where each provider's key comes from; set = store or replace a key; remove = delete a stored key; test = one free call to the provider with the key in use. | |
| confirm | No | false (default) = dry run: report what WOULD change and change nothing. true = execute. | |
| provider | No | google_genai | openai | anthropic | azure_openai. Required for set, remove and test. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |