JZSTOKEN
Access 22 JZSTOKEN models through Mastra's model router. Authentication is handled automatically using the JZSTOKEN_API_KEY environment variable.
Learn more in the JZSTOKEN documentation.
.env
JZSTOKEN_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: "jzstoken/claude-haiku-4-5-20251001"
});
// 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 JZSTOKEN documentation for details.
ModelsDirect link to Models
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
jzstoken/claude-haiku-4-5-20251001 | 200K | $0.08 | $0.39 | |||||
jzstoken/claude-opus-4-7 | 1.0M | $1 | $6 | |||||
jzstoken/claude-opus-4-8 | 1.0M | $1 | $6 | |||||
jzstoken/claude-opus-5 | 1.0M | $1 | $6 | |||||
jzstoken/claude-opus-5.5 | 1.0M | $1 | $6 | |||||
jzstoken/claude-sonnet-5 | 1.0M | $0.78 | $4 | |||||
jzstoken/claude-sonnet-5.5 | 1.0M | $0.78 | $4 | |||||
jzstoken/deepseek-v4-flash | 1.0M | $0.15 | $0.75 | |||||
jzstoken/deepseek-v4-pro | 1.0M | $0.45 | $2 | |||||
jzstoken/deepseek-v4.1-flash | 1.0M | $0.15 | $0.75 | |||||
jzstoken/glm-5.3 | 1.0M | $0.62 | $3 | |||||
jzstoken/gpt-5.5 | 1.1M | $0.39 | $2 | |||||
jzstoken/gpt-5.6-sol | 1.1M | $0.62 | $3 | |||||
jzstoken/gpt-5.6-terra | 1.1M | $0.23 | $1 | |||||
jzstoken/gpt-6-astra | 1.1M | $1 | $7 | |||||
jzstoken/gpt-6.1-sol | 1.1M | $0.31 | $2 | |||||
jzstoken/gpt-6.1-terra | 1.1M | $0.16 | $0.78 | |||||
jzstoken/grok-4.7 | 500K | $0.39 | $2 | |||||
jzstoken/kimi-k2.6 | 262K | $0.16 | $0.78 | |||||
jzstoken/kimi-k3 | 1.0M | $2 | $10 | |||||
jzstoken/kimi-k3.1-pro | 1.0M | $1 | $6 | |||||
jzstoken/qwen3.8-max | 1.0M | $2 | $5 |
Model availability, capabilities, context windows, and pricing are sourced from models.dev and may change.
Advanced configurationDirect link to Advanced configuration
Custom headersDirect link to Custom headers
src/mastra/agents/my-agent.ts
import { Agent } from "@mastra/core/agent";
const agent = new Agent({
id: "custom-agent",
name: "custom-agent",
model: {
url: "https://jzstoken.com/api/v1",
id: "jzstoken/claude-haiku-4-5-20251001",
apiKey: process.env.JZSTOKEN_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});
Dynamic model selectionDirect link to Dynamic model selection
src/mastra/agents/my-agent.ts
import { Agent } from "@mastra/core/agent";
const agent = new Agent({
id: "dynamic-agent",
name: "Dynamic Agent",
model: ({ requestContext }) => {
const useAdvanced = requestContext.task === "complex";
return useAdvanced
? "jzstoken/qwen3.8-max"
: "jzstoken/claude-haiku-4-5-20251001";
}
});