GET
GET /repos/{owner}/{repo}/codespaces/machines — GitHub API
GitHub token (required); https://api.github.com
GitHub APIList available machine types for a repository
- Base URL
- https://api.github.com
- Auth
- Authorization: Bearer <GITHUB_API_KEY>
- Last verified
- 2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 284 tokens · Vary: Accept
→ 284 tokens · Vary: Accept
Critical gotchas
GitHub recommends an Accept: application/vnd.github+json header and an explicit X-GitHub-Api-Version header.
Fine-grained tokens only authorize repositories and permissions selected when the token is created.
cURL
curl -X GET 'https://api.github.com/repos/example-owner/example-repo/codespaces/machines?location=WestUs2&client_ip=example-client-ip&ref=main' \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H 'Accept: application/vnd.github+json' \ -H 'X-GitHub-Api-Version: 2026-03-10'
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| owner | path | string | Yes | The account owner of the repository. The name is not case sensitive. |
| repo | path | string | Yes | The name of the repository without the `.git` extension. The name is not case sensitive. |
| location | query | string | No | The location to check for available machines. Assigned by IP if not provided. |
| client_ip | query | string | No | IP for location auto-detection when proxying a request |
| ref | query | string | No | The branch or commit to check for prebuild availability and devcontainer restrictions. |
Response 200 OK
{
"total_count": 0,
"machines": [
{
"name": "standardLinux",
"display_name": "4 cores, 16 GB RAM, 64 GB storage",
"operating_system": "linux",
"storage_in_bytes": 68719476736,
"memory_in_bytes": 17179869184,
"cpus": 4,
"prebuild_availability": "ready"
}
]
} Get a free GitHub API key → sponsored Affiliate link - we may earn a commission, at no extra cost to you.