Skip to content

List available machine types for a repository

GET
/repos/{owner}/{repo}/codespaces/machines

List the machine types available for a given repository based on its configuration.

OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

location
string
Example
WestUs2

The location to check for available machines. Assigned by IP if not provided.

client_ip
string

IP for location auto-detection when proxying a request

ref
string
Example
main

The branch or commit to check for prebuild availability and devcontainer restrictions.

Response

Media type application/json
object
total_count
required
integer
machines
required
Array<object>
Codespace machine

A description of the machine powering a codespace.

object
name
required

The name of the machine.

string
display_name
required

The display name of the machine includes cores, memory, and storage.

string
operating_system
required

The operating system of the machine.

string
storage_in_bytes
required

How much storage is available to the codespace.

integer
memory_in_bytes
required

How much memory is available to the codespace.

integer
cpus
required

How many cores are available to the codespace.

integer
prebuild_availability
required

Whether a prebuild is currently available when creating a codespace for this machine and repository. If a branch was not specified as a ref, the default branch will be assumed. Value will be “null” if prebuilds are not supported or prebuild availability could not be determined. Value will be “none” if no prebuild is available. Latest values “ready” and “in_progress” indicate the prebuild availability status.

string
nullable
Allowed values: none ready in_progress
Examples
Example default
{
"total_count": 2,
"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
},
{
"name": "premiumLinux",
"display_name": "8 cores, 32 GB RAM, 64 GB storage",
"operating_system": "linux",
"storage_in_bytes": 68719476736,
"memory_in_bytes": 34359738368,
"cpus": 8
}
]
}

Not modified

Requires authentication

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Forbidden

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Resource not found

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Internal Error

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}