# 🔌 Provedores e Configuração de Modelos > Voltar ao [README](../../README.pt-br.md) ### Provedores > [!NOTE] > O Groq fornece transcrição de voz gratuita via Whisper. Se configurado, mensagens de áudio de qualquer canal serão automaticamente transcritas no nível do agente. | Provider | Purpose | Get API Key | | ------------ | --------------------------------------- | ------------------------------------------------------------ | | `gemini` | LLM (Gemini direct) | [aistudio.google.com](https://aistudio.google.com) | | `zhipu` | LLM (Zhipu direct) | [bigmodel.cn](https://bigmodel.cn) | | `volcengine` | LLM(Volcengine direct) | [volcengine.com](https://www.volcengine.com/activity/codingplan?utm_campaign=PicoClaw&utm_content=PicoClaw&utm_medium=devrel&utm_source=OWO&utm_term=PicoClaw) | | `openrouter` | LLM (recommended, access to all models) | [openrouter.ai](https://openrouter.ai) | | `anthropic` | LLM (Claude direct) | [console.anthropic.com](https://console.anthropic.com) | | `openai` | LLM (GPT direct) | [platform.openai.com](https://platform.openai.com) | | `deepseek` | LLM (DeepSeek direct) | [platform.deepseek.com](https://platform.deepseek.com) | | `qwen` | LLM (Qwen direct) | [dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) | | `groq` | LLM + **Voice transcription** (Whisper) | [console.groq.com](https://console.groq.com) | | `cerebras` | LLM (Cerebras direct) | [cerebras.ai](https://cerebras.ai) | | `vivgrid` | LLM (Vivgrid direct) | [vivgrid.com](https://vivgrid.com) | | `moonshot` | LLM (Kimi/Moonshot direct) | [platform.moonshot.cn](https://platform.moonshot.cn) | | `minimax` | LLM (Minimax direct) | [platform.minimaxi.com](https://platform.minimaxi.com) | | `avian` | LLM (Avian direct) | [avian.io](https://avian.io) | | `mistral` | LLM (Mistral direct) | [console.mistral.ai](https://console.mistral.ai) | | `longcat` | LLM (Longcat direct) | [longcat.ai](https://longcat.ai) | | `modelscope` | LLM (ModelScope direct) | [modelscope.cn](https://modelscope.cn) | ### Configuração de Modelos (model_list) > **Novidade?** O PicoClaw agora usa uma abordagem de configuração **centrada no modelo**. Basta especificar o formato `vendor/model` (ex.: `zhipu/glm-4.7`) para adicionar novos provedores — **sem necessidade de alteração de código!** Este design também permite **suporte multi-agente** com seleção flexível de provedores: - **Agentes diferentes, provedores diferentes**: Cada agente pode usar seu próprio provedor LLM - **Fallback de modelos**: Configure modelos primários e de fallback para resiliência - **Balanceamento de carga**: Distribua requisições entre múltiplos endpoints - **Configuração centralizada**: Gerencie todos os provedores em um só lugar #### 📋 Todos os Vendors Suportados | Vendor | `model` Prefix | Default API Base | Protocol | API Key | | ------------------- | ----------------- |-----------------------------------------------------| --------- | ---------------------------------------------------------------- | | **OpenAI** | `openai/` | `https://api.openai.com/v1` | OpenAI | [Get Key](https://platform.openai.com) | | **Anthropic** | `anthropic/` | `https://api.anthropic.com/v1` | Anthropic | [Get Key](https://console.anthropic.com) | | **智谱 AI (GLM)** | `zhipu/` | `https://open.bigmodel.cn/api/paas/v4` | OpenAI | [Get Key](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys) | | **DeepSeek** | `deepseek/` | `https://api.deepseek.com/v1` | OpenAI | [Get Key](https://platform.deepseek.com) | | **Google Gemini** | `gemini/` | `https://generativelanguage.googleapis.com/v1beta` | OpenAI | [Get Key](https://aistudio.google.com/api-keys) | | **Groq** | `groq/` | `https://api.groq.com/openai/v1` | OpenAI | [Get Key](https://console.groq.com) | | **Moonshot** | `moonshot/` | `https://api.moonshot.cn/v1` | OpenAI | [Get Key](https://platform.moonshot.cn) | | **通义千问 (Qwen)** | `qwen/` | `https://dashscope.aliyuncs.com/compatible-mode/v1` | OpenAI | [Get Key](https://dashscope.console.aliyun.com) | | **NVIDIA** | `nvidia/` | `https://integrate.api.nvidia.com/v1` | OpenAI | [Get Key](https://build.nvidia.com) | | **Ollama** | `ollama/` | `http://localhost:11434/v1` | OpenAI | Local (no key needed) | | **OpenRouter** | `openrouter/` | `https://openrouter.ai/api/v1` | OpenAI | [Get Key](https://openrouter.ai/keys) | | **LiteLLM Proxy** | `litellm/` | `http://localhost:4000/v1` | OpenAI | Your LiteLLM proxy key | | **VLLM** | `vllm/` | `http://localhost:8000/v1` | OpenAI | Local | | **Cerebras** | `cerebras/` | `https://api.cerebras.ai/v1` | OpenAI | [Get Key](https://cerebras.ai) | | **VolcEngine (Doubao)** | `volcengine/` | `https://ark.cn-beijing.volces.com/api/v3` | OpenAI | [Get Key](https://www.volcengine.com/activity/codingplan?utm_campaign=PicoClaw&utm_content=PicoClaw&utm_medium=devrel&utm_source=OWO&utm_term=PicoClaw) | | **神算云** | `shengsuanyun/` | `https://router.shengsuanyun.com/api/v1` | OpenAI | - | | **BytePlus** | `byteplus/` | `https://ark.ap-southeast.bytepluses.com/api/v3` | OpenAI | [Get Key](https://www.byteplus.com) | | **Vivgrid** | `vivgrid/` | `https://api.vivgrid.com/v1` | OpenAI | [Get Key](https://vivgrid.com) | | **LongCat** | `longcat/` | `https://api.longcat.chat/openai` | OpenAI | [Get Key](https://longcat.chat/platform) | | **ModelScope (魔搭)**| `modelscope/` | `https://api-inference.modelscope.cn/v1` | OpenAI | [Get Token](https://modelscope.cn/my/tokens) | | **Antigravity** | `antigravity/` | Google Cloud | Custom | OAuth only | | **GitHub Copilot** | `github-copilot/` | `localhost:4321` | gRPC | - | #### Configuração Básica ```json { "model_list": [ { "model_name": "ark-code-latest", "model": "volcengine/ark-code-latest", "api_key": "sk-your-api-key" }, { "model_name": "gpt-5.4", "model": "openai/gpt-5.4", "api_key": "sk-your-openai-key" }, { "model_name": "claude-sonnet-4.6", "model": "anthropic/claude-sonnet-4.6", "api_key": "sk-ant-your-key" }, { "model_name": "glm-4.7", "model": "zhipu/glm-4.7", "api_key": "your-zhipu-key" } ], "agents": { "defaults": { "model_name": "gpt-5.4" } } } ``` #### Exemplos por Vendor **OpenAI** ```json { "model_name": "gpt-5.4", "model": "openai/gpt-5.4", "api_key": "sk-..." } ``` **VolcEngine (Doubao)** ```json { "model_name": "ark-code-latest", "model": "volcengine/ark-code-latest", "api_key": "sk-..." } ``` **智谱 AI (GLM)** ```json { "model_name": "glm-4.7", "model": "zhipu/glm-4.7", "api_key": "your-key" } ``` **DeepSeek** ```json { "model_name": "deepseek-chat", "model": "deepseek/deepseek-chat", "api_key": "sk-..." } ``` **Anthropic (com chave de API)** ```json { "model_name": "claude-sonnet-4.6", "model": "anthropic/claude-sonnet-4.6", "api_key": "sk-ant-your-key" } ``` > Execute `picoclaw auth login --provider anthropic` para colar seu token de API. **Anthropic Messages API (formato nativo)** Para acesso direto à API Anthropic ou endpoints personalizados que suportam apenas o formato de mensagem nativo da Anthropic: ```json { "model_name": "claude-opus-4-6", "model": "anthropic-messages/claude-opus-4-6", "api_key": "sk-ant-your-key", "api_base": "https://api.anthropic.com" } ``` > Use o protocolo `anthropic-messages` quando: > - Usar proxies de terceiros que suportam apenas o endpoint nativo `/v1/messages` da Anthropic (não o compatível com OpenAI `/v1/chat/completions`) > - Conectar a serviços como MiniMax, Synthetic que requerem o formato de mensagem nativo da Anthropic > - O protocolo `anthropic` existente retorna erros 404 (indicando que o endpoint não suporta formato compatível com OpenAI) > > **Nota:** O protocolo `anthropic` usa formato compatível com OpenAI (`/v1/chat/completions`), enquanto `anthropic-messages` usa o formato nativo da Anthropic (`/v1/messages`). Escolha com base no formato suportado pelo seu endpoint. **Ollama (local)** ```json { "model_name": "llama3", "model": "ollama/llama3" } ``` **Proxy/API Personalizado** ```json { "model_name": "my-custom-model", "model": "openai/custom-model", "api_base": "https://my-proxy.com/v1", "api_key": "sk-...", "request_timeout": 300 } ``` **LiteLLM Proxy** ```json { "model_name": "lite-gpt4", "model": "litellm/lite-gpt4", "api_base": "http://localhost:4000/v1", "api_key": "sk-..." } ``` O PicoClaw remove apenas o prefixo externo `litellm/` antes de enviar a requisição, então aliases de proxy como `litellm/lite-gpt4` enviam `lite-gpt4`, enquanto `litellm/openai/gpt-4o` envia `openai/gpt-4o`. #### Balanceamento de Carga Configure múltiplos endpoints para o mesmo nome de modelo — o PicoClaw fará automaticamente round-robin entre eles: ```json { "model_list": [ { "model_name": "gpt-5.4", "model": "openai/gpt-5.4", "api_base": "https://api1.example.com/v1", "api_key": "sk-key1" }, { "model_name": "gpt-5.4", "model": "openai/gpt-5.4", "api_base": "https://api2.example.com/v1", "api_key": "sk-key2" } ] } ``` #### Migração da Configuração Legacy `providers` A configuração antiga `providers` está **descontinuada** mas ainda é suportada para compatibilidade retroativa. **Configuração Antiga (descontinuada):** ```json { "providers": { "zhipu": { "api_key": "your-key", "api_base": "https://open.bigmodel.cn/api/paas/v4" } }, "agents": { "defaults": { "provider": "zhipu", "model": "glm-4.7" } } } ``` **Configuração Nova (recomendada):** ```json { "model_list": [ { "model_name": "glm-4.7", "model": "zhipu/glm-4.7", "api_key": "your-key" } ], "agents": { "defaults": { "model_name": "glm-4.7" } } } ``` Para guia de migração detalhado, veja [migration/model-list-migration.md](../migration/model-list-migration.md). ### Arquitetura de Provedores O PicoClaw roteia provedores por família de protocolo: - Protocolo compatível com OpenAI: OpenRouter, gateways compatíveis com OpenAI, Groq, Zhipu e endpoints estilo vLLM. - Protocolo Anthropic: Comportamento nativo da API Claude. - Caminho Codex/OAuth: Rota de autenticação OAuth/token da OpenAI. Isso mantém o runtime leve enquanto torna novos backends compatíveis com OpenAI basicamente uma operação de configuração (`api_base` + `api_key`).
Zhipu **1. Obter chave de API e URL base** * Obtenha a [chave de API](https://bigmodel.cn/usercenter/proj-mgmt/apikeys) **2. Configurar** ```json { "agents": { "defaults": { "workspace": "~/.picoclaw/workspace", "model_name": "glm-4.7", "max_tokens": 8192, "temperature": 0.7, "max_tool_iterations": 20 } }, "providers": { "zhipu": { "api_key": "Your API Key", "api_base": "https://open.bigmodel.cn/api/paas/v4" } } } ``` **3. Executar** ```bash picoclaw agent -m "Hello" ```
Exemplo de configuração completa ```json { "agents": { "defaults": { "model_name": "anthropic/claude-opus-4-5" } }, "session": { "dm_scope": "per-channel-peer" }, "providers": { "openrouter": { "api_key": "sk-or-v1-xxx" }, "groq": { "api_key": "gsk_xxx" } }, "channels": { "telegram": { "enabled": true, "token": "123456:ABC...", "allow_from": ["123456789"] }, "discord": { "enabled": true, "token": "", "allow_from": [""] }, "whatsapp": { "enabled": false, "bridge_url": "ws://localhost:3001", "use_native": false, "session_store_path": "", "allow_from": [] }, "feishu": { "enabled": false, "app_id": "cli_xxx", "app_secret": "xxx", "encrypt_key": "", "verification_token": "", "allow_from": [] }, "qq": { "enabled": false, "app_id": "", "app_secret": "", "allow_from": [] } }, "tools": { "web": { "brave": { "enabled": false, "api_key": "BSA...", "max_results": 5 }, "duckduckgo": { "enabled": true, "max_results": 5 }, "perplexity": { "enabled": false, "api_key": "", "max_results": 5 }, "searxng": { "enabled": false, "base_url": "http://localhost:8888", "max_results": 5 } }, "cron": { "exec_timeout_minutes": 5 } }, "heartbeat": { "enabled": true, "interval": 30 } } ```
--- ## 📝 Comparação de Chaves de API | Service | Pricing | Use Case | | ---------------- | ------------------------ | ------------------------------------- | | **OpenRouter** | Free: 200K tokens/month | Multiple models (Claude, GPT-4, etc.) | | **Volcengine CodingPlan** | ¥9.9/first month | Best for Chinese users, multiple SOTA models (Doubao, DeepSeek, etc.) | | **Zhipu** | Free: 200K tokens/month | Suitable for Chinese users | | **Brave Search** | $5/1000 queries | Web search functionality | | **SearXNG** | Free (self-hosted) | Privacy-focused metasearch (70+ engines) | | **Groq** | Free tier available | Fast inference (Llama, Mixtral) | | **Cerebras** | Free tier available | Fast inference (Llama, Qwen, etc.) | | **LongCat** | Free: up to 5M tokens/day | Fast inference | | **ModelScope** | Free: 2000 requests/day | Inference (Qwen, GLM, DeepSeek, etc.) | ---
PicoClaw Meme