Skip to main content

GreenPT logoGreenPT

Access 37 GreenPT models through Mastra's model router. Authentication is handled automatically using the GREENPT_API_KEY environment variable.

Learn more in the GreenPT documentation.

.env
GREENPT_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: "greenpt/deepseek-v4-flash-0731"
});

// 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 GreenPT documentation for details.

Models
Direct link to Models

ModelContextToolsReasoningImageAudioVideoInput $/1MOutput $/1M
greenpt/deepseek-v4-flash-07311.0M$0.16$0.40
greenpt/devstral-2-123b-instruct-2512200K$0.57$3
greenpt/gemma-3-27b-it40K$0.34$0.68
greenpt/gemma4262K$0.57$2
greenpt/glm-5.21.0M$1$5
greenpt/glm-5.2-caveman1.0M$1$5
greenpt/glm-5.2-caveman-lite1.0M$1$5
greenpt/glm-5.2-caveman-ultra1.0M$1$5
greenpt/glm-5.2-honey1.0M$1$5
greenpt/glm-5.2-honey-lite1.0M$1$5
greenpt/glm-5.2-honey-ultra1.0M$1$5
greenpt/glm-5.2-ponytail1.0M$1$5
greenpt/glm-5.2-ponytail-lite1.0M$1$5
greenpt/glm-5.2-ponytail-ultra1.0M$1$5
greenpt/gpt-oss-120b131K$0.23$0.80
greenpt/green-l128K$0.28$0.91
greenpt/green-l-raw128K$0.28$0.91
greenpt/green-r131K$0.40$1
greenpt/green-r-raw131K$0.40$1
greenpt/green-s$0.00
greenpt/green-s-pro$0.00
greenpt/holo2-30b-a3b22K$0.40$0.97
greenpt/kimi-k2.6262K$0.75$4
greenpt/kimi-k2.7-code262K$0.90$4
greenpt/kimi-k31.0M$4$19
greenpt/llama-3.3-70b-instruct100K$1$1
greenpt/minimax-m2.5205K$0.19$1
greenpt/mistral-medium-3.5-128b262K$2$10
greenpt/mistral-small-3.2-24b-instruct-2506128K$0.23$0.46
greenpt/pixtral-12b-2409128K$0.28$0.28
greenpt/qwen3-235b-a22b-instruct-2507262K$1$3
greenpt/qwen3-coder-30b-a3b-instruct128K$0.28$1
greenpt/qwen3.5-397b-a17b262K$0.80$5
greenpt/qwen3.6-35b-a3b262K$0.34$2
greenpt/voxtral-small-24b-250733K$0.23$0.51
35 available models

Advanced configuration
Direct link to Advanced configuration

Custom headers
Direct link to Custom headers

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

Dynamic model selection
Direct link to Dynamic model selection

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
? "greenpt/voxtral-small-24b-2507"
: "greenpt/deepseek-v4-flash-0731";
}
});
On this page