data/api_keys.json and persist across server restarts.
GET /settings/providers
Return the list of all known providers and whether each one is currently configured with a working API key.Response
One entry per supported provider. Each object contains the fields below.
Machine-readable provider identifier. One of:
"gemini", "anthropic", "groq", "openrouter".Human-readable provider name (e.g.
"Google Gemini", "Anthropic Claude").true when a valid API key is stored and the provider client initialised successfully.A masked representation of the stored key (e.g.
"sk-a…b1c2"), or an empty string when no key is set. The full key is never returned.Example
POST /settings/keys/save
Save or update the API key for a provider. GridOS immediately attempts to initialise the provider client with the supplied key, so you get instant feedback if the key is syntactically invalid or the provider SDK is unavailable.Request
The provider to configure. Accepted values:
"gemini", "anthropic", "groq", "openrouter".The API key string. Must be a non-empty string. The key is persisted to
data/api_keys.json and survives server restarts.Response
"Success" when the key was saved and the provider client initialised.The provider ID that was updated.
true when the provider client is now active and ready to handle requests.Errors
| Status | Meaning |
|---|---|
400 | The provider value is not recognised, the api_key is empty, or the provider SDK could not be initialised with the supplied key. |
Example
If you have a key set via an environment variable (e.g.
ANTHROPIC_API_KEY), saving a key via this endpoint takes precedence and persists it to disk. Environment-variable keys are used only as a fallback when no disk key is present.DELETE /settings/keys/
Remove the stored API key for a provider. The provider client is torn down immediately. Subsequent agent calls that require this provider will fail until a new key is saved.Path Parameters
The provider whose key you want to remove. Accepted values:
"gemini", "anthropic", "groq", "openrouter".Response
"Success" when the key was removed (or when no key was present for the provider — the operation is idempotent).The provider ID that was targeted.
Errors
| Status | Meaning |
|---|---|
400 | The provider_id is not a recognised provider. |
Example
GET /models/available
List every model in the GridOS model catalog, annotated with whether it is currently available (i.e. its provider has a configured key). Also returns the resolved default model ID and the set of configured provider IDs.Response
Every model in the catalog. Each entry includes at minimum
id, provider, and available (true / false).The model ID that GridOS will use when no explicit model is requested and multiple providers are configured.
null when no provider is configured.Sorted list of provider IDs that currently have a working key.
Example
Pass a
model_id from this list in the model_id field of POST /agent/chat or POST /agent/chat/chain to pin a specific model for a conversation. If the model’s provider is not configured, GridOS falls back to the default model automatically.