본문으로 건너뛰기

Clarifai logo클라리파이

Mastra의 Model 라우터를 통해 12개의 Clarifai Model에 액세스하세요. 인증은 다음을 사용하여 자동으로 처리됩니다.CLARIFAI_PAT environment variable.

자세한 내용은 다음에서 확인하세요.Clarifai documentation.

.env
CLARIFAI_PAT=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: "clarifai/arcee_ai/AFM/models/trinity-mini"
});

// 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는 OpenAI 호환 /chat/completions 엔드포인트를 사용합니다. 일부 Provider별 기능은 사용하지 못할 수 있습니다. 자세한 내용은 Clarifai 문서를 참조하세요.

Model
Model에 대한 직접 링크

ModelContextToolsReasoningImageAudioVideoInput $/1MOutput $/1M
clarifai/arcee_ai/AFM/models/trinity-mini131K$0.04$0.15
clarifai/clarifai/main/models/mm-poly-8b33K$0.66$1
clarifai/deepseek-ai/deepseek-ocr/models/DeepSeek-OCR8K$0.20$0.70
clarifai/minimaxai/chat-completion/models/MiniMax-M2_5-high-throughput205K$0.30$1
clarifai/mistralai/completion/models/Ministral-3-14B-Reasoning-2512262K$3$2
clarifai/mistralai/completion/models/Ministral-3-3B-Reasoning-2512262K$1$0.55
clarifai/moonshotai/chat-completion/models/Kimi-K2_6262K$0.95$4
clarifai/openai/chat-completion/models/gpt-oss-120b-high-throughput131K$0.09$0.36
clarifai/openai/chat-completion/models/gpt-oss-20b131K$0.04$0.18
clarifai/qwen/qwenCoder/models/Qwen3-Coder-30B-A3B-Instruct262K$0.11$0.75
clarifai/qwen/qwenLM/models/Qwen3-30B-A3B-Instruct-2507262K$0.30$0.50
clarifai/qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507262K$0.36$1
12 available models

고급 구성
고급 구성에 대한 직접 링크

맞춤 헤더
맞춤 헤더에 대한 직접 링크

src/mastra/agents/my-agent.ts
const agent = new Agent({
id: "custom-agent",
name: "custom-agent",
model: {
url: "https://api.clarifai.com/v2/ext/openai/v1",
id: "clarifai/arcee_ai/AFM/models/trinity-mini",
apiKey: process.env.CLARIFAI_PAT,
headers: {
"X-Custom-Header": "value"
}
}
});

동적 Model 선택
동적 Model 선택에 대한 직접 링크

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
? "clarifai/qwen/qwenLM/models/Qwen3-30B-A3B-Thinking-2507"
: "clarifai/arcee_ai/AFM/models/trinity-mini";
}
});