皮层
🌐 Cortecs
通过 Mastra 的模型路由访问 16 个 Cortecs 模型。身份验证会自动使用 CORTECS_API_KEY 环境变量处理。
🌐 Access 16 Cortecs models through Mastra's model router. Authentication is handled automatically using the CORTECS_API_KEY environment variable.
在 Cortecs 文档 中了解更多信息。
🌐 Learn more in the Cortecs documentation.
.env
CORTECS_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: "cortecs/claude-4-5-sonnet"
});
// 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 端点。一些特定于提供商的功能可能不可用。详情请查看 Cortecs 文档。
🌐 Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the Cortecs documentation for details.
模型Direct link to 模型
🌐 Models
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
cortecs/claude-4-5-sonnet | 200K | $3 | $16 | |||||
cortecs/claude-sonnet-4 | 200K | $3 | $17 | |||||
cortecs/deepseek-v3-0324 | 128K | $0.55 | $2 | |||||
cortecs/devstral-2512 | 262K | — | — | |||||
cortecs/devstral-small-2512 | 262K | — | — | |||||
cortecs/gemini-2.5-pro | 1.0M | $2 | $11 | |||||
cortecs/gpt-4.1 | 1.0M | $2 | $9 | |||||
cortecs/gpt-oss-120b | 128K | — | — | |||||
cortecs/intellect-3 | 128K | $0.22 | $1 | |||||
cortecs/kimi-k2-instruct | 131K | $0.55 | $3 | |||||
cortecs/kimi-k2-thinking | 262K | $0.66 | $3 | |||||
cortecs/llama-3.1-405b-instruct | 128K | — | — | |||||
cortecs/nova-pro-v1 | 300K | $1 | $4 | |||||
cortecs/qwen3-32b | 16K | $0.10 | $0.33 | |||||
cortecs/qwen3-coder-480b-a35b-instruct | 262K | $0.44 | $2 | |||||
cortecs/qwen3-next-80b-a3b-thinking | 128K | $0.16 | $1 |
高级配置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.cortecs.ai/v1",
id: "cortecs/claude-4-5-sonnet",
apiKey: process.env.CORTECS_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
? "cortecs/qwen3-next-80b-a3b-thinking"
: "cortecs/claude-4-5-sonnet";
}
});