メインコンテンツへ移動

Charm Hyper ロゴCharm Hyper

Mastra のモデルルーターを通じて 24 個の Charm Hyper モデルを利用できます。認証には HYPER_API_KEY 環境変数が自動的に使用されます。

詳しくは、Charm Hyper のドキュメントを参照してください。

.env
HYPER_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: "hyper/deepseek-v4-flash"
});

// 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 endpoint を使用します。一部の Provider 固有機能は利用できない場合があります。詳しくは、Charm Hyper のドキュメントを確認してください。

モデル
モデルへの直接リンク

ModelContextToolsReasoningImageAudioVideoInput $/1MOutput $/1M
hyper/deepseek-v4-flash1.0M$0.20$0.40
hyper/deepseek-v4-flash-07311.0M$0.15$0.30
hyper/deepseek-v4-pro1.0M$2$5
hyper/gemma-4-26b-a4b-it256K$0.12$0.42
hyper/glm-5.1203K$2$5
hyper/glm-5.21.0M$1$4
hyper/gpt-oss-120b131K$0.18$0.71
hyper/kimi-k2.5262K$0.55$3
hyper/kimi-k2.6262K$0.95$4
hyper/kimi-k2.7-code256K$0.95$4
hyper/kimi-k31.0M$3$16
hyper/llama-3.3-70b-instruct128K$0.61$1
hyper/llama-4-maverick-17b-128e-instruct-fp8430K$0.27$0.90
hyper/minimax-m2.7262K$0.44$2
hyper/minimax-m3512K$0.33$1
hyper/qwen3-coder-480b-a35b-instruct-int4-mixed-ar106K$0.57$2
hyper/qwen3-next-80b-a3b-instruct262K$0.12$1
hyper/qwen3.6-flash1.0M$1$4
hyper/qwen3.6-max256K$2$12
hyper/qwen3.6-plus1.0M$2$6
hyper/qwen3.7-flash1.0M$0.20$0.80
hyper/qwen3.7-max1.0M$3$8
hyper/qwen3.7-plus1.0M$1$5
hyper/qwen3.8-max1.0M$2$6
24 available models

高度な設定
高度な設定への直接リンク

カスタムヘッダー
カスタムヘッダーへの直接リンク

src/mastra/agents/my-agent.ts
const agent = new Agent({
id: "custom-agent",
name: "custom-agent",
model: {
url: "https://hyper.charm.land/v1",
id: "hyper/deepseek-v4-flash",
apiKey: process.env.HYPER_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});

動的なモデル選択
動的なモデル選択への直接リンク

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
? "hyper/qwen3.8-max"
: "hyper/deepseek-v4-flash";
}
});