{"meta":{"title":"REST-API-Endpunkte für Codespaces-Computer","intro":"Verwende die REST-API, um die Verfügbarkeit von Computertypen für einen Codespace zu verwalten.","product":"REST-API","breadcrumbs":[{"href":"/de/rest","title":"REST-API"},{"href":"/de/rest/codespaces","title":"Codespaces"},{"href":"/de/rest/codespaces/machines","title":"Maschinen"}],"documentType":"article"},"body":"# REST-API-Endpunkte für Codespaces-Computer\n\nVerwende die REST-API, um die Verfügbarkeit von Computertypen für einen Codespace zu verwalten.\n\n## Informationen zu Codespaces-Maschinen\n\nDu kannst ermitteln, welche Computertypen verfügbar sind, um einen Codespace entweder in einem bestimmten Repository oder als authentifizierter Benutzer zu erstellen. Weitere Informationen finden Sie unter [Ändern des Computertyps für deinen Codespace](/de/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types).\n\nSie können diese Informationen auch verwenden, wenn Sie die Maschine eines bestehenden Codespace ändern, indem Sie dessen `machine`-Eigenschaft aktualisieren. Das Computerupdate erfolgt beim nächsten Neustart des Codespace. Weitere Informationen finden Sie unter [Ändern des Computertyps für deinen Codespace](/de/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)."}