Cortecs
Access 10 Cortecs models through Mastra’s model router. Authentication is handled automatically using the CORTECS_API_KEY
environment variable.
Learn more in the Cortecs documentation .
CORTECS_API_KEY=your-api-key
import { Agent } from "@mastra/core";
const agent = new Agent({
name: "my-agent",
instructions: "You are a helpful assistant",
model: "cortecs/claude-sonnet-4"
});
// 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 uses the OpenAI-compatible /chat/completions
endpoint. Some provider-specific features may not be available. Check the Cortecs documentation for details.
Models
Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
---|---|---|---|---|---|---|---|---|
cortecs/nova-pro-v1 | 300K | $0.82 | $3 | |||||
cortecs/deepseek-v3-0324 | 128K | $0.45 | $1 | |||||
cortecs/kimi-k2-instruct | 131K | $0.45 | $2 | |||||
cortecs/gpt-4.1 | 1.0M | $2 | $8 | |||||
cortecs/gemini-2.5-pro | 1.0M | $1 | $9 | |||||
cortecs/gpt-oss-120b | 128K | — | — | |||||
cortecs/qwen3-coder-480b-a35b-instruct | 262K | $0.36 | $2 | |||||
cortecs/claude-sonnet-4 | 200K | $3 | $13 | |||||
cortecs/llama-3.1-405b-instruct | 128K | — | — | |||||
cortecs/qwen3-32b | 16K | $0.08 | $0.27 |
Advanced Configuration
Custom Headers
const agent = new Agent({
name: "custom-agent",
model: {
url: "https://api.cortecs.ai/v1/chat/completions",
modelId: "claude-sonnet-4",
apiKey: process.env.CORTECS_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});
Dynamic Model Selection
const agent = new Agent({
name: "dynamic-agent",
model: ({ runtimeContext }) => {
const useAdvanced = runtimeContext.task === "complex";
return useAdvanced
? "cortecs/claude-sonnet-4"
: "cortecs/deepseek-v3-0324";
}
});