Overview
This page provides detailed cost estimates for the Mastra Agent Framework infrastructure across all environments. Costs are based on Azure pricing as of January 2026 (East US region) and the checked-in environment files.
Key insight: assuming AI services stay within their free or low-usage tiers, the main fixed cost is compute. The checked-in env files use VNet + Service Endpoints + deny-by-default lockdown as the baseline networking model, which adds little to no fixed monthly cost by itself.
Three-Environment Summary
| Environment | Monthly | Annual | % of Total |
|---|
| Development | ~$42 | ~$504 | 18% |
| Staging | ~$85 | ~$1,020 | 37% |
| Production | ~$103 | ~$1,236 | 45% |
| Total | ~$230 | ~$2,760 | 100% |
Cost Breakdown by Category
| Category | Dev | Staging | Prod |
|---|
| Infrastructure | $37 | $75 | $88 |
| APIM (Consumption) | $5 | $10 | $15 |
| AI Services | $0 | $0 | $0 |
| Networking (VNet + SE + Lockdown) | ~$0 | ~$0 | ~$0 |
| Total | ~$42 | ~$85 | ~$103 |
Development Environment
Configuration: Minimal compute with production-style networking: VNet, Service Endpoints, and deny-by-default lockdown.
| Service | SKU | Specification | Monthly Cost |
|---|
| App Service Plan | B2 | 2 vCPU, 3.5 GB RAM | $25.00 |
| SQL Database | Basic | 5 DTUs, 2 GB max | $5.00 |
| Container Registry | Basic | 10 GB storage | $5.00 |
| API Management | Consumption | Pay-per-call | $5.00 |
| Storage Account | Standard LRS | Minimal usage | $1.00 |
| Key Vault | Standard | Low operations | $0.50 |
| Application Insights | Consumption | Within 5 GB free tier | $0.00 |
| Virtual Network | Standard | 1 VNet, Service Endpoints | $0.00 |
| Network Lockdown | - | Firewall and access restriction config | $0.00 |
| Managed Identity | - | System-assigned | $0.00 |
| AI Foundry (OpenAI) | S0 | Variable usage | $0.00 |
| Content Safety | S0 | Pay-per-use (within free tier) | $0.00 |
| Form Recognizer | S0 | Pay-per-use (within free tier) | $0.00 |
| Total | | | ~$42/month |
Why S0 instead of F0 for AI services? Content Safety and Form Recognizer S0 tiers are pay-per-use with generous free tiers (5,000 requests/month for Content Safety, 500 pages/month for Form Recognizer). F0 has rate limits and feature restrictions that can break development. S0 costs $0 until free tier limits are exceeded.
Staging Environment
Configuration: Production-sized compute with the same baseline networking model as production: VNet, Service Endpoints, and deny-by-default lockdown.
| Service | SKU | Specification | Monthly Cost |
|---|
| App Service Plan | P0v3 | 1 vCPU, 4 GB RAM | $57.00 |
| SQL Database | Basic | 5 DTUs, 2 GB max | $5.00 |
| Container Registry | Basic | 10 GB storage | $5.00 |
| API Management | Consumption | Pay-per-call | $10.00 |
| Storage Account | Standard LRS | Moderate usage | $2.00 |
| Key Vault | Standard | Moderate operations | $0.50 |
| Application Insights | Consumption | ~3 GB ingestion | $5.00 |
| Virtual Network | Standard | 1 VNet, Service Endpoints | $0.00 |
| Managed Identity | - | System-assigned | $0.00 |
| Network Lockdown | - | Firewall and access restriction config | $0.00 |
| AI Foundry (OpenAI) | S0 | Variable usage | $0.00 |
| Content Safety | S0 | Pay-per-use (within free tier) | $0.00 |
| Form Recognizer | S0 | Pay-per-use (within free tier) | $0.00 |
| Infrastructure Subtotal | | | $74.50 |
| Networking Subtotal | | | $0.00 |
| Total | | | ~$85/month |
Production Environment
Configuration: Premium compute (P0v3) with VNet, Service Endpoints, and deny-by-default lockdown.
| Service | SKU | Specification | Monthly Cost | % of Total |
|---|
| App Service Plan | P0v3 | 1 vCPU, 4 GB RAM | $57.00 | 38% |
| SQL Database | Basic | 5 DTUs, 2 GB max | $5.00 | 3% |
| Container Registry | Basic | 10 GB storage | $5.00 | 3% |
| API Management | Consumption | Pay-per-call | $15.00 | 10% |
| Storage Account | Standard LRS | Moderate usage | $5.00 | 3% |
| Key Vault | Standard | Production operations | $1.00 | 1% |
| Application Insights | Consumption | ~5 GB ingestion | $15.00 | 10% |
| Virtual Network | Standard | 1 VNet, 4 subnets | $0.00 | 0% |
| Managed Identity | - | System-assigned | $0.00 | 0% |
| Network Lockdown | - | Firewall and access restriction config | $0.00 | 0% |
| AI Foundry (OpenAI) | S0 | Variable usage | $0.00 | 0% |
| Content Safety | S0 | Pay-per-use (within free tier) | $0.00 | 0% |
| Form Recognizer | S0 | Pay-per-use (within free tier) | $0.00 | 0% |
| Infrastructure Subtotal | | | $88.00 | 85% |
| Networking Subtotal | | | $0.00 | 0% |
| Total | | | ~$103/month | 100% |
Side-by-Side Comparison
| Component | Development | Staging | Production | Notes |
|---|
| App Service Plan | B2 ($25) | P0v3 ($57) | P0v3 ($57) | Dev stays cheaper |
| vCPU | 2 | 1 | 1 | Scale up as needed |
| RAM | 3.5 GB | 4 GB | 4 GB | VNet integration on Premium |
| Instances | 1 | 1 | 1 | Add instances for HA |
| VNet Integration | Yes (free) | Yes (free) | Yes | All envs use VNet |
| SQL Database | Basic ($5) | Basic ($5) | Basic ($5) | Basic across all envs |
| Container Registry | Basic ($5) | Basic ($5) | Basic ($5) | Basic across all envs |
| API Management | Consumption ($5) | Consumption ($10) | Consumption ($15) | Mandatory for all envs |
| Storage Account | LRS ($1) | LRS ($2) | LRS ($5) | Minimal usage |
| Key Vault | ~$0 | ~$0 | $1 | Essentially free |
| App Insights | $0 | $5 | $15 | First 5 GB free |
| VNet | Enabled ($0) | Enabled ($0) | Enabled ($0) | Free in all envs |
| Service Endpoints | Yes ($0) | Yes ($0) | Yes ($0) | Free in all envs |
| Private Endpoints | Disabled | Disabled | Disabled | Optional, not baseline |
| AI Services | S0 ($0) | S0 ($0) | S0 ($0) | Pay-per-use |
| Infrastructure | $36.50 | $74.50 | $88.00 | Fixed costs |
| Networking Lockdown | $0.00 | $0.00 | $0.00 | Config-only |
| Monthly Total | ~$42 | ~$85 | ~$103 | |
| Annual Total | ~$504 | ~$1,020 | ~$1,236 | |
Optional Private Endpoints Cost Breakdown
Private Endpoints are not part of the baseline env files today. If enabled later for a stricter isolation model, they become the main networking cost driver.
| Component | Quantity | Unit Cost | Monthly Cost |
|---|
| Private Endpoints | 5 | $7.30/each | $36.50 |
| Private DNS Zones | 5 | $0.50/each | $2.50 |
| Data Processing | 100 GB | $0.01/GB | $1.00 |
| Total | | | ~$40/month |
Typical PE candidates: Key Vault, SQL Server, Storage Account, AI Foundry, AI Search
Free Components
These resources have no additional cost:
| Component | Why Free |
|---|
| Virtual Network | VNet itself is free |
| Subnets | No charge for subnets |
| Service Endpoints | Free security feature |
| Managed Identity | No cost for identities |
| Key Vault | ~$0.03 (negligible) |
| Application Insights | Within 5 GB free tier |
| Content Safety | Within 5k free requests |
| Form Recognizer | First 500 pages free |
Scaling Options
App Service Plans
| Tier | vCPU | RAM | Monthly Cost | VNet Integration |
|---|
| B1 | 1 | 1.75 GB | $12 | No (Service Endpoints only) |
| B2 | 2 | 3.5 GB | $25 | No (Service Endpoints only) |
| S1 | 1 | 1.75 GB | $69 | Yes |
| P0v3 | 1 | 4 GB | $57 | Yes |
| P1v3 | 2 | 8 GB | $113 | Yes |
| P2v3 | 4 | 16 GB | $226 | Yes |
SQL Database Tiers
| Tier | DTUs | Max Size | Monthly Cost | Use Case |
|---|
| Basic | 5 | 2 GB | $5 | Light workloads |
| S0 | 10 | 250 GB | $15 | Small apps |
| S1 | 20 | 250 GB | $30 | Small-medium |
| S2 | 50 | 250 GB | $75 | Medium apps |
| S3 | 100 | 250 GB | $150 | Medium-large |
Container Registry Tiers
| Tier | Storage | Monthly Cost | Private Endpoint | Use Case |
|---|
| Basic | 10 GB | $5 | No | Development |
| Standard | 100 GB | $20 | No | Staging |
| Premium | 500 GB | $50 | Yes | Production (geo-replication) |
AI Services Pricing
Costs depend on your Azure AI Foundry deployment (region + model + version). Multiply monthly input/output token volumes by the per-1M-token rates.
GPT-5.1
| Direction | Cost per 1M Tokens |
|---|
| Input | $2.50 |
| Output | $10.00 |
GPT-5.2
| Direction | Cost per 1M Tokens |
|---|
| Input | $5.00 |
| Output | $15.00 |
Embeddings (text-embedding-3-small)
| Model | Cost per 1M Tokens |
|---|
| text-embedding-3-small | $0.10 |
| text-embedding-3-large | $0.13 |
Content Safety (S0 - Pay-per-use)
| Tier | Free Tier | Additional Cost |
|---|
| S0 | 5,000 requests/month | $1.00 per 1,000 requests |
Development stays free: With 5,000 free requests per month, typical development usage stays within the free tier. Only production workloads may exceed this limit.
| Tier | Free Tier | Additional Cost |
|---|
| S0 | 500 pages/month | Varies by feature ($1-$10 per 1,000 pages) |
Development stays free: With 500 free pages per month, typical development usage stays within the free tier.
Optional Add-ons
| Service | SKU | Monthly Cost | Notes |
|---|
| AI Search | Basic | $75 | Vector search, RAG workloads |
Cost Optimization Strategy
Compared to enterprise-grade configurations with premium SKUs everywhere:
| Component | Enterprise | Optimized | Savings |
|---|
| App Service | P2v3 x 3 ($678) | P0v3 ($57) | $621 |
| SQL Database | GP Gen5 2 vCore ($367) | Basic ($5) | $362 |
| Container Registry | Premium x 3 ($150) | Basic x 3 ($15) | $135 |
| APIM | Standard ($700) | Consumption ($30) | $670 |
| AI Search | Standard S1 ($250) | Basic ($75) | $175 |
| Networking | Hub + PE ($120) | PE only ($40) | $80 |
| Production Total | $2,265 | $225 | $2,040 (90%) |
Key Optimization Decisions
- Basic SQL across all environments: Most AI workloads are stateless; 5 DTU handles metadata and config
- Basic ACR across all environments: No need for Premium features or Private Endpoints on container images
- APIM Consumption tier: Pay-per-call instead of fixed monthly cost ($700+ for Standard)
- P0v3 for production: Entry-level Premium with VNet integration; scale up only if needed
- B2 for dev, P0v3 for staging/prod: keep dev cheaper while preserving prod-like networking
- S0 AI services: Pay-per-use with free tiers, no upfront commitment
- Service Endpoints + lockdown by default: Private Endpoints stay optional for stricter isolation later
Cost Monitoring Recommendations
-
Set Azure Cost Management Alerts:
- Alert at 80% of $250/month budget
- Daily spend alert at $10
-
Review AI usage weekly:
- Monitor token consumption
- Optimize prompts to reduce tokens
-
Right-size after 30 days:
- Check App Service CPU/memory usage
- Review SQL DTU utilization
- Scale only if needed
-
Clean up resources:
- Delete old container images
- Archive unused storage blobs