{"meta":{"title":"Codespaces 컴퓨터에 대한 REST API 엔드포인트","intro":"REST API를 사용하여 codespace에 대한 컴퓨터 형식의 사용 가능성을 관리합니다.","product":"REST API","breadcrumbs":[{"href":"/ko/rest","title":"REST API"},{"href":"/ko/rest/codespaces","title":"Codespaces"},{"href":"/ko/rest/codespaces/machines","title":"기계들"}],"documentType":"article"},"body":"# Codespaces 컴퓨터에 대한 REST API 엔드포인트\n\nREST API를 사용하여 codespace에 대한 컴퓨터 형식의 사용 가능성을 관리합니다.\n\n## Codespaces 기기에 대하여\n\n지정된 리포지토리 또는 인증된 사용자로 codespace를 만드는 데 사용할 수 있는 머신 유형을 결정할 수 있습니다. 자세한 내용은 [codespace에 대한 컴퓨터 유형 변경](/ko/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types)을(를) 참조하세요.\n\n`machine` 속성을 업데이트하여 기존 codespace의 머신을 변경할 때 이 정보를 사용할 수도 있습니다. 머신 업데이트는 다음에 codespace를 다시 시작할 때 수행됩니다. 자세한 내용은 [codespace에 대한 컴퓨터 유형 변경](/ko/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace)을(를) 참조하세요.\n\n> \\[!NOTE]\n> 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.\n\n## List available machine types for a repository\n\n```\nGET /repos/{owner}/{repo}/codespaces/machines\n```\n\nList the machine types available for a given repository based on its configuration.\nOAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`location`** (string)\n  The location to check for available machines. Assigned by IP if not provided.\n\n* **`client_ip`** (string)\n  IP for location auto-detection when proxying a request\n\n* **`ref`** (string)\n  The branch or commit to check for prebuild availability and devcontainer restrictions.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **401** - Requires authentication\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **500** - Internal Error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/repos/OWNER/REPO/codespaces/machines\n```\n\n**Response schema (Status: 200):**\n\n* `total_count`: required, integer\n* `machines`: required, array of `Codespace machine`:\n  * `name`: required, string\n  * `display_name`: required, string\n  * `operating_system`: required, string\n  * `storage_in_bytes`: required, integer\n  * `memory_in_bytes`: required, integer\n  * `cpus`: required, integer\n  * `prebuild_availability`: required, string or null, enum: `none`, `ready`, `in_progress`, `null`\n\n## List machine types for a codespace\n\n```\nGET /user/codespaces/{codespace_name}/machines\n```\n\nList the machine types a codespace can transition to use.\nOAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`codespace_name`** (string) (required)\n  The name of the codespace.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n* **401** - Requires authentication\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **500** - Internal Error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/user/codespaces/CODESPACE_NAME/machines\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List available machine types for a repository](#list-available-machine-types-for-a-repository)."}