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
array of objects
One entry per supported provider. Each object contains the fields below.
string
Machine-readable provider identifier. One of:
"gemini", "anthropic", "groq", "openrouter".string
Human-readable provider name (e.g.
"Google Gemini", "Anthropic Claude").boolean
true when a valid API key is stored and the provider client initialised successfully.string
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
string
required
The provider to configure. Accepted values:
"gemini", "anthropic", "groq", "openrouter".string
required
The API key string. Must be a non-empty string. The key is persisted to
data/api_keys.json and survives server restarts.Response
string
"Success" when the key was saved and the provider client initialised.string
The provider ID that was updated.
boolean
true when the provider client is now active and ready to handle requests.Errors
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
string
required
The provider whose key you want to remove. Accepted values:
"gemini", "anthropic", "groq", "openrouter".Response
string
"Success" when the key was removed (or when no key was present for the provider — the operation is idempotent).string
The provider ID that was targeted.
Errors
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
array of objects
Every model in the catalog. Each entry includes at minimum
id, provider, and available (true / false).string
The model ID that GridOS will use when no explicit model is requested and multiple providers are configured.
null when no provider is configured.array of strings
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.