Skip to main content

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.

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.

Quick setup

The fastest way to get started is the interactive wizard, which sets your default model and API key in one step:
mini-extra config setup
This runs automatically the first time you launch 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 with mini-extra config set:
# Set the default model
mini-extra config set MSWEA_MODEL_NAME "anthropic/claude-opus-4-6-20260205"

# Set an API key
mini-extra config set ANTHROPIC_API_KEY "sk-ant-..."
Both values can also be exported as environment variables if you prefer not to use the config file:
export MSWEA_MODEL_NAME="anthropic/claude-opus-4-6-20260205"
export ANTHROPIC_API_KEY="sk-ant-..."
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’s Claude models are the recommended choice for most tasks. mini-swe-agent automatically applies prompt caching for any model whose name contains anthropic, claude, sonnet, or opus.Recommended models:
ModelUse case
anthropic/claude-opus-4-6-20260205Best overall quality; recommended for complex tasks
anthropic/claude-sonnet-4-5-20250929Fast and cost-effective for everyday work
anthropic/claude-haiku-4-5-20251001Fastest and cheapest; good for simple edits
Set your API key:
mini-extra config set ANTHROPIC_API_KEY "sk-ant-..."
Set the default model:
mini-extra config set MSWEA_MODEL_NAME "anthropic/claude-opus-4-6-20260205"

Environment variable reference

VariableDescription
MSWEA_MODEL_NAMEDefault model used when no -m flag is passed to mini
ANTHROPIC_API_KEYAPI key for Anthropic models
OPENAI_API_KEYAPI key for OpenAI models
GEMINI_API_KEYAPI key for Google Gemini models
OPENROUTER_API_KEYAPI key for OpenRouter
PORTKEY_API_KEYAPI key for Portkey
PORTKEY_VIRTUAL_KEYOptional virtual key for Portkey routing
MSWEA_COST_TRACKINGSet to ignore_errors to suppress cost tracking errors (useful for local/free models)
MSWEA_GLOBAL_COST_LIMITAbort the agent if cumulative cost exceeds this amount in USD
MSWEA_GLOBAL_CALL_LIMITAbort the agent after this many model calls
LITELLM_MODEL_REGISTRY_PATHPath to a JSON file that registers custom models with litellm
litellm supports dozens of additional API key variables (e.g., 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 run mini). Open it quickly with:
mini-extra config edit
Examples:
# Temperature (not supported by all models)
model:
  model_name: "anthropic/claude-sonnet-4-5-20250929"
  model_kwargs:
    temperature: 0.0
# GPT-5 with reasoning effort
model:
  model_name: "openai/gpt-5.4"
  model_kwargs:
    drop_params: true
    reasoning_effort: "high"
    verbosity: "medium"
# Portkey with a virtual key
model:
  model_name: "@openai/gpt-5.1"
  model_class: "portkey"
  model_kwargs:
    reasoning_effort: "medium"
    verbosity: "medium"

Build docs developers (and LLMs) love