Scaleway
通过 Mastra 的模型路由访问 14 个 Scaleway 模型。身份验证会自动使用 SCALEWAY_API_KEY 环境变量处理。
🌐 Access 14 Scaleway models through Mastra's model router. Authentication is handled automatically using the SCALEWAY_API_KEY environment variable.
在 Scaleway 文档 中了解更多信息。
🌐 Learn more in the Scaleway documentation.
.env
SCALEWAY_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: "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);
}
info
Mastra 使用与 OpenAI 兼容的 /chat/completions 端点。某些特定于提供商的功能可能不可用。详细信息请查阅 Scaleway 文档。
🌐 Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the Scaleway documentation for details.
模型Direct link to 模型
🌐 Models
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
scaleway/bge-multilingual-gemma2 | 8K | $0.13 | — | |||||
scaleway/deepseek-r1-distill-llama-70b | 32K | $0.90 | $0.90 | |||||
scaleway/devstral-2-123b-instruct-2512 | 256K | $0.40 | $2 | |||||
scaleway/gemma-3-27b-it | 40K | $0.25 | $0.50 | |||||
scaleway/gpt-oss-120b | 128K | $0.15 | $0.60 | |||||
scaleway/llama-3.1-8b-instruct | 128K | $0.20 | $0.20 | |||||
scaleway/llama-3.3-70b-instruct | 100K | $0.90 | $0.90 | |||||
scaleway/mistral-nemo-instruct-2407 | 128K | $0.20 | $0.20 | |||||
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/voxtral-small-24b-2507 | 32K | $0.15 | $0.35 | |||||
scaleway/whisper-large-v3 | — | $0.00 | — |
高级配置Direct link to 高级配置
🌐 Advanced Configuration
自定义头Direct link to 自定义头
🌐 Custom Headers
src/mastra/agents/my-agent.ts
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"
}
}
});
动态模型选择Direct link to 动态模型选择
🌐 Dynamic Model Selection
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
? "scaleway/whisper-large-v3"
: "scaleway/bge-multilingual-gemma2";
}
});