How to fix P5008: Usage exceeded, upgrade your plan (Accelerate) in Prisma
This error occurs when your Prisma Accelerate project exceeds the included query limit on your current pricing plan. It only occurs on the free tier when you hit the 60,000 monthly queries limit.
Quick fix
Fixes P5008: Usage exceeded, upgrade your plan (Accelerate)
// Before: Fetches all fields
const users = await prisma.user.findMany();
// After: Only fetch needed fields
const users = await prisma.user.findMany({
select: { id: true, email: true, name: true }
});- Verify you are on the free tier
- Upgrade to a paid plan
- Wait for quota reset (free tier only)
- Optimize queries to reduce usage
// Before: Fetches all fieldsconst users = await prisma.user.findMany();// After: Only fetch needed fieldsconst users = await prisma.user.findMany({select: { id: true, email: true, name: true }});P5008: Usage exceeded, upgrade your plan (Accelerate)
What this error means
The P5008 error indicates that your Prisma Accelerate project has exhausted the included usage for your current billing plan. This error can only occur when using Prisma Accelerate on the free tier. The free tier of Prisma Accelerate includes 60,000 database queries per month. Once you exceed this limit, Prisma pauses access to your database to prevent unexpected charges. This is a protective billing mechanism that gives you control over your costs. It's important to note that queries are counted at the Prisma Client invocation level. A single Prisma query that translates into multiple SQL statements under the hood still counts as just one query. Additionally, cached queries also count toward your usage limit—even if a query is served from the cache, it contributes to your monthly quota.
Typical symptoms
- Database queries fail with "P5008: Usage exceeded" error message
- All database operations suddenly stop working mid-month
- Application shows database connectivity errors but connection string is valid
- Error occurs after a high-traffic period or spike in database usage
- The project worked fine but stopped after reaching a certain date or query count
- Prisma Studio or database explorer show connection refused errors
Common causes
- Your application has exceeded the 60,000 free-tier monthly query limit on Prisma Accelerate
- Unoptimized queries causing excessive database request volume (N+1 queries, missing indexes)
- Background jobs or scheduled tasks making frequent database calls
- Sudden traffic spike to your application without corresponding plan upgrade
- Development or testing environment queries counting against the free tier limit
- Caching not properly configured, causing redundant database requests
- Third-party integrations or webhooks making unexpected database calls
How to fix "P5008: Usage exceeded, upgrade your plan (Accelerate)"
First, confirm your project is on the free tier:
1. Log in to [Prisma Data Platform](https://console.prisma.io)
2. Navigate to your workspace
3. Go to Billing → Pricing Plans
4. Check your current plan—if it says "Free," you have hit the limit
You can also check your current usage:
1. Go to Workspace Settings → Usage & Billing
2. View your "Queries" section
3. If it shows "60,000 / 60,000," you have exceeded the limit
The error P5008 only occurs on the free plan. Paid plans have higher limits and will not pause access when limits are approached.
The quickest solution is to upgrade to a paid plan:
1. Go to Workspace Settings → Billing → Pricing Plans
2. Select your desired tier:
- Starter: 10 million queries/month (pay-as-you-go pricing)
- Pro: 50 million queries/month
- Business: Custom limits
3. Choose your payment method and confirm
4. Your project will immediately resume access
After upgrading, your database will be accessible again within seconds. Paid plans offer:
- Higher query limits
- Cost controls with spend alerts at 75% of your limit
- No service interruption when usage increases
- Per-query rate pricing instead of monthly tiers
If you prefer not to upgrade immediately:
1. Your quota resets automatically at the beginning of next month
2. Database access will resume when the monthly reset occurs (usually UTC midnight on the 1st)
3. You can continue using Prisma Accelerate on the free tier next month
Important: This approach means your application will be unable to access the database for the remainder of the current billing month. Plan accordingly if your application needs continuous availability.
You will receive notifications from Prisma before your project pauses, giving you time to upgrade if needed.
While waiting for the next billing cycle or preparing for upgrade, implement query optimization to reduce future usage:
Use field selection (select):
// Before: Fetches all fields
const users = await prisma.user.findMany();
// After: Only fetch needed fields
const users = await prisma.user.findMany({
select: { id: true, email: true, name: true }
});Implement pagination:
// Before: Could fetch 10,000+ records in one query
const allUsers = await prisma.user.findMany();
// After: Fetch 100 at a time
const users = await prisma.user.findMany({
take: 100,
skip: 0,
orderBy: { id: 'asc' }
});Cache frequently accessed data:
// Use Redis, Memcached, or application-level caching
const cachedUser = await redis.get(`user:${id}`);
if (!cachedUser) {
const user = await prisma.user.findUnique({ where: { id } });
await redis.setex(`user:${id}`, 3600, JSON.stringify(user));
}These optimizations reduce the number of database queries, lowering your monthly usage.
Understand where your queries are coming from:
Enable Prisma query logging:
const prisma = new PrismaClient({
log: [
{ emit: 'event', level: 'query' },
{ emit: 'stdout', level: 'error' },
],
});
prisma.$on('query', (e) => {
console.log('Query: ' + e.query);
console.log('Duration: ' + e.duration + 'ms');
});Use Prisma Studio to review your schema:
npx prisma studioCheck for problematic patterns:
- N+1 queries: Fetching parent records, then fetching related records one-by-one
- Unnecessary queries in loops
- Missing indexes on frequently queried fields
- Unoptimized relationship loading
Once you identify high-traffic areas, optimize them first.
After upgrading, configure alerts to prevent hitting limits unexpectedly:
1. Go to Workspace Settings → Billing
2. Look for "Usage Alerts" or "Spending Limits"
3. Set your monthly spending limit (paid plans allow this)
4. Enable email notifications at 75% of your limit
Prisma will send you an alert when you reach 75% of your configured limit, giving you time to either:
- Upgrade to a higher tier
- Optimize queries to reduce usage
- Plan for expected high-traffic periods
For production applications, it's recommended to always have a paid plan with generous limits to ensure uninterrupted service.
Advanced notes
Understanding Accelerate Quotas: The free tier limit is shared across your entire project. Every query—whether from your production app, development environment, or Prisma Studio—counts toward the 60,000 monthly quota. If you're running multiple environments (dev, staging, production) against the same Accelerate project, consider using separate connection strings or projects for non-production environments.
Query Counting Details: Prisma counts queries at the client invocation level, not at the SQL statement level. This means if one Prisma query translates to 5 SQL statements (due to joins, relation loading, etc.), it still counts as 1 query. However, this also means cached queries count. If you execute the same query 100 times and it hits the cache 99 times, all 100 count toward your quota.
Migration Path: If you consistently exceed the free tier, calculate which paid tier makes sense:
- Starter plan: 10M queries/month (pay-as-you-go)
- Pro plan: 50M queries/month (fixed price + overage)
- Business plan: Custom pricing
At high volumes, per-query costs on Accelerate's pay-as-you-go model are very affordable (typically under $0.0001 per query).
Development Environment Strategy: To avoid consuming free-tier quota on development databases, consider:
1. Running a local PostgreSQL instance for local development
2. Using a separate Prisma project/workspace for non-production environments
3. Implementing local caching for frequent queries in development
4. Using database snapshots or seeded databases to minimize queries during testing
Comparison with Direct Database Access: Accelerate queries count separately from direct database connections. If you bypass Accelerate and connect directly to your database, those queries won't count toward the Accelerate quota. However, you lose Accelerate's caching and connection pooling benefits.
Frequently asked questions
- What does "P5008: Usage exceeded, upgrade your plan (Accelerate)" mean?
- The P5008 error indicates that your Prisma Accelerate project has exhausted the included usage for your current billing plan. This error can only occur when using Prisma Accelerate on the free tier. The free tier of Prisma Accelerate includes 60,000 database queries per month.
- How do I fix "P5008: Usage exceeded, upgrade your plan (Accelerate)"?
- This error occurs when your Prisma Accelerate project exceeds the included query limit on your current pricing plan. It only occurs on the free tier when you hit the 60,000 monthly queries limit.
- What causes "P5008: Usage exceeded, upgrade your plan (Accelerate)"?
- Your application has exceeded the 60,000 free-tier monthly query limit on Prisma Accelerate Unoptimized queries causing excessive database request volume (N+1 queries, missing indexes) Background jobs or scheduled tasks making frequent database calls
- Is the "P5008: Usage exceeded, upgrade your plan (Accelerate)" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- 📚Prisma Official Documentation
- 📖prisma.io - faq(Official Docs)
- 📖prisma.io - pricing(Official Docs)
- 📖prisma.io - bring your own database(Official Docs)
- 📖prisma.io - plans and quotas(Official Docs)
- 🐙github.com - 23942(GitHub)