You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You're charged for two things: compute time (while running) and storage (even when stopped)
Storage charges continue for stopped Codespaces until you delete them
Free tier limits reset monthly, but billing cycles for overages may differ
Budget configuration is required for usage beyond free tiers (even with valid subscriptions)
How Codespaces Billing Works
The Two Components of Codespaces Charges
Component
When Charged
Rate Basis
Stops When
Compute
Codespace is running
Per core-hour
Codespace is stopped or deleted
Storage
Codespace exists (running OR stopped)
Per GB per month
Codespace is deleted
💡 Many users are surprised by storage charges because they assume stopping a Codespace stops all charges. It doesn't—only deletion stops storage billing.
1. Go to Settings → Billing and licensing
2. Scroll to "Budgets and alerts"
3. Click "New budget"
4. Select "Codespaces"
5. Set amount (minimum $1, recommend $10-50)
6. Choose "Pause service at limit" (safer) or "Allow overage"
7. Save and wait 2-5 minutes for activation
8. Clear browser cache and retry
6: "Charges appeared outside my expected billing cycle"
Understanding billing cycles:
Type
Cycle
Example
Free tier reset
1st of each month (UTC)
Resets Feb 1, Mar 1, etc.
Subscription billing
Your signup anniversary
If you signed up Jan 15, bills on 15th
Metered usage billing
End of month, charged on bill cycle day
Usage calculated monthly, charged on anniversary
Why this causes confusion: Your free tier resets on the 1st, but overage charges appear on your subscription anniversary date. This can make charges seem "late" or "early."
Setting Up Budgets
For Personal Accounts:
Settings → Billing and licensing → Budgets and alerts → New budget
├── Service: Codespaces
├── Amount: $10-50 (adjust to your needs)
├── Behavior: "Pause service at limit" (recommended)
└── Save
Configuring Cost-Saving Settings
1. Idle Timeout (stops compute charges)
Settings → Codespaces → Default idle timeout
Recommended: 30 minutes (default is 30)
Aggressive: 15 minutes (for maximum savings)
2. Retention Period (stops storage charges)
Settings → Codespaces → Default retention period
Recommended: 7-14 days
Note: Codespaces are deleted after this period of inactivity
3. Default Machine Type
Settings → Codespaces → Default machine type
Recommended: 2-core (cheapest, sufficient for most work)
Only upgrade when you need more power
Billing Troubleshooting Quick Reference
Error: "You seem to have a billing issue"
Check
Action
Budget exists?
Create one (Settings → Billing → Budgets)
Budget > $0?
Set to at least $1
Payment method valid?
Update or re-add it
PayPal authorized?
Check PayPal.com → Automatic payments
Browser issue?
Try incognito mode or different browser
If all checks pass: Wait 48 hours, then contact GitHub Support with screenshots.
Prebuilds and Their Billing Impact
What Are Prebuilds?
Prebuilds are pre-configured Codespace images that reduce startup time. They're built automatically when you push to configured branches.
How Prebuilds Affect Billing
Prebuild Activity
Charge Type
Who Pays
Building the prebuild
Actions Compute
Repo owner (or org)
Storing the prebuild
Storage
Repo owner (or org)
Using a prebuild
Normal Codespace rates
User who creates Codespace
Prebuild Cost Example
Scenario: Repository with prebuilds on main branch, 10 pushes/week
Repository → Settings → Codespaces → Prebuilds
├── Find active prebuilds
├── Click "..." menu
└── Select "Delete" or "Disable"
Keep in mind that prebuilds are stored per region (at $1.05 each), so enabling all 5 regions which is the default setting—costs $5.25, and this multiplies further based on the number of versions retained in your 'Template history' settings, meaning the maximum of 5 versions across all 5 regions equates to storing 25 codespaces at $26. 25.
Edge Cases and Advanced Scenarios
Edge Case 1: Multiple Organizations
Situation: You belong to Org A and Org B, plus have personal repos.
How billing works:
Personal repos → Your personal quota/budget
Org A repos → Org A's budget (if enabled) or your personal quota
Org B repos → Org B's budget (if enabled) or your personal quota
Potential confusion: If orgs don't enable Codespaces billing, you may hit your personal limits faster than expected.
Edge Case 2: Forked Repositories
Situation: You fork a repo and create a Codespace in your fork.
Billing: Charged to your account (the fork owner), not the original repo owner.
Edge Case 3: Codespace in Organization Repo (Org Billing Disabled)
Situation: Org has Codespaces disabled for billing, but you can still see the Codespaces button.
What happens: Creating a Codespace may fail, or it may charge your personal account (depending on org settings).
Best practice: Check with org admin before creating Codespaces in org repos.
Edge Case 4: Billing Block with Work Trapped Inside
Emergency steps:
Check for pushed branches:
Your work may already be pushed to a branch
Look for branches named codespaces/* or recent branches
Use GitHub CLI:
gh repo clone owner/repository
git branch -a # Look for your work
Contact support urgently:
State: "URGENT: Unsaved work trapped in locked Codespace"
Include Codespace name and repository
Request expedited assistance
Edge Case 5: Charges After Deletion
If charges continue 48+ hours after deleting all Codespaces:
Stopping ≠ Deleting — Stopped Codespaces still cost money (storage). Delete what you don't need.
Budgets are required — Even with a valid subscription and free tier, you need a budget configured.
Machine size matters — A 4-core machine uses your free tier twice as fast as a 2-core.
Two billing cycles — Free tier resets on the 1st; subscription charges on your anniversary date.
Prebuilds add up — They run automatically and charge compute + storage. Disable on inactive repos.
This guide is community-maintained and designed to complement official GitHub documentation. For the most current pricing and policies, always refer to GitHub's official resources.
CodespacesYour development environment, in the cloud. Run VS Code and code on GitHub's cloud platform,Best PracticesBest practices, tips & tricks, and articles from GitHub and its users
2 participants
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What This Guide Covers (and What It Doesn't)
✅ This Guide Covers:
❌ This Guide Does NOT Cover:
What makes Codespaces billing unique:
How Codespaces Billing Works
The Two Components of Codespaces Charges
💡 Many users are surprised by storage charges because they assume stopping a Codespace stops all charges. It doesn't—only deletion stops storage billing.
Compute Billing Explained
Core-hours measure compute usage:
Current compute rates by machine type:
Storage Billing Explained
GB-months measure storage usage:
Current storage rate: ~$0.07 per GB per month
What counts toward storage:
Free Tier Allowances
Individual vs. Organization Billing
Individual Accounts
How it works:
Budget requirement: Even if you have GitHub Pro, you must:
Organization Accounts
How it works:
Common Billing FAQs
1: "I stopped my Codespace but I'm still being charged"
Why this happens: Stopped Codespaces continue consuming storage. You're charged ~$0.07/GB/month for stored data.
Example:
Solution:
2: "I'm being charged but I haven't opened Codespaces in weeks"
Likely causes:
Solution:
3: "I exceeded my free tier—how much will I owe?"
Calculation example:
4: "I'm a student and can't access Codespaces"
The problem: Student accounts with GitHub Student Developer Pack often get stuck at $0 budget with no way to modify it.
Why it happens: GitHub requires a payment method to enable budget controls, even for free tier access.
Solution:
5: "My Codespace is blocked but I have an active subscription"
The problem: Error message: "You seem to have a billing issue. Please adjust your billing settings to continue using codespaces"
Common causes:
Step-by-step resolution:
6: "Charges appeared outside my expected billing cycle"
Understanding billing cycles:
Why this causes confusion: Your free tier resets on the 1st, but overage charges appear on your subscription anniversary date. This can make charges seem "late" or "early."
Setting Up Budgets
For Personal Accounts:
Configuring Cost-Saving Settings
1. Idle Timeout (stops compute charges)
2. Retention Period (stops storage charges)
3. Default Machine Type
Billing Troubleshooting Quick Reference
Error: "You seem to have a billing issue"
If all checks pass: Wait 48 hours, then contact GitHub Support with screenshots.
Prebuilds and Their Billing Impact
What Are Prebuilds?
Prebuilds are pre-configured Codespace images that reduce startup time. They're built automatically when you push to configured branches.
How Prebuilds Affect Billing
Prebuild Cost Example
Scenario: Repository with prebuilds on
mainbranch, 10 pushes/weekWhen to Use Prebuilds
✅ Use prebuilds when:
❌ Skip prebuilds when:
Disabling Prebuilds to Save Costs
Keep in mind that prebuilds are stored per region (at $1.05 each), so enabling all 5 regions which is the default setting—costs $5.25, and this multiplies further based on the number of versions retained in your 'Template history' settings, meaning the maximum of 5 versions across all 5 regions equates to storing 25 codespaces at $26. 25.
Edge Cases and Advanced Scenarios
Edge Case 1: Multiple Organizations
Situation: You belong to Org A and Org B, plus have personal repos.
How billing works:
Potential confusion: If orgs don't enable Codespaces billing, you may hit your personal limits faster than expected.
Edge Case 2: Forked Repositories
Situation: You fork a repo and create a Codespace in your fork.
Billing: Charged to your account (the fork owner), not the original repo owner.
Edge Case 3: Codespace in Organization Repo (Org Billing Disabled)
Situation: Org has Codespaces disabled for billing, but you can still see the Codespaces button.
What happens: Creating a Codespace may fail, or it may charge your personal account (depending on org settings).
Best practice: Check with org admin before creating Codespaces in org repos.
Edge Case 4: Billing Block with Work Trapped Inside
Emergency steps:
Check for pushed branches:
codespaces/*or recent branchesUse GitHub CLI:
gh repo clone owner/repository git branch -a # Look for your workContact support urgently:
Edge Case 5: Charges After Deletion
If charges continue 48+ hours after deleting all Codespaces:
Quick Answers
"How do I stop ALL Codespaces charges immediately?"
"What's the cheapest way to use Codespaces?"
"Can I use Codespaces completely free?"
Yes, if you:
"Why do I need a budget if I have a free tier?"
After GitHub's billing platform migration, budgets are required to:
"How long until charges appear in my billing?"
References to Existing Resources
For General Billing Questions
For Non-Billing Codespaces Questions
Official GitHub Documentation
Getting Help
Summary: The 5 Things Everyone Should Know
Stopping ≠ Deleting — Stopped Codespaces still cost money (storage). Delete what you don't need.
Budgets are required — Even with a valid subscription and free tier, you need a budget configured.
Machine size matters — A 4-core machine uses your free tier twice as fast as a 2-core.
Two billing cycles — Free tier resets on the 1st; subscription charges on your anniversary date.
Prebuilds add up — They run automatically and charge compute + storage. Disable on inactive repos.
This guide is community-maintained and designed to complement official GitHub documentation. For the most current pricing and policies, always refer to GitHub's official resources.
Beta Was this translation helpful? Give feedback.
All reactions