# Codespaces 컴퓨터에 대한 REST API 엔드포인트

REST API를 사용하여 codespace에 대한 컴퓨터 형식의 사용 가능성을 관리합니다.

## Codespaces 기기에 대하여

지정된 리포지토리 또는 인증된 사용자로 codespace를 만드는 데 사용할 수 있는 머신 유형을 결정할 수 있습니다. 자세한 내용은 [codespace에 대한 컴퓨터 유형 변경](/ko/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types)을(를) 참조하세요.

`machine` 속성을 업데이트하여 기존 codespace의 머신을 변경할 때 이 정보를 사용할 수도 있습니다. 머신 업데이트는 다음에 codespace를 다시 시작할 때 수행됩니다. 자세한 내용은 [codespace에 대한 컴퓨터 유형 변경](/ko/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace)을(를) 참조하세요.

> \[!NOTE]
> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.

## 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.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`owner`** (string) (required)
  The account owner of the repository. The name is not case sensitive.

* **`repo`** (string) (required)
  The name of the repository without the .git extension. The name is not case sensitive.

* **`location`** (string)
  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)
  The branch or commit to check for prebuild availability and devcontainer restrictions.

### HTTP response status codes

* **200** - OK

* **304** - Not modified

* **401** - Requires authentication

* **403** - Forbidden

* **404** - Resource not found

* **500** - Internal Error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/codespaces/machines
```

**Response schema (Status: 200):**

* `total_count`: required, integer
* `machines`: required, array of `Codespace machine`:
  * `name`: required, string
  * `display_name`: required, string
  * `operating_system`: required, string
  * `storage_in_bytes`: required, integer
  * `memory_in_bytes`: required, integer
  * `cpus`: required, integer
  * `prebuild_availability`: required, string or null, enum: `none`, `ready`, `in_progress`, `null`

## List machine types for a codespace

```
GET /user/codespaces/{codespace_name}/machines
```

List the machine types a codespace can transition to use.
OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`codespace_name`** (string) (required)
  The name of the codespace.

### HTTP response status codes

* **200** - OK

* **304** - Not modified

* **401** - Requires authentication

* **403** - Forbidden

* **404** - Resource not found

* **500** - Internal Error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  https://api.github.com/user/codespaces/CODESPACE_NAME/machines
```

**Response schema (Status: 200):**

Same response schema as [List available machine types for a repository](#list-available-machine-types-for-a-repository).