> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-TW/llms.txt # ![Scaleway 標誌](https://models.dev/logos/scaleway.svg)Scaleway 透過 Mastra 的模型路由器存取 14 個 Scaleway 模型。系統會自動使用 `SCALEWAY_API_KEY` 環境變數完成身分驗證。 如需進一步了解,請參閱[Scaleway 文件](https://www.scaleway.com/en/docs/generative-apis/)。 ```bash SCALEWAY_API_KEY=your-api-key ``` ```typescript import { Agent } from '@mastra/core/agent' const agent = new Agent({ id: 'my-agent', name: 'My Agent', instructions: 'You are a helpful assistant', model: 'scaleway/bge-multilingual-gemma2', }) // 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 特有功能可能無法使用,詳情請參閱[Scaleway 文件](https://www.scaleway.com/en/docs/generative-apis/)。 ## 模型 | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M | | ---------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- | | `scaleway/bge-multilingual-gemma2` | 8K | | | | | | $0.10 | — | | `scaleway/gemma-4-26b-a4b-it` | 256K | | | | | | $0.25 | $0.50 | | `scaleway/glm-5.2` | 256K | | | | | | $2 | $6 | | `scaleway/gpt-oss-120b` | 128K | | | | | | $0.15 | $0.60 | | `scaleway/llama-3.3-70b-instruct` | 100K | | | | | | $0.90 | $0.90 | | `scaleway/mistral-medium-3.5-128b` | 256K | | | | | | $2 | $8 | | `scaleway/mistral-small-3.2-24b-instruct-2506` | 128K | | | | | | $0.15 | $0.35 | | `scaleway/pixtral-12b-2409` | 128K | | | | | | $0.20 | $0.20 | | `scaleway/qwen3-235b-a22b-instruct-2507` | 260K | | | | | | $0.75 | $2 | | `scaleway/qwen3-coder-30b-a3b-instruct` | 128K | | | | | | $0.20 | $0.80 | | `scaleway/qwen3-embedding-8b` | 33K | | | | | | $0.10 | — | | `scaleway/qwen3.5-397b-a17b` | 256K | | | | | | $0.60 | $4 | | `scaleway/qwen3.6-35b-a3b` | 128K | | | | | | $0.25 | $2 | | `scaleway/whisper-large-v3` | — | | | | | | $0.00 | — | ## 進階設定 ### 自訂標頭 ```typescript const agent = new Agent({ id: 'custom-agent', name: 'custom-agent', model: { url: 'https://api.scaleway.ai/v1', id: 'scaleway/bge-multilingual-gemma2', apiKey: process.env.SCALEWAY_API_KEY, headers: { 'X-Custom-Header': 'value', }, }, }) ``` ### 動態選擇模型 ```typescript const agent = new Agent({ id: 'dynamic-agent', name: 'Dynamic Agent', model: ({ requestContext }) => { const useAdvanced = requestContext.task === 'complex' return useAdvanced ? 'scaleway/whisper-large-v3' : 'scaleway/bge-multilingual-gemma2' }, }) ```