GreenPT
Access 26 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/devstral-2-123b-instruct-2512"
});
// 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);
}
info
Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the GreenPT documentation for details.
ModelsDirect link to Models
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
greenpt/devstral-2-123b-instruct-2512 | 200K | $0.57 | $3 | |||||
greenpt/gemma-3-27b-it | 40K | $0.34 | $0.68 | |||||
greenpt/gemma4 | 262K | $0.57 | $2 | |||||
greenpt/glm-5.1 | 200K | $2 | $6 | |||||
greenpt/glm-5.2 | 1.0M | $1 | $5 | |||||
greenpt/gpt-oss-120b | 131K | $0.23 | $0.80 | |||||
greenpt/green-l | 128K | $0.28 | $0.91 | |||||
greenpt/green-l-raw | 128K | $0.28 | $0.91 | |||||
greenpt/green-r | 131K | $0.40 | $1 | |||||
greenpt/green-r-raw | 131K | $0.40 | $1 | |||||
greenpt/green-s | — | $0.00 | — | |||||
greenpt/green-s-pro | — | $0.00 | — | |||||
greenpt/holo2-30b-a3b | 22K | $0.40 | $0.97 | |||||
greenpt/kimi-k2.6 | 262K | $0.83 | $4 | |||||
greenpt/kimi-k2.6-fast | 262K | $2 | $9 | |||||
greenpt/kimi-k2.7-code | 262K | $0.94 | $4 | |||||
greenpt/llama-3.3-70b-instruct | 100K | $1 | $1 | |||||
greenpt/minimax-m2.5 | 205K | $0.19 | $1 | |||||
greenpt/mistral-medium-3.5-128b | 262K | $2 | $10 | |||||
greenpt/mistral-small-3.2-24b-instruct-2506 | 128K | $0.23 | $0.46 | |||||
greenpt/pixtral-12b-2409 | 128K | $0.28 | $0.28 | |||||
greenpt/qwen3-235b-a22b-instruct-2507 | 262K | $1 | $3 | |||||
greenpt/qwen3-coder-30b-a3b-instruct | 128K | $0.28 | $1 | |||||
greenpt/qwen3.5-397b-a17b | 262K | $0.80 | $5 | |||||
greenpt/qwen3.6-35b-a3b | 262K | $0.34 | $2 | |||||
greenpt/voxtral-small-24b-2507 | 33K | $0.23 | $0.51 |
Advanced configurationDirect link to Advanced configuration
Custom headersDirect 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/devstral-2-123b-instruct-2512",
apiKey: process.env.GREENPT_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});
Dynamic model selectionDirect 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/devstral-2-123b-instruct-2512";
}
});