# GitHub Codespaces

Official pricing: https://docs.github.com/en/billing/concepts/product-billing/github-codespaces  
Category: dev-env · Isolation: vm

## Pricing regimes (raw)

- **Pay-as-you-go machine types (per active hour)** (sizes): 2-core 2 vCPU/8 GiB $0.18/h; 4-core 4 vCPU/16 GiB $0.36/h; 8-core 8 vCPU/32 GiB $0.72/h; 16-core 16 vCPU/64 GiB $1.44/h; 32-core 32 vCPU/128 GiB $2.88/h

## Features

Yes: snapshots, pause/resume, persistent disk, idle auto-stop, ≥24 h sessions, custom image (Docker or snapshot), start from your own snapshot, your own Docker/OCI image, full VM (own kernel), Docker inside, root, SSH, HTTPS preview URLs, open internet, SOC 2, SSO, Python, Node.js, Go, Java, audit logs, EU data residency, spend limits, gVisor or VM (no shared kernel), inbound access rules, firewall inside (nftables)

No: memory snapshots, fork/clone, volumes, nested virtualization, browser, desktop GUI, computer-use API, code interpreter, browser + desktop control, anti-bot stealth, CAPTCHA solving, residential IPs, preinstalled agents, public IPv4, custom domains, raw TCP inbound, egress allowlist, static egress IP, self-hosting, BYOC, open source, HIPAA, GPU, arm64, Windows, macOS, GPU desktop, HTTP method/path egress rules, wake on request, live resize, live fork (no pause), memory fork, MCP server, automatic snapshots, snapshots on demand, agent harness API, hosted agent API (their own agent), secret proxy, secret proxy for any API, extra volumes, shared volumes

Unknown: everything else. Evidence (source + quote) per feature: https://battleships.dev/data/providers/github-codespaces.json → feature_evidence

## Caveats

- Compute price per machine type is official ($0.09/core-hour); 'included usage multiplier' = core count, so free quotas are core-hours, not wall-clock hours (120 core-hours = 30 h on a 4-core).
- Billing granularity/rounding is not published (usage 'reported to the billing service every hour'); granularity_s null.
- Storage is $0.07/GB-month metered in GB-hours of USED space (repo, data, extensions, custom dev-container image), not the machine's disk size. Default universal image is free. Billed while the codespace exists, running or stopped; accumulated storage for the month is not reduced by deleting.
- Stopped codespaces auto-delete after the retention period (default and max 30 days; 0 = delete on stop), except 'Keep codespace' which retains indefinitely (storage billed). Org policy can cap retention. snapshot_gib_month = stopped-codespace storage rate; no memory state is kept. features.snapshot = 'fs' (verifier 2026-09-28, was 'none', which made the engine reject retained-state workloads): no snapshot API, but a stopped codespace keeps its filesystem.
- Prebuilds: built with GitHub Actions minutes (billed as Actions) plus storage at $0.07/GB-month per prebuild per region per retained version (default all regions x 2 versions). Not modelled in the card.
- Org billing is gated by budgets: the org pays only if it has no Codespaces budget or a non-zero one; 'Stop usage when budget limit is reached' blocks create/resume. The '$0 default spending limit' for orgs is legacy wording; the current pricing page shows Free orgs with a '$0 spend limit' and Team/Enterprise with 'Ability to increase spend limit'.
- Team $4 and Enterprise $21 per user/month are shown as 'for the first 12 months *' on github.com/pricing; the footnoted later price was not captured. Seat fees are for GitHub itself, not Codespaces-specific.
- Egress set to 0: the billing doc says a codespace incurs two charges (compute and storage); no network charge is documented anywhere.
- Regions from the REST API geo enum (UsEast, UsWest, EuropeWest, SoutheastAsia); older research also listed Australia, not found in current docs. No regional price difference.
- RAM per machine = 4 GB/core (official at 2- and 32-core). 4-core/8-core disk sizes from a GitHub community thread (third-party-grade); 16-core disk unpublished. No GPU machine types in current docs.
- Personal free quota is carried as plan included_usd (compute only), not free.monthly_credit, to avoid double counting; it is per personal account, so a team of N developers each billing their own account gets N quotas (engine sees one).
- No benchmark data in this research set (perf all null). Cold create without prebuild takes tens of seconds to minutes (unmeasured).
- Per-user caps exist but are unpublished: docs (Creating a codespace for a repository, 2026-09-28) say "There are limits to the number of codespaces you can create, and the number of codespaces you can run at the same time. These limits vary based on a number of factors." A fleet of dozens of concurrent codespaces on one personal account is unlikely to be allowed; org-owned codespaces spread over many users are the realistic route. Numbers unknown, so plan.concurrency stays null.
- Idle timeout: default 30 min, configurable 5-240 min (4 h). Activity = typing/mouse or terminal input or output; a background process with no terminal output does not count, so an unattended agent that prints nothing stops after at most 4 h idle. No hard session cap otherwise (not encoded as max_session_h because a loop that writes to a terminal stays active).
- GPU machine type was deprecated by 2025-08-29 (NCv3 retirement); features.gpu=false is correct and should cite this.
- Org policy 'Maximum codespaces per user' can cap org-billed codespaces per user (active + stopped); separately 'The number of organization-billed codespaces someone can create is governed by a limit to the total number of codespaces that they can create across all repositories they can access. This limit is set by GitHub.' (value unpublished).
- Prebuild storage is a separate billing SKU (codespaces_prebuild_storage) from codespaces_storage; both at the $0.07/GB-month storage rate and both count toward the Codespaces budget.

## How this provider charges


Codespaces is a cloud dev environment, not an API sandbox. Each codespace is a dev container on its own Azure VM.
There is one compute rate card: fixed machine types priced linearly at **$0.09 per core-hour** (RAM 4 GB/core, not
priced separately), plus **$0.07/GB-month** storage metered on used space. Prices are identical in every region
and for every payer. What changes the bill is *who pays* (personal quota vs org), how sessions end (idle-timeout
tail), how long stopped codespaces and prebuilds are retained, and seat fees for the GitHub plan the org is on.

4 vCPU / 8 GiB → no such shape; closest is **4-core / 16 GB = $0.36/h**.

## Regime table

| Regime | When it applies | How billed | Numbers | Source |
|---|---|---|---|---|
| Pay-as-you-go machine types | Any billed codespace | Per active hour per machine type (active = created/started until stopped, deleted or idle-timed-out), regardless of CPU use; usage reported hourly, billed monthly; exact rounding unpublished | 2-core $0.18, 4-core $0.36, 8-core $0.72, 16-core $1.44, 32-core $2.88 per hour; "included usage multiplier" = cores | https://docs.github.com/en/billing/concepts/product-billing/github-codespaces |
| Machine specs | Choice at create / change later | Fixed presets, 4 GB RAM per core | 2c/8 GB/32 GB … 32c/128 GB/128 GB (official); 4c/16 GB/32 GB and 8c/32 GB/64 GB disk per community thread (**third-party**); a 4c/64 GB variant also exists; 16c disk unpublished | https://docs.github.com/en/codespaces/about-codespaces/what-are-codespaces, https://github.com/orgs/community/discussions/145944 |
| Personal free quota (GitHub Free) | Codespaces billed to a personal account | Monthly quota in **core-hours**, resets each cycle; blocked when exhausted unless a payment method is on file | 120 core-hours (= 60 h 2-core / 30 h 4-core, $10.80) + 15 GB-month ($1.05) | billing doc, https://docs.github.com/en/get-started/learning-about-github/githubs-plans |
| Personal free quota (GitHub Pro) | Personal account on Pro | Same mechanics | 180 core-hours ($16.20) + 20 GB-month ($1.40); Pro subscription price **not on live official pages** ($4/mo is prior research / third-party) | same |
| Personal overage | Quota used + payment method | List price, capped by any budget the user set (stop-usage option blocks create/resume) | list rates | https://docs.github.com/en/billing/how-tos/set-up-budgets |
| Org-owned, GitHub Team | Org chose organization-owned codespaces, user enabled | No free quota; org pays list rates; pays only if no Codespaces budget or a non-zero one | $4/user/month "for the first 12 months *" (footnoted later price not captured) + usage | https://github.com/pricing, https://docs.github.com/en/codespaces/managing-codespaces-for-your-organization/choosing-who-owns-and-pays-for-codespaces-in-your-organization |
| Org-owned, Enterprise Cloud | Same, enterprise account | Same list rates; enterprise/cost-center budgets, SSO, audit logs | "Starting at $21/user/month for the first 12 months *"; volume discounts via sales, unpublished | https://github.com/pricing |
| Org on GitHub Free | Free org | Org **cannot** pay; creator pays personally (uses their personal quota) | "$0 spend limit" | pricing page, who-pays doc |
| User-owned in an org | Org sets user-owned, or user not enabled | Creator pays from personal quota/card | list rates | who-pays doc |
| Idle tail | Codespace not stopped explicitly | Full compute rate until idle timeout; typing, mouse and **terminal output** reset the timer | default 30 min; 5–240 min; org can set a max | https://docs.github.com/en/codespaces/setting-your-user-preferences/setting-your-timeout-period-for-github-codespaces |
| Stopped codespace storage | Codespace exists but stopped | $0.07/GB-month in GB-hours of **used** space (repo, data, extensions, custom image); default universal image free; month-to-date storage never decreases | $0.07/GB-month | billing doc, included-usage doc |
| Retention / auto-delete | Stopped codespaces | Auto-deleted after retention; "Keep codespace" = indefinite (storage keeps billing, not allowed under org retention policy) | default and max 30 days; 0 = delete on stop | https://docs.github.com/en/codespaces/setting-your-user-preferences/configuring-automatic-deletion-of-your-codespaces |
| Prebuilds | Prebuild configuration on a repo | GitHub Actions minutes to build (billed as Actions) + storage per prebuild **per region per retained version** | default: all regions × 2 versions (1–5); storage $0.07/GB-month | https://docs.github.com/en/codespaces/prebuilding-your-codespaces/configuring-prebuilds |
| Budgets | Any account | Monthly $ budgets per account/org/repo/cost center; optional hard stop blocks creating/resuming codespaces | alerts 75/90/100%; included-usage alerts 90/100% | https://docs.github.com/en/billing/concepts/budgets-and-alerts |
| Network | All traffic | No network charge documented (doc: "two types of charges": compute, storage) | $0 | billing doc |
| Regions | UsEast, UsWest, EuropeWest, SoutheastAsia (REST geo enum) | One global price | multiplier 1 | https://docs.github.com/en/rest/codespaces/codespaces |
| GPU | — | Not offered in current docs (older GPU machine types appear discontinued) | n/a | machine-type docs |

No upcoming price change found in the pages read (changelog history not checked).

## Gotchas

1. **Core-hours, not hours.** The free "120 hrs" is 120 *core*-hours: 30 h on a 4-core machine.
2. **No 4 vCPU / 8 GiB shape.** RAM is 4 GB/core, so a 4 vCPU workload always pays for 16 GB.
3. **Idle is billed.** A codespace bills until stopped or idle-timed-out; a served app writing to the terminal keeps resetting the timer, so it may never time out.
4. **Storage is cumulative within the month.** Deleting a codespace slows accrual but never lowers the month-to-date figure.
5. **Prebuild storage multiplies.** Default is every region × 2 versions, and prebuilds consume storage even with zero codespaces.
6. **Orgs get no free quota**, and a GitHub Free org cannot pay at all. Org billing only flows if there is no budget or a non-zero one.
7. **Personal accounts are hard-stopped** when quota runs out without a payment method (export-to-branch is the escape hatch).
8. **Seat prices are "for the first 12 months *"** on the live pricing page; the post-promo price was not captured.
9. **"Keep codespace"** disables auto-deletion and keeps the storage meter running indefinitely.
10. **Third-party-only facts:** intermediate disk sizes (community thread) and the GitHub Pro price ($4) are not on live official pages.

## Worked example

Workload: 4 vCPU / 8 GiB → **4-core/16 GB at $0.36/h**; 50 concurrent × 8 h/day × 22 days = **8,800 h**; 30% CPU
(irrelevant: billed on active time); 50 GiB retained storage; 100 GiB egress.

Compute 8,800 × $0.36 = **$3,168.00**. Default 30-min idle tail if not stopped: 1,100 sessions × 0.5 h × $0.36 =
**$198.00**. Storage 50 GB-month × $0.07 = **$3.50** (stopped codespaces must survive, retention ≥ 1 day). Egress **$0**.

| Regime | Feasible? | Monthly total |
|---|---|---|
| Org-owned, GitHub Team, stopped explicitly | Yes | **$3,371.50** = $3,168 + $3.50 + 50 × $4 seats |
| Org-owned, GitHub Team, default idle timeout | Yes | **$3,569.50** (+$198 idle tail) |
| Org-owned, Enterprise Cloud | Yes | **$4,419.50** = $3,168 + $198 + $3.50 + 50 × $21 |
| Each developer pays personally (GitHub Free) | Yes (needs card on file) | 704 core-h − 120 free = 584 × $0.09 = $52.56 + $3.96 tail per dev (1 GB-month each is inside 15 GB) → **$2,826.00** for 50 devs ($2,628 if stopped explicitly) |
| Each developer on GitHub Pro | Yes | 524 core-h × $0.09 = $47.16 + $3.96 tail per dev → **$2,556.00** + 50 × Pro fee (unpublished on live pages) |
| Anti-pattern: 240-min timeout, never stopped | Yes | +4 h/day billed: 50 × 12 × 22 × $0.36 = $4,752 compute alone |
| Anti-pattern: prebuilds in 4 regions × 2 versions of a 10 GB image | Yes | +80 GB-month ≈ +$5.60 + Actions minutes (not included above) |
