|
| 1 | +--- |
| 2 | +title: "Claudinio | Models" |
| 3 | +description: "Use Claudinio models with Mastra. 1 model available." |
| 4 | +--- |
| 5 | + |
| 6 | +{/* This file is auto-generated by generate-model-docs.ts - DO NOT EDIT MANUALLY */} |
| 7 | + |
| 8 | +# <img src="https://models.dev/logos/claudinio.svg" alt="Claudinio logo" className="inline w-8 h-8 mr-2 align-middle dark:invert dark:brightness-0 dark:contrast-200" />Claudinio |
| 9 | + |
| 10 | +Access 1 Claudinio model through Mastra's model router. Authentication is handled automatically using the `CLAUDINIO_API_KEY` environment variable. |
| 11 | + |
| 12 | +Learn more in the [Claudinio documentation](https://claudin.io). |
| 13 | + |
| 14 | +```bash title=".env" |
| 15 | +CLAUDINIO_API_KEY=your-api-key |
| 16 | +``` |
| 17 | + |
| 18 | +```typescript title="src/mastra/agents/my-agent.ts" {7} |
| 19 | +import { Agent } from "@mastra/core/agent"; |
| 20 | + |
| 21 | +const agent = new Agent({ |
| 22 | + id: "my-agent", |
| 23 | + name: "My Agent", |
| 24 | + instructions: "You are a helpful assistant", |
| 25 | + model: "claudinio/claudinio" |
| 26 | +}); |
| 27 | + |
| 28 | +// Generate a response |
| 29 | +const response = await agent.generate("Hello!"); |
| 30 | + |
| 31 | +// Stream a response |
| 32 | +const stream = await agent.stream("Tell me a story"); |
| 33 | +for await (const chunk of stream) { |
| 34 | + console.log(chunk); |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +:::info |
| 39 | + |
| 40 | +Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Claudinio documentation](https://claudin.io) for details. |
| 41 | + |
| 42 | +::: |
| 43 | + |
| 44 | +## Models |
| 45 | + |
| 46 | +<ProviderModelsTable |
| 47 | + models={[ |
| 48 | + { |
| 49 | + "model": "claudinio/claudinio", |
| 50 | + "imageInput": true, |
| 51 | + "audioInput": false, |
| 52 | + "videoInput": false, |
| 53 | + "toolUsage": true, |
| 54 | + "reasoning": true, |
| 55 | + "contextWindow": 256000, |
| 56 | + "maxOutput": 64000, |
| 57 | + "inputCost": 0.5, |
| 58 | + "outputCost": 2 |
| 59 | + } |
| 60 | +]} |
| 61 | +/> |
| 62 | + |
| 63 | +## Advanced configuration |
| 64 | + |
| 65 | +### Custom headers |
| 66 | + |
| 67 | +```typescript title="src/mastra/agents/my-agent.ts" |
| 68 | +const agent = new Agent({ |
| 69 | + id: "custom-agent", |
| 70 | + name: "custom-agent", |
| 71 | + model: { |
| 72 | + url: "https://api.claudin.io/v1", |
| 73 | + id: "claudinio/claudinio", |
| 74 | + apiKey: process.env.CLAUDINIO_API_KEY, |
| 75 | + headers: { |
| 76 | + "X-Custom-Header": "value" |
| 77 | + } |
| 78 | + } |
| 79 | +}); |
| 80 | +``` |
| 81 | + |
| 82 | +### Dynamic model selection |
| 83 | + |
| 84 | +```typescript title="src/mastra/agents/my-agent.ts" |
| 85 | +const agent = new Agent({ |
| 86 | + id: "dynamic-agent", |
| 87 | + name: "Dynamic Agent", |
| 88 | + model: ({ requestContext }) => { |
| 89 | + const useAdvanced = requestContext.task === "complex"; |
| 90 | + return useAdvanced |
| 91 | + ? "claudinio/claudinio" |
| 92 | + : "claudinio/claudinio"; |
| 93 | + } |
| 94 | +}); |
| 95 | +``` |
| 96 | + |
| 97 | + |
0 commit comments