# <img src="https://models.dev/logos/cortecs.svg" alt="Cortecs logo" className="inline w-8 h-8 mr-2 align-middle dark:invert dark:brightness-0 dark:contrast-200" />Cortecs
[EN] Source: https://mastra.ai/models/providers/cortecs

Access 11 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.

Learn more in the [Cortecs documentation](https://cortecs.ai).

```bash
CORTECS_API_KEY=your-api-key
```

```typescript
import { Agent } from "@mastra/core";

const agent = new 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 uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Cortecs documentation](https://cortecs.ai) for details.

:::

## Models

<ProviderModelsTable
  models={[
  {
    "model": "cortecs/claude-4-5-sonnet",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 200000,
    "maxOutput": 200000,
    "inputCost": 3.259,
    "outputCost": 16.296
  },
  {
    "model": "cortecs/claude-sonnet-4",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 200000,
    "maxOutput": 64000,
    "inputCost": 3.307,
    "outputCost": 16.536
  },
  {
    "model": "cortecs/deepseek-v3-0324",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": 0.551,
    "outputCost": 1.654
  },
  {
    "model": "cortecs/gemini-2.5-pro",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 1048576,
    "maxOutput": 65535,
    "inputCost": 1.654,
    "outputCost": 11.024
  },
  {
    "model": "cortecs/gpt-4.1",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 1047576,
    "maxOutput": 32768,
    "inputCost": 2.354,
    "outputCost": 9.417
  },
  {
    "model": "cortecs/gpt-oss-120b",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": null,
    "outputCost": null
  },
  {
    "model": "cortecs/kimi-k2-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 131000,
    "maxOutput": 131000,
    "inputCost": 0.551,
    "outputCost": 2.646
  },
  {
    "model": "cortecs/llama-3.1-405b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 128000,
    "maxOutput": 128000,
    "inputCost": null,
    "outputCost": null
  },
  {
    "model": "cortecs/nova-pro-v1",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 300000,
    "maxOutput": 5000,
    "inputCost": 1.016,
    "outputCost": 4.061
  },
  {
    "model": "cortecs/qwen3-32b",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 16384,
    "maxOutput": 16384,
    "inputCost": 0.099,
    "outputCost": 0.33
  },
  {
    "model": "cortecs/qwen3-coder-480b-a35b-instruct",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 262000,
    "maxOutput": 262000,
    "inputCost": 0.441,
    "outputCost": 1.984
  }
]}
/>

## Advanced Configuration

### Custom Headers

```typescript
const agent = new 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"
    }
  }
});
```

### Dynamic Model Selection

```typescript
const agent = new Agent({
  name: "dynamic-agent",
  model: ({ runtimeContext }) => {
    const useAdvanced = runtimeContext.task === "complex";
    return useAdvanced
      ? "cortecs/qwen3-coder-480b-a35b-instruct"
      : "cortecs/claude-4-5-sonnet";
  }
});
```




---
title: "Deep Infra | Models | Mastra"
description: "Use Deep Infra models with Mastra. 4 models available."
---

{/* This file is auto-generated by generate-model-docs.ts - DO NOT EDIT MANUALLY */}



import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";