# 残高と利用状況

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

有料のレスポンスには、必ず最後に `usage` がつきます。その呼び出しの費用と残高です。ここの2つのエンドポイントはそれ以外のためのものです。大きな処理の前にアカウントがあといくら使えるかを確認し、処理のあとですべての課金を確認して、かかった費用を報告したり、あなた自身の顧客に請求したりできます。

- どちらも無料で、テストキーでも使えます。テストキーは実際のアカウントを読み取りますが、テストキー自体に課金されることはありません。
- 顧客やエージェントごとに、コンソールで予算つきのキーを発行してください。`GET /account` の `key` で呼び出しに使ったキーの予算の残りがわかり、`GET /account/charges` に `this_key: true` を指定すると、そのキーの課金だけが返ります。
- コールドメールは1通ごとには課金されません。メールは無料で、課金されるのは送信ドメインだけです。購入したときと更新のたびに課金され、更新にはドメインのIDがつきます。
- 送信者が今日あと何通送れるかは `GET /email/domains` で、送信を減速または停止させる各サーキットブレーカー（バウンス率、迷惑メール報告、配信停止）までどのくらい余裕があるかは `GET /email/senders/{id}` でわかります。
- 同じデータは、[MCPサーバー](/ja/docs/mcp)の `account_get_usage` ツールでも取得できます。

## 残高と利用状況 [#get]

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

アカウントがあといくら使えるか、ここまでいくら使ったかを確認します。残高、このキーの予算とその残り、直近 `days` 日間の操作ごとの課金、最近の課金、結果の種類ごとの単価を返します。送信者が今日あと何通送れるかは `GET /email/domains`、各サーキットブレーカーまでどのくらい余裕があるかは `GET /email/senders/{id}` でわかります。大きな処理の前に予算を確認するときや、処理のあとでかかった費用を報告するときに使います。呼び出しのたびに確認する必要はありません。有料のレスポンスには必ず最後に `usage` がつき、その呼び出しの費用と残高がわかります。課金の一覧は `GET /account/charges` で取得できます。無料です。

### パラメーター [#get-parameters]

パラメーターはクエリ文字列で渡します。

| パラメーター | 型 | 必須 | 説明（APIの原文） |
| --- | --- | --- | --- |
| `days` | integer | いいえ | How many days back to add up, 1 to 90. Default: `30`. |

### レスポンス [#get-response]

| フィールド | 型 | 説明（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. |

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

## 課金の一覧 [#charges]

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

アカウントのすべての課金を新しい順に返します。有料の呼び出しごとに何が返り、いくらかかったか、そして送信ドメインの更新ごとの課金です。料金のかからなかった呼び出しとテストキーでの呼び出しは含まれません。アカウントの支出の照合に使えます。たとえば顧客ごとにキーを分けていれば、顧客ごとに照合できます。無料です。

### パラメーター [#charges-parameters]

パラメーターはクエリ文字列で渡します。

| パラメーター | 型 | 必須 | 説明（APIの原文） |
| --- | --- | --- | --- |
| `since` | string | いいえ | Only charges from this ISO 8601 time on, such as `2026-11-01T00:00:00Z`. |
| `operation` | string | いいえ | 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 | いいえ | Only the charges of the key this call uses. Default: `false`. |
| `limit` | integer | いいえ | How many to return, 1 to 100. Default: `25`. |
| `cursor` | string | いいえ | To get the next page, pass `next_cursor` of the previous response back unchanged, with the same parameters. |

### レスポンス [#charges-response]

| フィールド | 型 | 説明（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. |

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