Configuration Structure
API key for this provider. Stored securely and never logged.Can be set via environment variable:
GRIP_PROVIDERS__{NAME}__API_KEYCustom API base URL. Leave empty to use the provider’s default endpoint.
Default model when using this provider. Optional.
Supported Providers
Cloud Providers
OpenRouter
OpenRouter
Best for: Access to 100+ models from multiple providersPopular models:
OpenRouter API key from https://openrouter.ai/keys
openrouter/anthropic/claude-opus-4.6openrouter/anthropic/claude-sonnet-4.6openrouter/openai/gpt-5.2openrouter/google/gemini-2.5-proopenrouter/x-ai/grok-4.1-fast
https://openrouter.ai/api/v1Anthropic
Anthropic
Best for: Claude models directly from AnthropicAvailable models:
Anthropic API key from https://console.anthropic.com/
anthropic/claude-sonnet-4-20250514anthropic/claude-haiku-4-5-20251001anthropic/claude-opus-4-6(via OpenRouter)
https://api.anthropic.com/v1OpenAI
OpenAI
Best for: GPT models and o1 reasoning modelsAvailable models:
OpenAI API key from https://platform.openai.com/api-keys
openai/gpt-4oopenai/gpt-4o-miniopenai/o1
https://api.openai.com/v1DeepSeek
DeepSeek
Best for: Cost-effective reasoning modelsAvailable models:
DeepSeek API key from https://platform.deepseek.com/
deepseek/deepseek-chatdeepseek/deepseek-reasoner
https://api.deepseek.com/v1Groq
Groq
Best for: Ultra-fast inference with LPU accelerationAvailable models:
Groq API key from https://console.groq.com/
groq/llama-3.3-70b-versatilegroq/mixtral-8x7b-32768
https://api.groq.com/openai/v1Google Gemini
Google Gemini
Best for: Multimodal models with large context windowsAvailable models:
Google AI Studio API key from https://aistudio.google.com/
gemini/gemini-2.5-progemini/gemini-2.5-flash
https://generativelanguage.googleapis.com/v1beta/openaiQwen (DashScope)
Qwen (DashScope)
Best for: Chinese language tasks and Alibaba Cloud integrationAvailable models:
DashScope API key from https://dashscope.console.aliyun.com/
qwen/qwen-maxqwen/qwen-turbo
https://dashscope.aliyuncs.com/compatible-mode/v1MiniMax
MiniMax
Best for: Chinese language modelsAvailable models:
MiniMax API key from https://api.minimax.chat/
minimax/abab6.5s-chat
https://api.minimax.chat/v1Moonshot / Kimi
Moonshot / Kimi
Best for: Long-context Chinese language modelsAvailable models:
Moonshot API key from https://platform.moonshot.cn/
moonshot/moonshot-v1-128k
https://api.moonshot.cn/v1Ollama (Cloud)
Ollama (Cloud)
Best for: Cloud-hosted Ollama modelsAvailable models:
Ollama API key from https://ollama.com/
ollama_cloud/llama3.3ollama_cloud/qwen2.5ollama_cloud/deepseek-r1ollama_cloud/mistral
https://ollama.com/v1Local Providers
Ollama (Local)
Ollama (Local)
Best for: Privacy-focused local inferenceNo API key required. Connects to local Ollama instance.Available models: Any model installed via
ollama pullDefault API base: http://localhost:11434/v1Llama.cpp (Local)
Llama.cpp (Local)
Best for: CPU/GPU inference without dependenciesDefault API base:
http://localhost:8080/v1LM Studio (Local)
LM Studio (Local)
Best for: GUI-based local model managementNo API key required. Connects to LM Studio’s local server.Default API base:
http://localhost:1234/v1Setting API Keys
Via CLI (Recommended)
Via Environment Variables
Via Config File
Edit~/.grip/config.json:
Custom Providers (OpenAI-Compatible)
Grip supports any OpenAI-compatible API:Provider Detection
Grip uses two methods to detect providers:- Prefix-based:
anthropic/claude-sonnet-4→ Anthropic provider - Explicit:
--provider openrouteroragents.defaults.provider
Overriding Detection
Use explicit provider when model names are ambiguous:openai/gpt-oss-120b routes through OpenRouter instead of OpenAI.
SecretStr Fields
API keys use Pydantic’sSecretStr type for security:
- Never logged or printed
- Masked in error messages
- Scrubbed from tool outputs
- Serialized as plain text in config.json
The
SecretStr type provides runtime protection, but keys are stored unencrypted in config.json. For production, use environment variables or a secrets manager.Testing Provider Configuration
Best Practices
Security
Security
- Use environment variables for API keys in CI/CD
- Never commit
config.jsonwith API keys to version control - Rotate keys regularly
- Use separate keys for development and production
Cost Optimization
Cost Optimization
- Use OpenRouter for access to multiple providers with one key
- Set cheaper models in
model_tiers.lowfor simple tasks - Use local providers (Ollama) for development
- Monitor usage via provider dashboards
Reliability
Reliability
- Configure fallback providers in
model_tiers - Use OpenRouter for automatic failover
- Set
api_basefor self-hosted deployments - Test provider connectivity before deployment
Troubleshooting
Authentication Errors
Authentication Errors
Provider Not Found
Provider Not Found
- Verify provider name matches supported providers
- Check model prefix (e.g.,
anthropic/notclaude/) - Use explicit
--providerflag to override detection
Rate Limiting
Rate Limiting
- Switch to a different provider temporarily
- Use OpenRouter for automatic rate limit handling
- Configure
max_daily_tokensto control usage