# Saldo e uso

Source: https://won.dev/pt-BR/docs/account

Toda resposta paga já termina com `usage`: quanto a chamada custou e o saldo restante. Estes dois endpoints cuidam do resto: quanto a conta ainda pode gastar antes de um trabalho grande e, depois, cada cobrança, para informar quanto uma tarefa custou ou cobrar os seus próprios clientes.

- Os dois são grátis e funcionam com chave de teste, que lê a conta real mas nunca gera cobrança.
- Dê a cada cliente ou agente uma chave própria com orçamento no console. `key` em `GET /account` mostra quanto resta do orçamento da chave usada na chamada, e `this_key: true` em `GET /account/charges` lista só as cobranças dela.
- O cold mail não é cobrado por e-mail: os e-mails são grátis, e o que se cobra são os domínios de envio, na compra e em cada renovação, cada uma com o ID do domínio.
- Quantos e-mails um remetente ainda pode enviar hoje está em `GET /email/domains`, e a que distância ele está de cada disjuntor que o desaceleraria ou interromperia, em `GET /email/senders/{id}`.
- Os mesmos dados estão na ferramenta `account_get_usage` do [servidor MCP](/pt-BR/docs/mcp).

## Consultar saldo e uso [#get]

`GET https://api.won.dev/v1/account`

Quanto a conta ainda pode gastar e quanto já gastou: o saldo, o orçamento desta chave e quanto resta dele, as cobranças dos últimos `days` dias por operação, as cobranças mais recentes e o preço de cada tipo de resultado. Quantos e-mails um remetente ainda pode enviar hoje está em `GET /email/domains`, e a que distância ele está dos disjuntores, em `GET /email/senders/{id}`. Use antes de um trabalho grande para conferir o orçamento, ou depois para informar quanto uma tarefa custou. Não é preciso consultar a cada chamada: toda resposta paga já termina com `usage`, o custo daquela chamada e o saldo restante. Todas as cobranças são listadas com `GET /account/charges`. Grátis.

### Parâmetros [#get-parameters]

Os parâmetros vão na query string.

| Parâmetro | Tipo | Obrigatório | Descrição (texto original da API) |
| --- | --- | --- | --- |
| `days` | integer | não | How many days back to add up, 1 to 90. Default: `30`. |

### Resposta [#get-response]

| Campo | Tipo | Descrição (texto original da API) |
| --- | --- | --- |
| `data` | object | The balance, the key's budget and what was charged. |
| `data.balance` | number | What the account can spend right now. A call can spend this much, or `key.remaining` when that is less, in US dollars. |
| `data.key` | object | The key this call uses, and what it may do. |
| `data.key.test` | boolean | True for a test key: it returns sample data and is never charged. |
| `data.key.budget` | number \| null | The most this key may spend in total, in US dollars. Null when it has no limit of its own. |
| `data.key.spent` | number | What this key has spent so far, in US dollars. |
| `data.key.remaining` | number \| null | What is left of the key's budget, in US dollars. Null when it has no limit. |
| `data.key.daily_limit` | number \| null | The most this key may spend from midnight to midnight UTC, in US dollars. Null when it has no daily limit. |
| `data.key.spent_today` | number | What this key has spent since midnight UTC, in US dollars. |
| `data.key.products` | (`trade` \| `enrich` \| `signals` \| `email`)[] \| null | The products this key may use. Null when it may use all of them. The account can always be read. |
| `data.key.read_only` | boolean | True when the key may only read: nothing that sends, buys, changes or deletes. |
| `data.period` | object | The days that `spent`, `by_operation` and `recent` cover. |
| `data.period.since` | string | First day, `YYYY-MM-DD`. |
| `data.period.until` | string | Last day, `YYYY-MM-DD`. |
| `data.spent` | number | What the account was charged in the period, with all of its keys, in US dollars. |
| `data.by_operation` | object[] | The charges of the period by operation, the largest first. |
| `data.by_operation[].operation` | string | The operation that was charged, such as `trade.companies.search`. |
| `data.by_operation[].calls` | integer | How many calls were charged. |
| `data.by_operation[].cost` | number | What they cost, in US dollars. |
| `data.recent` | object[] | The 10 latest charges of the period, newest first. |
| `data.recent[].request_id` | string | The request ID, to quote to support. |
| `data.recent[].operation` | string | The operation that was charged, such as `trade.companies.search`. |
| `data.recent[].cost` | number | What the call cost, in US dollars. |
| `data.recent[].at` | string | When, as an ISO 8601 timestamp in UTC. |
| `data.prices` | object | What one result of each kind costs, in US dollars. |
| `query` | object | The request as it was understood, with `days` filled in. |
| `notice` | string \| null | A plain sentence when there is something to know about this answer. Null otherwise. |
| `usage` | object | Nothing is charged here. The balance, for reference. |
| `usage.cost` | number | What this call cost, in US dollars. |
| `usage.balance` | number | The balance left after this call, in US dollars. |
| `usage.replayed` | boolean | True when this is a repeat of a request from the last 24 hours. Repeats are free. |

### Exemplo [#get-example]

```bash
curl "https://api.won.dev/v1/account?days=30" \
  -H "Authorization: Bearer $WON_API_KEY"
```

```json
{
  "data": {
    "balance": 48.08,
    "key": {
      "test": false,
      "budget": 100,
      "spent": 33.52,
      "remaining": 66.48,
      "daily_limit": 10,
      "spent_today": 0.6,
      "products": null,
      "read_only": false
    },
    "period": {
      "since": "2026-10-23",
      "until": "2026-11-22"
    },
    "spent": 33.52,
    "by_operation": [
      {
        "operation": "email.domains.create",
        "calls": 1,
        "cost": 28.8
      },
      {
        "operation": "trade.companies.search",
        "calls": 23,
        "cost": 4.6
      },
      {
        "operation": "enrich.people.email.find",
        "calls": 3,
        "cost": 0.12
      }
    ],
    "recent": [
      {
        "request_id": "req_7f3k2m9x4p1q8w3e",
        "operation": "trade.companies.search",
        "cost": 0.2,
        "at": "2026-11-22T09:14:03.000Z"
      }
    ],
    "prices": {
      "trade_record": 0.005,
      "trade_company": 0.01,
      "trade_company_profile": 0.04,
      "trade_lookup": 0.02,
      "person_email": 0.03,
      "company_channels": 0.02,
      "trade_stats": 0.1,
      "trade_official_stats": 0.02,
      "market_search": 0.15,
      "market_listings": 0.03,
      "market_estimates": 0.05,
      "email_domain_day": 0.9,
      "person_record": 0.005,
      "person_profile": 0.02,
      "person_phone": 0.1,
      "email_verification": 0.003,
      "company_record": 0.01,
      "company_listing": 0.002,
      "company_technologies": 0.02,
      "company_funding": 0.03,
      "company_news": 0.03,
      "company_lookalikes": 0.03,
      "job_posting": 0.003,
      "signal_hiring": 0.03,
      "signal_funding": 0.2,
      "signal_import_surge": 0.05
    }
  },
  "query": {
    "days": 30
  },
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}
```

## Listar cobranças [#charges]

`GET https://api.won.dev/v1/account/charges`

Todas as cobranças da conta, da mais recente para a mais antiga: cada chamada paga com o que retornou e quanto custou, e cada renovação de um domínio de envio. Chamadas que não custaram nada ficam de fora, assim como as feitas com chave de teste. Use para conciliar o que a conta gastou, por exemplo por cliente, quando cada cliente tem a própria chave. Grátis.

### Parâmetros [#charges-parameters]

Os parâmetros vão na query string.

| Parâmetro | Tipo | Obrigatório | Descrição (texto original da API) |
| --- | --- | --- | --- |
| `since` | string | não | Only charges from this ISO 8601 time on, such as `2026-11-01T00:00:00Z`. |
| `operation` | string | não | Only charges of this operation, such as `email.domains.create` (or its `operationId`, `email_domains_create`), or `email.domains.renew` for the renewals of sending domains. |
| `this_key` | boolean | não | Only the charges of the key this call uses. Default: `false`. |
| `limit` | integer | não | How many to return, 1 to 100. Default: `25`. |
| `cursor` | string | não | To get the next page, pass `next_cursor` of the previous response back unchanged, with the same parameters. |

### Resposta [#charges-response]

| Campo | Tipo | Descrição (texto original da API) |
| --- | --- | --- |
| `data` | object[] | The charges of this page. |
| `data[].id` | string | The request ID, such as `req_7f3k2m9x4p1q8w3e`. A sending domain's renewal has an ID of its own. |
| `data[].operation` | string | The operation that was charged, such as `trade.companies.search`. |
| `data[].domain_id` | string \| null | For the renewal of a sending domain: which domain. Null for a call. |
| `data[].by_this_key` | boolean | Whether the key of this call made it. |
| `data[].cost` | number | What it cost, in US dollars. |
| `data[].results` | object[] | What was charged for, by unit. |
| `data[].results[].unit` | string | What was charged for, such as `email_domain_day`. |
| `data[].results[].records` | integer |  |
| `data[].at` | string | When, as an ISO 8601 timestamp in UTC. |
| `has_more` | boolean | Whether more follow this page. |
| `next_cursor` | string \| null | Pass it as `cursor` to get the next page. Null on the last page. |
| `notice` | string \| null | A plain sentence when there is something to know about this answer. Null otherwise. |
| `usage` | object | Nothing is charged here. The balance, for reference. |
| `usage.cost` | number | What this call cost, in US dollars. |
| `usage.balance` | number | The balance left after this call, in US dollars. |
| `usage.replayed` | boolean | True when this is a repeat of a request from the last 24 hours. Repeats are free. |

### Exemplo [#charges-example]

```bash
curl "https://api.won.dev/v1/account/charges?limit=2" \
  -H "Authorization: Bearer $WON_API_KEY"
```

```json
{
  "data": [
    {
      "id": "req_7f3k2m9x4p1q8w3e",
      "operation": "trade.companies.search",
      "domain_id": null,
      "by_this_key": true,
      "cost": 0.2,
      "results": [
        {
          "unit": "company_record",
          "records": 1
        }
      ],
      "at": "2026-11-22T09:14:03.000Z"
    },
    {
      "id": "ren_dom_5r4k2m9x7p1q8w3e_2026-11-28",
      "operation": "email.domains.renew",
      "domain_id": "dom_5r4k2m9x7p1q8w3e",
      "by_this_key": true,
      "cost": 27,
      "results": [
        {
          "unit": "email_domain_day",
          "records": 30
        }
      ],
      "at": "2026-11-25T00:10:00.000Z"
    }
  ],
  "has_more": true,
  "next_cursor": "cur_Qm9vVGhpc0lzQVNhbXBsZQ",
  "notice": null,
  "usage": {
    "cost": 0,
    "balance": 48.08,
    "replayed": false
  }
}
```