---
agentTools:
  projectIndex: https://docs.cancergenomicscloud.org/llms.txt
---

# Get egress breakdown for a billing group

This call returns an egress breakdown for a billing group.

To find the `billing_group`, use the call [list billing groups](https://docs.cancergenomicscloud.org/reference/list-your-billing-groups) to list all your billing groups.

[block:api-header]
{
  "type": "basic",
  "title": "Request"
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "https://cgc-api.sbgenomics.com/v2/billing/groups/{billing_group}/breakdown/egress",
      "language": "http",
      "name": "Path  "
    }
  ]
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "Example request",
  "sidebar": true
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "GET /v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress HTTP/1.1\nHost: cgc-api.sbgenomics.com\nX-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74",
      "language": "http",
      "name": null
    },
    {
      "code": "curl -s -H \"X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74\" -H \"content-type: application/json\" - X GET \"https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress\"",
      "language": "curl",
      "name": "cURL"
    },
    {
      "code": "from sevenbridges import Api\n\napi = Api(url='cgc-api.sbgenomics.com/v2',\n          token='3210a98c1db9318fa9d9273156740f74')\n\nbilling_group = api.billing_groups.get(\n    id='ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7'\n)\n\n# send GET request to SB API\nbreakdown = billing_group.breakdown()\n\nprint(breakdown.total_spending.currency, breakdown.total_spending.amount)\nfor project_breakdown in breakdown.project_breakdown:\n    print(project_breakdown.analysis_spending.currency,\n          project_breakdown.analysis_spending.amount)\n    print(len(project_breakdown.task_breakdown))",
      "language": "python"
    }
  ],
  "sidebar": true
}
[/block]

\###Header Fields

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "Description",
    "0-0": "`X-SBG-Auth-Token`\n_required_",
    "0-1": "Your CGC [authentication token](https://docs.cancergenomicscloud.org/docs/get-your-authentication-token).",
    "h-2": ""
  },
  "cols": 2,
  "rows": 1
}
[/block]

\###Path parameters

[block:parameters]
{
  "data": {
    "0-0": "`billing_group`",
    "h-0": "Name",
    "h-1": "Description",
    "0-1": "The ID of the billing group."
  },
  "cols": 2,
  "rows": 1
}
[/block]

\###Query parameters

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "Data type",
    "h-2": "Description",
    "0-0": "`limit`",
    "0-1": "integer",
    "0-2": "The maximum number of collection items to return for a single request.\n\nThe default value is 50, while the maximum value is 100.\n\nThis is a pagination-specific attribute.",
    "4-0": "`date_to`",
    "4-1": "string",
    "4-2": "Specify the ending date for retrieving egress analysis in the following format: mm-dd-yyyy.",
    "1-0": "`offset`",
    "1-1": "integer",
    "1-2": "The zero-based starting index in the entire collection of the first item to return.\n\nThe default value is 0. This is a pagination-specific attribute.",
    "2-0": "`fields`",
    "2-1": "string",
    "2-2": "Selector specifying a subset of fields to include in the response.",
    "3-0": "`date_from`",
    "3-1": "string",
    "3-2": "Specify the starting date for retrieving egress analysis in the following format: mm-dd-yyyy.",
    "5-0": "`invoice_id`",
    "5-1": "string",
    "5-2": "Specify Invoice ID to show a breakdown for the specific invoice.\n\nIf omitted, the current spending breakdown is returned."
  },
  "cols": 3,
  "rows": 6
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "Response"
}
[/block]

[See the list of specific response codes that may be contained in the body of the response.](https://docs.cancergenomicscloud.org/reference/api-status-codes)

[block:api-header]
{
  "type": "basic",
  "title": "Example response body",
  "sidebar": true
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress?offset=0&limit=1\",\n  \"items\": [\n    {\n      \"project_name\": \"my project\",\n      \"project_locked\": false,\n      \"downloaded_by\":\"rfranklin\",\n      \"downloaded\": {\n          \"size\": \"0.005730\",\n          \"unit\": \"GB\"\n      }\n      \"egress_cost\": {\n          \"currency\": \"USD\",\n          \"amount\": \"0.000516\"\n      }\n    }\n  ],\n  \"links\": [\n     {\n       \"href\": \"https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress?offset=1&amp;limit=1\",\n       \"rel\": \"next\",\n       \"method\": \"GET\"\n     }\n  ]\n}",
      "language": "python"
    }
  ],
  "sidebar": true
}
[/block]

### Example of a response for a locked project

[block:code]
{
  "codes": [
    {
      "code": "{\n    \"href\": \"https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress?offset=0&amp;limit=1\",\n    \"items\": [\n        {\n            \"project_locked\": true,\n            \"downloaded\": {\n                \"size\": \"0.005730\",\n                \"unit\": \"GB\"\n            },\n            \"egress_cost\": {\n                \"currency\": \"USD\",\n                \"amount\": \"0.000516\"\n            }\n        }\n    ],\n    \"links\": [\n     {\n       \"href\": \"https://cgc-api.sbgenomics.com/v2/billing/groups/ec1dc1e3-12a3-4b56-789c-e3f2dca0c6f7/breakdown/egress?offset=1&limit=1\",\n       \"rel\": \"next\",\n       \"method\": \"GET\"\n     }\n  ]\n}",
      "language": "json"
    }
  ]
}
[/block]