Cortecs
Access 108 Cortecs models through Mastra's model router. Authentication is handled automatically using the CORTECS_API_KEY environment variable.
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/apertus-70b"
});
// 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);
}
note
Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the Cortecs documentation for details.
ModelsDirect link to Models
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
cortecs/apertus-70b | 66K | $1 | $2 | |||||
cortecs/claude-4-5-sonnet | 200K | $3 | $15 | |||||
cortecs/claude-4-6-sonnet | 1.0M | $3 | $16 | |||||
cortecs/claude-haiku-4-5 | 200K | $1.00 | $5 | |||||
cortecs/claude-opus-5 | 1.0M | $6 | $27 | |||||
cortecs/claude-opus4-5 | 200K | $5 | $27 | |||||
cortecs/claude-opus4-6 | 1.0M | $5 | $27 | |||||
cortecs/claude-opus4-7 | 1.0M | $5 | $27 | |||||
cortecs/claude-opus4-8 | 1.0M | $5 | $27 | |||||
cortecs/claude-sonnet-4 | 200K | $3 | $14 | |||||
cortecs/claude-sonnet-5 | 1.0M | $2 | $11 | |||||
cortecs/codestral-2508 | 256K | $0.33 | $1 | |||||
cortecs/cosmos3-super-reasoner | 256K | $0.10 | $0.30 | |||||
cortecs/deepseek-r1-0528 | 164K | $0.65 | $3 | |||||
cortecs/deepseek-v3.2 | 164K | $0.30 | $0.49 | |||||
cortecs/deepseek-v4-flash-0731 | 1.0M | $0.13 | $0.28 | |||||
cortecs/deepseek-v4-pro | 1.0M | $2 | $3 | |||||
cortecs/devstral-2512 | 262K | $0.45 | $2 | |||||
cortecs/gemini-2.5-flash | 1.0M | $0.30 | $2 | |||||
cortecs/gemini-2.5-pro | 1.0M | $1 | $10 | |||||
cortecs/gemini-3.1-flash-lite | 1.0M | $0.27 | $2 | |||||
cortecs/gemini-3.5-flash | 1.0M | $2 | $10 | |||||
cortecs/gemini-3.5-flash-lite | 1.0M | $0.33 | $3 | |||||
cortecs/gemini-3.6-flash | 1.0M | $0.75 | $4 | |||||
cortecs/gemini-3.7-flash | 1.0M | $0.75 | $4 | |||||
cortecs/gemma-3-27b-it | 131K | $0.10 | $0.30 | |||||
cortecs/gemma-4-26b-a4b-it | 262K | $0.11 | $0.56 | |||||
cortecs/gemma-4-31b-it | 262K | $0.22 | $0.39 | |||||
cortecs/glm-4.7 | 203K | $0.78 | $3 | |||||
cortecs/glm-4.7-flash | 203K | $0.08 | $0.48 | |||||
cortecs/glm-5 | 203K | $0.99 | $3 | |||||
cortecs/glm-5-turbo | 203K | $1 | $4 | |||||
cortecs/glm-5.1 | 203K | $1 | $4 | |||||
cortecs/glm-5.2 | 1.0M | $1 | $4 | |||||
cortecs/glm-5v-turbo | 203K | $1 | $4 | |||||
cortecs/gpt-4.1 | 1.0M | $2 | $9 | |||||
cortecs/gpt-4.1-mini | 1.0M | $0.43 | $2 | |||||
cortecs/gpt-4.1-nano | 1.0M | $0.11 | $0.43 | |||||
cortecs/gpt-4o | 128K | $3 | $11 | |||||
cortecs/gpt-4o-mini | 128K | $0.16 | $0.64 | |||||
cortecs/gpt-5 | 400K | $1 | $11 | |||||
cortecs/gpt-5-mini | 400K | $0.28 | $2 | |||||
cortecs/gpt-5-nano | 400K | $0.06 | $0.44 | |||||
cortecs/gpt-5.1 | 400K | $1 | $11 | |||||
cortecs/gpt-5.4 | 1.1M | $3 | $15 | |||||
cortecs/gpt-5.6-luna | 1.1M | $0.22 | $1 | |||||
cortecs/gpt-5.6-sol | 1.1M | $6 | $33 | |||||
cortecs/gpt-5.6-terra | 1.1M | $2 | $13 | |||||
cortecs/gpt-oss-120b | 131K | $0.09 | $0.45 | |||||
cortecs/gpt-oss-20b | 131K | $0.04 | $0.17 | |||||
cortecs/gpt-oss-safeguard-120b | 128K | $0.18 | $0.70 | |||||
cortecs/hermes-4-405b | 128K | $1.00 | $3 | |||||
cortecs/hermes-4-70b | 128K | $0.13 | $0.40 | |||||
cortecs/kimi-k2.5 | 262K | $0.49 | $3 | |||||
cortecs/kimi-k2.6 | 262K | $0.77 | $3 | |||||
cortecs/kimi-k2.7-code | 262K | $0.75 | $4 | |||||
cortecs/kimi-k3 | 1.0M | $3 | $15 | |||||
cortecs/llama-3.1-405b-instruct | 128K | $2 | $2 | |||||
cortecs/llama-3.1-8b-instruct | 128K | $0.17 | $0.17 | |||||
cortecs/llama-3.1-nemotron-ultra-253b-v1 | 128K | $0.60 | $2 | |||||
cortecs/llama-3.3-70b-instruct | 131K | $0.13 | $0.40 | |||||
cortecs/minicpm-v-4.5 | 32K | $0.65 | $1 | |||||
cortecs/minimax-m2 | 400K | $0.35 | $1 | |||||
cortecs/minimax-m2.1 | 196K | $0.36 | $1 | |||||
cortecs/minimax-m2.5 | 197K | $0.30 | $1 | |||||
cortecs/minimax-m2.7 | 197K | $0.67 | $3 | |||||
cortecs/minimax-m3 | 1.0M | $0.40 | $2 | |||||
cortecs/ministral-14b-2512 | 256K | $0.22 | $0.22 | |||||
cortecs/ministral-3b-2512 | 256K | $0.11 | $0.11 | |||||
cortecs/ministral-8b-2512 | 256K | $0.17 | $0.17 | |||||
cortecs/mistral-7b-instruct-v0.2 | 32K | $0.16 | $0.22 | |||||
cortecs/mistral-7b-instruct-v0.3 | 127K | $0.11 | $0.11 | |||||
cortecs/mistral-large-2402 | 32K | $4 | $13 | |||||
cortecs/mistral-large-2512 | 256K | $0.56 | $2 | |||||
cortecs/mistral-medium-2508 | 128K | $0.45 | $2 | |||||
cortecs/mistral-medium-3.5 | 256K | $2 | $6 | |||||
cortecs/mistral-nemo-instruct-2407 | 128K | $0.14 | $0.14 | |||||
cortecs/mistral-small-2503 | 128K | $0.11 | $0.33 | |||||
cortecs/mistral-small-2603 | 262K | $0.14 | $0.57 | |||||
cortecs/mistral-small-3.2-24b-instruct-2506 | 131K | $0.10 | $0.31 | |||||
cortecs/mixtral-8x7B-instruct-v0.1 | 32K | $0.49 | $0.76 | |||||
cortecs/nemotron-nano-v2-12b | 128K | $0.24 | $0.71 | |||||
cortecs/nova-2-lite | 1.0M | $0.37 | $3 | |||||
cortecs/nova-lite-v1 | 300K | $0.07 | $0.28 | |||||
cortecs/nova-micro-v1 | 128K | $0.04 | $0.16 | |||||
cortecs/nova-pro-v1 | 300K | $0.92 | $4 | |||||
cortecs/nvidia-nemotron-3-nano-30b-a3b | 256K | $0.06 | $0.24 | |||||
cortecs/nvidia-nemotron-3-nano-omni | 300K | $0.06 | $0.24 | |||||
cortecs/pixtral-12b-2409 | 128K | $0.22 | $0.22 | |||||
cortecs/pixtral-large-2502 | 128K | $2 | $6 | |||||
cortecs/qwen2.5-vl-72b-instruct | 32K | $0.25 | $0.75 | |||||
cortecs/qwen3-235b-a22b-instruct-2507 | 262K | $0.07 | $0.46 | |||||
cortecs/qwen3-30b-a3b-instruct-2507 | 262K | $0.10 | $0.30 | |||||
cortecs/qwen3-32b | 40K | $0.10 | $0.30 | |||||
cortecs/qwen3-coder-30b-a3b-instruct | 262K | $0.07 | $0.24 | |||||
cortecs/qwen3-coder-next | 256K | $0.17 | $0.89 | |||||
cortecs/qwen3-next-80b-a3b-thinking | 128K | $0.15 | $1 | |||||
cortecs/qwen3-vl-235b-a22b | 256K | $0.62 | $3 | |||||
cortecs/qwen3.5-122b-a10b | 262K | $0.49 | $3 | |||||
cortecs/qwen3.5-397b-a17b | 262K | $0.67 | $4 | |||||
cortecs/qwen3.5-9b | 262K | $0.11 | $0.17 | |||||
cortecs/qwen3.6-27b | 262K | $0.45 | $3 | |||||
cortecs/qwen3.6-35b-a3b | 262K | $0.17 | $0.56 | |||||
cortecs/qwen3.8-2.4t-a95b | 262K | $3 | $6 | |||||
cortecs/qwen3.8-27b | 262K | $0.33 | $2 | |||||
cortecs/qwen3guard-gen-0.6b | 32K | — | — | |||||
cortecs/qwen3guard-gen-8b | 32K | — | — | |||||
cortecs/voxtral-small-2507 | 32K | $0.11 | $0.33 |
Advanced configurationDirect link to Advanced configuration
Custom headersDirect 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/apertus-70b",
apiKey: process.env.CORTECS_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});
Dynamic model selectionDirect 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/voxtral-small-2507"
: "cortecs/apertus-70b";
}
});