FrogBot
透過 Mastra 的模型路由器存取 26 個 FrogBot 模型。系統會自動使用 FROGBOT_API_KEY 環境變數完成身分驗證。
如需進一步了解,請參閱FrogBot 文件。
.env
FROGBOT_API_KEY=your-api-key
src/mastra/agents/my-agent.ts
import { Agent } from '@mastra/core/agent'
const agent = new Agent({
id: 'my-agent',
name: 'My Agent',
instructions: 'You are a helpful assistant',
model: 'frogbot/claude-haiku-4-5',
})
// Generate a response
const response = await agent.generate('Hello!')
// Stream a response
const stream = await agent.stream('Tell me a story')
for await (const chunk of stream) {
console.log(chunk)
}
資訊
Mastra 使用與 OpenAI 相容的 /chat/completions endpoint。部分 Provider 特有功能可能無法使用,詳情請參閱FrogBot 文件。
模型「模型」的直接連結
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
frogbot/claude-haiku-4-5 | 200K | $1 | $5 | |||||
frogbot/claude-opus-4-6 | 200K | $5 | $25 | |||||
frogbot/claude-opus-4-7 | 200K | $5 | $25 | |||||
frogbot/claude-sonnet-4-6 | 200K | $3 | $15 | |||||
frogbot/deepseek-v4-pro | 128K | $2 | $3 | |||||
frogbot/gemini-2.5-flash | 1.0M | $0.30 | $3 | |||||
frogbot/gemini-2.5-pro | 1.0M | $1 | $10 | |||||
frogbot/gemini-3-1-pro-preview | 1.0M | $2 | $12 | |||||
frogbot/gemini-3-flash-preview | 1.0M | $0.50 | $3 | |||||
frogbot/gpt-4o | 128K | $3 | $10 | |||||
frogbot/gpt-5-3-codex | 400K | $2 | $14 | |||||
frogbot/gpt-5-4-mini | 400K | $0.75 | $5 | |||||
frogbot/gpt-5-4-nano | 400K | $0.20 | $1 | |||||
frogbot/gpt-5-5 | 272K | $3 | $15 | |||||
frogbot/gpt-oss-120b | 131K | $0.15 | $0.60 | |||||
frogbot/gpt-oss-20b | 131K | $0.07 | $0.20 | |||||
frogbot/grok-4-1-fast-non-reasoning | 2.0M | $0.20 | $0.50 | |||||
frogbot/grok-4-1-fast-reasoning | 2.0M | $0.20 | $0.50 | |||||
frogbot/grok-4-3 | 1.0M | $1 | $3 | |||||
frogbot/grok-code-fast-1 | 256K | $0.20 | $2 | |||||
frogbot/kimi-k2-6 | 256K | $0.95 | $4 | |||||
frogbot/kimi-k2.5 | 256K | $0.60 | $3 | |||||
frogbot/minimax-m2-5 | 192K | $0.30 | $1 | |||||
frogbot/minimax-m2-7 | 192K | $0.30 | $1 | |||||
frogbot/qwen-3-6-plus | 1.0M | $0.50 | $3 | |||||
frogbot/zai-glm-5-1 | 198K | $1 | $4 |
進階設定「進階設定」的直接連結
自訂標頭「自訂標頭」的直接連結
src/mastra/agents/my-agent.ts
const agent = new Agent({
id: 'custom-agent',
name: 'custom-agent',
model: {
url: 'https://app.frogbot.ai/api/v1',
id: 'frogbot/claude-haiku-4-5',
apiKey: process.env.FROGBOT_API_KEY,
headers: {
'X-Custom-Header': 'value',
},
},
})
動態選擇模型「動態選擇模型」的直接連結
src/mastra/agents/my-agent.ts
const agent = new Agent({
id: 'dynamic-agent',
name: 'Dynamic Agent',
model: ({ requestContext }) => {
const useAdvanced = requestContext.task === 'complex'
return useAdvanced ? 'frogbot/zai-glm-5-1' : 'frogbot/claude-haiku-4-5'
},
})