本文へスキップ
Won.dev
ドキュメントAPIリファレンス

残高と利用状況

残高、キーの予算、すべての課金を確認し、予算のチェックや支出の照合に使います。

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

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

残高と利用状況

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

GET
/account

認証

apiKey
headerAuthorizationBearer <APIキー>

Authorization: Bearer won_live_..., a key from the console.

クエリパラメータ

days?integer

How many days back to add up, 1 to 90.

範囲1 <= value <= 90
デフォルト30

レスポンスボディ

The result.

application/json
  1. response
data*

The balance, the key's budget and what was charged.

query*

The request as it was understood, with days filled in.

notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

リクエストの例
curl -X GET 'https://api.won.dev/v1/account?days=30'
レスポンスの例
{  "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  }}

課金の一覧

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

GET
/account/charges

認証

apiKey
headerAuthorizationBearer <APIキー>

Authorization: Bearer won_live_..., a key from the console.

クエリパラメータ

since?string

Only charges from this ISO 8601 time on, such as 2026-11-01T00:00:00Z.

長さlength <= 40
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.

長さlength <= 80
this_key?boolean

Only the charges of the key this call uses.

デフォルトfalse
limit?integer

How many to return, 1 to 100.

範囲1 <= value <= 100
デフォルト25
cursor?string

To get the next page, pass next_cursor of the previous response back unchanged, with the same parameters.

長さlength <= 200

レスポンスボディ

The result.

application/json
  1. response
data*array<>

The charges of this page.

has_more*boolean

Whether more follow this page.

next_cursor*|

Pass it as cursor to get the next page. Null on the last page.

notice*|

A plain sentence when there is something to know about this answer. Null otherwise.

usage*

Nothing is charged here. The balance, for reference.

リクエストの例
curl -X GET 'https://api.won.dev/v1/account/charges?limit=2'
レスポンスの例
{  "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  }}

最終更新日