Skip to main content

List Models

Returns all available models from all connected providers. Compatible with the OpenAI Models API.

Request

No parameters required. Include authentication header.

Response Format

string
Always list
array
Array of model objects

Response Example

Examples

Model Naming Convention

With Provider Prefix

Models with provider prefixes explicitly route to that provider:

Without Provider Prefix

Models without prefixes allow auto-routing:
See Provider Prefixes for details.

Refresh Models

Trigger model re-discovery from all providers. Useful after adding new providers or models.

Request

string
Optional: Refresh only a specific provider (e.g., ollama, geminicli)

Examples

Response

Gemini Native API

For Gemini-specific clients, use the native endpoint:
Returns models in Gemini format with supportedGenerationMethods:

Filter by Provider Type

Use the provider status endpoint to filter models:
See Provider Prefixes for filtering options.

Model Capabilities

Different models support different features: ⚠️ = Model-dependent

Model Discovery

switchAILocal automatically discovers models from:
  1. Configuration File: Models defined in config.yaml
  2. CLI Providers: Models detected from installed CLI tools
  3. Local Servers: Models from Ollama, LM Studio
  4. API Providers: Models from authenticated API providers
  5. Dynamic Registration: Models registered at runtime

Discovery Sources

Troubleshooting

No Models Returned

Cause: No providers configured or authenticated Solution:
  1. Verify provider setup: Check config.yaml for API keys
  2. Test CLI tools: Run gemini --version, claude --version
  3. Check logs: Look for provider initialization errors
  4. Try refresh: POST /v1/models/refresh

Missing Specific Model

Cause: Provider not authenticated or model not available Solution:
  1. Verify provider access: Test CLI tool directly
  2. Check subscription: Ensure model is in your plan
  3. Refresh models: Force re-discovery
  4. Check spelling: Model IDs are case-sensitive

Stale Model List

Cause: Models cached from previous discovery Solution:

Next Steps

Provider Prefixes

Learn model routing and provider selection

Chat Completions

Use models for chat completions

Auto-Routing

Let switchAILocal choose the best provider