{"meta":{"title":"Nutzungsabrechnung","intro":"Verwenden Sie die REST-API, um Abrechnungsnutzungsinformationen abzurufen.","product":"REST-API","breadcrumbs":[{"href":"/de/enterprise-cloud@latest/rest","title":"REST-API"},{"href":"/de/enterprise-cloud@latest/rest/billing","title":"Abrechnung"},{"href":"/de/enterprise-cloud@latest/rest/billing/usage","title":"Nutzungsabrechnung"}],"documentType":"article"},"body":"# Nutzungsabrechnung\n\nVerwenden Sie die REST-API, um Abrechnungsnutzungsinformationen abzurufen.\n\nDie Endpunkte auf dieser Seite geben die Nutzung zurück, die dem mit dem Endpunkt verknüpften Konto in Rechnung gestellt wird. Hilfe zur Entscheidungsfindung, welche Nutzungsstufe zu berichten ist, finden Sie unter [Automatisieren von Nutzungsberichten mit der REST-API](/de/enterprise-cloud@latest/billing/tutorials/automate-usage-reporting#step-1-decide-what-level-to-report-on).\n\n* Benutzerendpunkte geben die Nutzung von Copilot zurück, die direkt dem persönlichen Konto eines einzelnen Benutzenden in Rechnung gestellt wird. Diese Endpunkte gelten nur, wenn der Benutzende seinen eigenen Copilot-Plan erworben hat.\n* Wenn die Copilot Lizenz eines Benutzers über eine Organisation oder ein Unternehmen verwaltet und in Rechnung gestellt wird, ist ihre Nutzung nicht in Endpunkten auf Benutzerebene enthalten. In diesem Fall müssen Sie stattdessen die Endpunkte auf Organisation oder Unternehmensebene verwenden.\n\nUm Endpunkte auf Benutzer- und Organisationsebene anzuzeigen, wählen Sie das Dropdown-Menü oben auf der Seite aus und wechseln Sie von GitHub Enterprise Cloud zu „Free“, „Pro“ und „Team“.\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## Get billing AI credit usage report for an enterprise\n\n```\nGET /enterprises/{enterprise}/settings/billing/ai_credit/usage\n```\n\nGets a report of AI credit usage for an enterprise. To use this endpoint, you must be an administrator or billing manager of the enterprise, an organization owner in the enterprise, or a custom role holder with fine-grained read access to enterprise billing. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get this usage report.\nNote: Only data from the past 24 months is accessible via 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* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`year`** (integer)\n  If specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025. Default value is the current year.\n\n* **`month`** (integer)\n  If specified, only return results for a single month. The value of month is an integer between 1 and 12. Default value is the current month. If no year is specified the default year is used.\n\n* **`day`** (integer)\n  If specified, only return results for a single day. The value of day is an integer between 1 and 31. If no year or month is specified, the default year and month are used.\n\n* **`organization`** (string)\n  The organization name to query usage for. The name is not case sensitive.\n\n* **`user`** (string)\n  The user name to query usage for. The name is not case sensitive.\n\n* **`model`** (string)\n  The model name to query usage for. The name is not case sensitive.\n\n* **`product`** (string)\n  The product name to query usage for. The name is not case sensitive.\n\n* **`cost_center_id`** (string)\n  The ID corresponding to a cost center. An ID of 'none' will target usage not associated to any cost center.\n\n### HTTP response status codes\n\n* **200** - Response when getting a billing AI credit usage report\n\n* **400** - Bad Request\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **500** - Internal Error\n\n* **503** - Service unavailable\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/settings/billing/ai_credit/usage\n```\n\n**Response schema (Status: 200):**\n\n* `timePeriod`: required, object:\n  * `year`: required, integer\n  * `month`: integer\n  * `day`: integer\n* `enterprise`: required, string\n* `user`: string\n* `organization`: string\n* `product`: string\n* `model`: string\n* `costCenter`: object:\n  * `id`: required, string\n  * `name`: required, string\n* `usageItems`: required, array of objects:\n  * `product`: required, string\n  * `sku`: required, string\n  * `model`: required, string\n  * `unitType`: required, string\n  * `pricePerUnit`: required, number\n  * `grossQuantity`: required, number\n  * `grossAmount`: required, number\n  * `discountQuantity`: required, number\n  * `discountAmount`: required, number\n  * `netQuantity`: required, number\n  * `netAmount`: required, number\n\n## Get billing premium request usage report for an enterprise\n\n```\nGET /enterprises/{enterprise}/settings/billing/premium_request/usage\n```\n\nGets a report of premium request usage for an enterprise. To use this endpoint, you must be an administrator or billing manager of the enterprise, an organization owner in the enterprise, or a custom role holder with fine-grained read access to enterprise billing. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get this usage report.\nNote: Only data from the past 24 months is accessible via 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* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`year`** (integer)\n  If specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025. Default value is the current year.\n\n* **`month`** (integer)\n  If specified, only return results for a single month. The value of month is an integer between 1 and 12. Default value is the current month. If no year is specified the default year is used.\n\n* **`day`** (integer)\n  If specified, only return results for a single day. The value of day is an integer between 1 and 31. If no year or month is specified, the default year and month are used.\n\n* **`organization`** (string)\n  The organization name to query usage for. The name is not case sensitive.\n\n* **`user`** (string)\n  The user name to query usage for. The name is not case sensitive.\n\n* **`model`** (string)\n  The model name to query usage for. The name is not case sensitive.\n\n* **`product`** (string)\n  The product name to query usage for. The name is not case sensitive.\n\n* **`cost_center_id`** (string)\n  The ID corresponding to a cost center. An ID of 'none' will target usage not associated to any cost center.\n\n### HTTP response status codes\n\n* **200** - Response when getting a billing premium request usage report\n\n* **400** - Bad Request\n\n* **403** - Forbidden\n\n* **404** - Resource not found\n\n* **500** - Internal Error\n\n* **503** - Service unavailable\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/settings/billing/premium_request/usage\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get billing AI credit usage report for an enterprise](#get-billing-ai-credit-usage-report-for-an-enterprise).\n\n## Get billing usage report for an enterprise\n\n```\nGET /enterprises/{enterprise}/settings/billing/usage\n```\n\nGets a report of usage by cost center for an enterprise. To use this endpoint, you must be an administrator or billing manager of the enterprise, an organization owner in the enterprise, or a custom role holder with fine-grained read access to enterprise billing. By default this endpoint will return usage that does not have a cost center. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get this usage report.\nNote: This endpoint is only available to enterprises with access to the enhanced billing platform. For more information, see \"About the enhanced billing platform for enterprises.\"\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* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`year`** (integer)\n  If specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025. Default value is the current year.\n\n* **`month`** (integer)\n  If specified, only return results for a single month. The value of month is an integer between 1 and 12. If no year is specified the default year is used.\n\n* **`day`** (integer)\n  If specified, only return results for a single day. The value of day is an integer between 1 and 31. If no year or month is specified, the default year and month are used.\n\n* **`cost_center_id`** (string)\n  The ID corresponding to a cost center. The default value is no cost center.\n\n### HTTP response status codes\n\n* **200** - Response when getting a billing usage report\n\n* **400** - Bad Request\n\n* **403** - Forbidden\n\n* **500** - Internal Error\n\n* **503** - Service unavailable\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/settings/billing/usage\n```\n\n**Response schema (Status: 200):**\n\n* `usageItems`: array of objects:\n  * `date`: required, string\n  * `product`: required, string\n  * `sku`: required, string\n  * `quantity`: required, integer\n  * `unitType`: required, string\n  * `pricePerUnit`: required, number\n  * `grossAmount`: required, number\n  * `discountAmount`: required, number\n  * `netAmount`: required, number\n  * `organizationName`: required, string\n  * `repositoryName`: string\n\n## Get billing usage summary for an enterprise\n\n```\nGET /enterprises/{enterprise}/settings/billing/usage/summary\n```\n\nGets a summary report of usage for an enterprise. To use this endpoint, you must be an administrator or billing manager of the enterprise, an organization owner in the enterprise, or a custom role holder with fine-grained read access to enterprise billing. By default, this endpoint will return usage across all cost centers in the enterprise. An installation access token for a GitHub App installed on the enterprise with read access to enterprise billing can get this usage summary report.\nNote: Only data from the past 24 months is accessible via 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* **`enterprise`** (string) (required)\n  The slug version of the enterprise name.\n\n* **`year`** (integer)\n  If specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025. Default value is the current year.\n\n* **`month`** (integer)\n  If specified, only return results for a single month. The value of month is an integer between 1 and 12. Default value is the current month. If no year is specified the default year is used.\n\n* **`day`** (integer)\n  If specified, only return results for a single day. The value of day is an integer between 1 and 31. If no year or month is specified, the default year and month are used.\n\n* **`organization`** (string)\n  The organization name to query usage for. The name is not case sensitive.\n\n* **`repository`** (string)\n  The repository name to query for usage in the format owner/repository.\n\n* **`product`** (string)\n  The product name to query usage for. The name is not case sensitive.\n\n* **`sku`** (string)\n  The SKU to query for usage.\n\n* **`cost_center_id`** (string)\n  The ID corresponding to a cost center. An ID of 'none' will target usage not associated to any cost center.\n\n### HTTP response status codes\n\n* **200** - Response when getting a billing usage summary\n\n* **400** - Bad Request\n\n* **403** - Forbidden\n\n* **500** - Internal Error\n\n* **503** - Service unavailable\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/enterprises/ENTERPRISE/settings/billing/usage/summary\n```\n\n**Response schema (Status: 200):**\n\n* `timePeriod`: required, object:\n  * `year`: required, integer\n  * `month`: integer\n  * `day`: integer\n* `enterprise`: required, string\n* `organization`: string\n* `repository`: string\n* `product`: string\n* `sku`: string\n* `costCenter`: object:\n  * `id`: required, string\n  * `name`: required, string\n* `usageItems`: required, array of objects:\n  * `product`: required, string\n  * `sku`: required, string\n  * `unitType`: required, string\n  * `pricePerUnit`: required, number\n  * `grossQuantity`: required, number\n  * `grossAmount`: required, number\n  * `discountQuantity`: required, number\n  * `discountAmount`: required, number\n  * `netQuantity`: required, number\n  * `netAmount`: required, number"}