Comma Agents
@comma-agents/daemonProtocol

Get Available Models

Query which models the user can use given their current credential configuration.

Whereas list_providers returns providers grouped by provider, get_available_models returns models grouped by model ID, with credential availability flags for each. This makes it ideal for UIs that present a model-first picker: "Which models can I actually use right now?"

Request: get_available_models

{
  "type": "get_available_models",
  "requestId": "models-1",
  "modelId": "gpt",
  "scope": "my-strategy"
}
FieldTypeRequiredDescription
type"get_available_models"yesMessage type discriminator
requestIdstringnoEchoed on the response for correlation
modelIdstringnoSubstring filter — only return models whose ID contains this string. Useful for narrowing a large catalog.
scopestringnoStrategy scope for credential resolution. When provided, strategy-scoped credentials are checked before falling back to environment variables and the global scope.

Response: available_models

{
  "type": "available_models",
  "models": [
    {
      "id": "gpt-4o",
      "name": "GPT-4o",
      "contextWindow": 128000,
      "capabilities": { "tools": true, "reasoning": true, "vision": true },
      "hasCredentials": true,
      "providers": ["github-copilot", "openai", "openrouter"],
      "configuredProviders": ["openai"]
    },
    {
      "id": "gpt-4o-mini",
      "name": "GPT-4o Mini",
      "contextWindow": 128000,
      "capabilities": { "tools": true, "vision": true },
      "hasCredentials": true,
      "providers": ["github-copilot", "openai", "openrouter"],
      "configuredProviders": ["github-copilot", "openai"]
    }
  ],
  "requestId": "models-1",
  "ts": "2025-01-15T10:30:05.000Z"
}
FieldTypeDescription
type"available_models"Message type discriminator
modelsAvailableModel[]Alphabetically sorted list of models from the catalog
requestIdstring?Echoed from the request
tsstringISO-8601 timestamp

AvailableModel

Each model entry includes all fields from ModelInfo plus the following credential-awareness fields:

FieldTypeDescription
hasCredentialsbooleantrue when at least one provider has a configured credential for this model
providersstring[]All provider IDs that list this model in the catalog
configuredProvidersstring[]Subset of providers that have a configured credential (env var, strategy scope, or global scope)

How It Works

The handler:

  1. Builds a reverse index from the models.dev catalog (modelId → providerId[]).
  2. For each model (optionally filtered by modelId), checks credential status for every provider.
  3. Returns the full catalog model metadata plus hasCredentials, providers, and configuredProviders.

Models are sorted alphabetically by ID. The response includes every model found in the catalog, not only those with credentials — hasCredentials lets the client decide what to show.

Comparison to list_providers

list_providersget_available_models
GroupingBy providerBy model
Credential infoPer provider (authStatus)Per model (hasCredentials, configuredProviders)
Use caseProvider config/debuggingModel picker UIs, "what can I use?" queries
Live discoverySupported (live: true)Not yet supported
Filteringscopescope + modelId

On this page