Overview
Configure model providers for your VM0 agents
VM0 agents use model providers to connect to AI models. The model provider system securely stores your credentials and automatically injects them when running agents.
Quick Start
Configure a model provider with a single command:
vm0 model-provider setupThis interactive command will:
- Show available provider types
- Prompt for your credential (API key or OAuth token)
- Allow model selection (for providers that support it)
- Store credentials securely on the VM0 platform
Once configured, credentials are automatically injected when running agents.
Available Providers
| Provider | Type | Models | How to Get Credential |
|---|---|---|---|
| Claude (OAuth) | claude-code-oauth-token | Latest Claude | Run claude setup-token |
| Claude (API) | anthropic-api-key | Latest Claude | Anthropic Console |
| OpenRouter | openrouter-api-key | Claude Sonnet/Opus/Haiku | OpenRouter Keys |
| Moonshot | moonshot-api-key | Kimi K2 models | Moonshot Platform |
| MiniMax | minimax-api-key | MiniMax-M2.1 | MiniMax Platform |
| DeepSeek | deepseek-api-key | deepseek-chat | DeepSeek Platform |
| Z.AI | zai-api-key | GLM-4.7, GLM-4.5-Air | Z.AI Platform |
| Azure Foundry | azure-foundry | Custom | Azure Portal |
| AWS Bedrock | aws-bedrock | Custom | AWS Console |
Azure Foundry and AWS Bedrock are experimental features with multi-credential authentication.
Non-Interactive Setup
For CI/CD or scripting, provide credentials via flags:
# Simple providers (single credential)
vm0 model-provider setup --type anthropic-api-key --secret "sk-xxx"
# With model selection
vm0 model-provider setup --type openrouter-api-key --secret "sk-xxx" --model "anthropic/claude-sonnet-4.5"Model Selection
Some providers support choosing specific models. During setup, you'll be prompted to select a model:
| Provider | Available Models | Default |
|---|---|---|
| OpenRouter | anthropic/claude-sonnet-4.5, anthropic/claude-opus-4.5, anthropic/claude-haiku-4.5 | auto |
| Moonshot | kimi-k2.5, kimi-k2-thinking-turbo, kimi-k2-thinking | kimi-k2.5 |
| Z.AI | GLM-4.7, GLM-4.5-Air | GLM-4.7 |
| MiniMax | MiniMax-M2.1 | MiniMax-M2.1 |
| DeepSeek | deepseek-chat | deepseek-chat |
| Azure Foundry | Custom input | - |
| AWS Bedrock | Custom input | - |
Managing Model Providers
# List all configured providers
vm0 model-provider list
# Set a provider as default
vm0 model-provider set-default openrouter-api-key
# Delete a provider
vm0 model-provider delete anthropic-api-keyHow Credential Injection Works
When you run an agent:
- If your
vm0.yamlhas explicit auth environment variables, those are used - Otherwise, your default model provider credential is injected automatically
- You can override at runtime with:
vm0 run agent "prompt" --model-provider <type>
Runtime Override
Override your default provider for a single run:
vm0 run my-agent "build a todo app" --model-provider openrouter-api-keyAdvanced: Manual Configuration
For most users, vm0 model-provider setup is the recommended approach. Manual configuration is only needed for advanced use cases.
If you need per-agent authentication overrides or custom configurations, you can set environment variables directly in your vm0.yaml:
version: "1.0"
agents:
my-agent:
framework: claude-code
environment:
ANTHROPIC_BASE_URL: "https://api.example.com/anthropic"
ANTHROPIC_AUTH_TOKEN: "${{ secrets.MY_API_KEY }}"
ANTHROPIC_MODEL: "model-name"See individual provider pages for specific environment variable details.