Starter
Free for everyone
- 100K observability events+ $10/100K
- 24 CPU hours+ $0.35/hr
- 15 days of data retention
- Unlimited users, deployments, and projects

MASTRA GATEWAY
Compress chat history into compact memories that help agents remember what matters. Lower token usage and latency without losing important context.

Use one endpoint for every model. Skip provider SDKs — one API key covers everything.

Start building with a free account, or explore our pricing for more
Full PricingFree for everyone
For growing teams
For teams at scale
Custom volume and retention, with RBAC, audit logs, support and uptime SLAs, and a dedicated support engineer.
How Replit Agent 3 creates thousands of Mastra agents every day
How SoftBank is restoring Japan's white-collar productivity using Mastra
How Sanity Built a Content Agent That Actually Understands Your CMS
How Marsh used Mastra to build Agentic Search for 100k employees
Mastra Gateway is an AI gateway that adds observational memory and unified model routing to any agent. Use one endpoint for every model and one API key for every provider. Observational memory forms dense observations in the background without interrupting the conversation.
Mastra Gateway prevents context loss by running two background agents that maintain a dense observation log without blocking the conversation or throwing anything away. An Observer watches conversations and compresses message history into concise notes about what happened. A Reflector condenses observations when they grow too long. Compression is typically 5-40x.
Mastra Gateway appends observations over time rather than rebuilding the prompt each turn. Keeping the prompt prefix stable and cacheable means the longer the conversation runs, the more you save.
Mastra Gateway is the single integration point for every model provider your agents need to reach. One API key covers everything across more than 300 models including OpenAI, Anthropic, Google, Meta and Mistral, with no provider SDKs required. Change your base URL and start routing through the gateway using Python, TypeScript, any framework, any client. Plug in your own provider API keys for direct routing to any provider and get the same memory features either way. Run on distributed infrastructure with automatic failover across providers.
Mastra Gateway works with any agent stack. Change your base URL and start routing through the gateway using Python, TypeScript, any framework and any client. Observational memory and model routing apply to any agent regardless of how it was built.