High number of API requests during site migration, looking for help and guidance.
Great question! I can see why this would be concerning during a migration. Let me clarify what's happening with your API usage.
The good news: Studio requests DO NOT count toward your API quota. According to Sanity's 2021 announcement about subscription plans, they explicitly state: "API calls from the Sanity Studio no longer count towards your usage." This was a significant change they made so the Free plan's quota goes further. This is also confirmed by Sanity team members in community discussions.
So those Studio edits you're making? They're not eating into your 62,000 requests.
Where Your API Requests Are Actually Coming From
Your 62,000 API requests are likely coming from your frontend application during development. Here are the most common culprits based on similar cases:
1. Frontend queries hitting the regular API instead of the CDN
Even with useCDN: true configured, certain scenarios bypass the CDN:
- Queries using draft/preview perspectives (only
publishedperspective uses CDN) - Real-time listeners and live queries
- Queries with fresh data requirements
2. Queries in shared components
Navigation bars, footers, and layout components that query on every page load can rack up requests quickly during development. In one similar case, a loadSettings query in the navbar/footer was responsible for a disproportionate amount of API calls.
3. Cache invalidation during active development When you publish changes in Studio, your frontend cache invalidates and triggers fresh requests. During active migration work with 150 pages, this adds up.
How to Fix This
Ensure you're using the API CDN: The API CDN has 1M requests/month on Free (vs only 100k for regular API). Make sure:
- Your production client uses
apicdn.sanity.io(notapi.sanity.io) - Queries use the
publishedperspective when possible - Your client config has
useCdn: truefor published content
Optimize your queries:
- Review which queries run most frequently
- Implement proper caching in your frontend
- For Next.js, leverage ISR/SSG to reduce runtime queries
- Consider GROQ query optimization
Debug your usage: Check your Sanity dashboard for API usage patterns. If you need help identifying which specific queries are the culprit, Sanity support can provide that breakdown with your project ID.
Understanding Your Quotas
According to Sanity's plans documentation:
- API requests: 100k/month (Free plan)
- API CDN requests: 1M/month (Free plan) - 10x more!
The key insight: Most production traffic should hit the CDN, not the regular API. If 62k of your usage is going to the regular API during development, that suggests your queries aren't properly configured for CDN usage.
For a 150-page migration with active development and content editing, 62k requests isn't necessarily alarming during the build phase. But once live, ensure your queries use the CDN to access that much larger quota. If you need more after optimization, the Growth plan ($15/month) includes 1M API requests and 10M CDN requests.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.