# Monthly spend and purchase summary for this project

GET

/projects/{projectId}/billing/summary

```js
const url = 'https://zkao.io/api/v1/projects/example/billing/summary';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request GET \
  --url https://zkao.io/api/v1/projects/example/billing/summary \
  --header 'Authorization: Bearer <token>'
```

* Production`zkao.io/api/v1/projects/{projectId}/billing/summary`
* Staging`staging.zkao.io/api/v1/projects/{projectId}/billing/summary`

Requires scope: `read`. Per-month net scan spend and net purchases attributed to this project, in credits, newest first. Purchases land in the organization’s shared balance.

## Authorizations

* **[bearerAuth](https://docs.staging.zkao.io/api/#bearerauth)**

## Parameters

### Path Parameters

* **projectId**

  required

  string

### Query Parameters

* **months**

  integer

  \>= 1 <= 24

## Responses

### 200

OK

application/json

object

* **organization**

  required

  The organization whose shared balance the purchases were made into.

  object

  * **id**

    required

    string

  * **slug**

    required

    URL segment of the organization (`/orgs/<slug>`), unique across zkao.

    string

  * **name**

    required

    string

* **months**

  required

  Array\<object>

  object

  * **month**

    required

    YYYY-MM (UTC).

    string

  * **spentCredits**

    required

    Net scan spend (deductions less refunds), in credits.

    integer

  * **purchasedCredits**

    required

    Net purchases (purchases less clawbacks), in credits.

    integer

##### Examplegenerated

```json
{
  "organization": {
    "id": "example",
    "slug": "example",
    "name": "example"
  },
  "months": [
    {
      "month": "example",
      "spentCredits": 1,
      "purchasedCredits": 1
    }
  ]
}
```

### 401

Missing, malformed, expired, or revoked token

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```

### 403

The token lacks the required scope

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```

### 404

Resource not in this token’s project or repo allowlist

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```
