mini-swe-agent supports virtually every LLM provider through four backends: litellm (the default, covering OpenAI, Anthropic, Google, and dozens more), OpenRouter, Portkey, and Requesty. This page explains how to pick a provider, set your API key, and configure advanced options like reasoning effort and cost tracking.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/swe-agent/mini-swe-agent/llms.txt
Use this file to discover all available pages before exploring further.
Quick setup
The fastest way to get started is the interactive wizard, which sets your default model and API key in one step:mini. If you skipped it, run the command above. Your settings are saved to mini’s global config file and take effect for every subsequent run.
Manual configuration
You can also set or update individual values withmini-extra config set:
Always include the provider prefix in model names (e.g.,
anthropic/claude-..., openai/gpt-..., gemini/gemini-...). The prefix tells litellm which provider to route the request to.Provider setup
- Anthropic
- OpenAI
- Google (Gemini)
- OpenRouter
- Local models
Anthropic’s Claude models are the recommended choice for most tasks. mini-swe-agent automatically applies prompt caching for any model whose name contains
Set your API key:Set the default model:
anthropic, claude, sonnet, or opus.Recommended models:| Model | Use case |
|---|---|
anthropic/claude-opus-4-6-20260205 | Best overall quality; recommended for complex tasks |
anthropic/claude-sonnet-4-5-20250929 | Fast and cost-effective for everyday work |
anthropic/claude-haiku-4-5-20251001 | Fastest and cheapest; good for simple edits |
Environment variable reference
| Variable | Description |
|---|---|
MSWEA_MODEL_NAME | Default model used when no -m flag is passed to mini |
ANTHROPIC_API_KEY | API key for Anthropic models |
OPENAI_API_KEY | API key for OpenAI models |
GEMINI_API_KEY | API key for Google Gemini models |
OPENROUTER_API_KEY | API key for OpenRouter |
PORTKEY_API_KEY | API key for Portkey |
PORTKEY_VIRTUAL_KEY | Optional virtual key for Portkey routing |
MSWEA_COST_TRACKING | Set to ignore_errors to suppress cost tracking errors (useful for local/free models) |
MSWEA_GLOBAL_COST_LIMIT | Abort the agent if cumulative cost exceeds this amount in USD |
MSWEA_GLOBAL_CALL_LIMIT | Abort the agent after this many model calls |
LITELLM_MODEL_REGISTRY_PATH | Path to a JSON file that registers custom models with litellm |
DEEPSEEK_API_KEY, GROQ_API_KEY, MISTRAL_API_KEY). Run mini-extra config setup to be guided to the right one for your provider, or check the litellm providers list.
Advanced: extra model settings
To configure options like temperature or reasoning effort, edit your agent config file (the path is printed when you runmini). Open it quickly with: