# Saldo y uso

Source: https://won.dev/es/docs/account

Cada respuesta de pago ya termina con `usage`: lo que costó la llamada y el saldo que queda. Estos dos endpoints sirven para lo demás: saber cuánto puede gastar todavía la cuenta antes de un trabajo grande, y ver cada cargo después, para informar cuánto costó una tarea o cobrarles a tus propios clientes.

- Los dos son gratis y funcionan con una clave de prueba, que lee la cuenta real pero nunca genera cargos.
- Dale a cada cliente o agente su propia clave con un presupuesto en la consola. `key` en `GET /account` muestra lo que queda del presupuesto de la clave con la que llamas, y `this_key: true` en `GET /account/charges` lista solo sus cargos.
- El correo en frío no se cobra por correo: los correos son gratis, y lo que se cobra son los dominios de envío, al comprarlos y en cada renovación, cada una con el ID del dominio.
- Cuántos correos puede enviar todavía hoy un remitente está en `GET /email/domains`, y qué tan lejos está de cada interruptor automático que lo frenaría o detendría, en `GET /email/senders/{id}`.
- Los mismos datos están en la herramienta `account_get_usage` del [servidor MCP](/es/docs/mcp).

## Consultar saldo y uso [#get]

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

Lo que la cuenta todavía puede gastar y lo que ya gastó: el saldo, el presupuesto de esta clave y lo que queda de él, los cargos de los últimos `days` días por operación, los cargos más recientes y el precio de cada tipo de resultado. Cuántos correos puede enviar todavía hoy un remitente está en `GET /email/domains`, y qué tan lejos está de sus interruptores automáticos, en `GET /email/senders/{id}`. Úsalo antes de un trabajo grande para revisar el presupuesto, o después para informar cuánto costó una tarea. No hace falta después de cada llamada: cada respuesta de pago ya termina con `usage`, el costo de esa llamada y el saldo que queda. Todos los cargos se listan con `GET /account/charges`. Gratis.

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

Los parámetros van en la cadena de consulta.

| Parámetro | Tipo | Obligatorio | Descripción (texto original de la API) |
| --- | --- | --- | --- |
| `days` | integer | no | How many days back to add up, 1 to 90. Default: `30`. |

### Respuesta [#get-response]

| Campo | Tipo | Descripción (texto original de la 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. |

### Ejemplo [#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 cargos [#charges]

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

Todos los cargos de la cuenta, del más reciente al más antiguo: cada llamada de pago con lo que devolvió y lo que costó, y cada renovación de un dominio de envío. Las llamadas que no costaron nada quedan fuera, igual que las hechas con una clave de prueba. Úsalo para conciliar lo que gastó la cuenta, por ejemplo por cliente cuando cada cliente tiene su propia clave. Gratis.

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

Los parámetros van en la cadena de consulta.

| Parámetro | Tipo | Obligatorio | Descripción (texto original de la API) |
| --- | --- | --- | --- |
| `since` | string | no | Only charges from this ISO 8601 time on, such as `2026-11-01T00:00:00Z`. |
| `operation` | string | no | 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 | no | Only the charges of the key this call uses. Default: `false`. |
| `limit` | integer | no | How many to return, 1 to 100. Default: `25`. |
| `cursor` | string | no | To get the next page, pass `next_cursor` of the previous response back unchanged, with the same parameters. |

### Respuesta [#charges-response]

| Campo | Tipo | Descripción (texto original de la 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. |

### Ejemplo [#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
  }
}
```