余额和用量
查询余额、key 的预算和每一笔扣费,用于确认预算或对账。
每个付费响应末尾都已带有 usage,列出本次调用的花费和剩余余额。下面两个接口负责其余的事:大批量任务前确认账户还能花多少;事后列出每一笔扣费,用来汇报任务花费,或者向你自己的客户收费。
- 两个接口都免费,测试 key 也可以调用:读取的是真实账户的数据,但测试 key 本身永远不会扣费。
- 可以在控制台为每个客户或 agent 单独创建带预算的 key。
GET /account的key显示当前 key 的剩余预算;GET /account/charges传入this_key: true时,只列出当前 key 的扣费。 - 发送活动的邮件不按单次调用扣费,而是按活动和日期汇总,并附带活动 ID。
GET /account的email显示账户今天还能发多少封冷邮件,以及距离各个熔断阈值还有多远。熔断会让发信降速或暂停,依据包括退信率、垃圾邮件投诉和退订。- MCP 服务 的
account_get_usage工具提供同样的数据。
余额和用量
GET https://api.won.dev/v1/account
查看账户还能花多少、已经花了多少:余额、当前 key 的预算和剩余额度、最近 days 天按接口汇总的扣费、最近几笔扣费、每种结果的单价,以及冷邮件今天还能发多少封、距离各个熔断阈值还有多远;带上 tenant_id 时,返回的是账户下某个租户的这些数据。适合在大批量任务前确认预算,或在事后汇报一项任务的花费。无需每次调用后都查询:每个付费响应末尾都带有 usage,列出本次花费和剩余余额。完整的扣费明细请用 GET /account/charges。免费。
参数
参数放在查询字符串里。
| 参数 | 类型 | 必填 | 说明(API 原文) |
|---|---|---|---|
days | integer | 否 | How many days back to add up, 1 to 90. Default: 30. |
tenant_id | string | 否 | Show email for this tenant, such as cus_4821, instead of for the account. |
响应
| 字段 | 类型 | 说明(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. |
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.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. |
data.email | object | Cold email: what the account can still send today, and how far it is from being slowed down or stopped. The breakers leave test campaigns out. |
data.email.tenant_id | string | null | The tenant this is about, when tenant_id was asked for. Null: the account, whose breakers count its own mail, without a tenant. |
data.email.status | ok | throttled | suspended | ok; throttled when a breaker halved the daily limit; suspended when one stopped all sending until a person looks. |
data.email.daily_limit | integer | The most emails the account, or the tenant, sends on one day across its campaigns, today. It rises as it sends without bounces and complaints. A tenant's is within the account's, which holds for all of its tenants together. |
data.email.sent_today | integer | Emails sent so far today (UTC), campaign steps and single emails, as they count against daily_limit. |
data.email.breakers | object | How far the account is from each of the breakers that protect the mailboxes. |
data.email.breakers.bounce_rate | object | Emails that bounced because the mailbox does not exist. |
data.email.breakers.bounce_rate.value | number | The share of the last emails that bounced for good. |
data.email.breakers.bounce_rate.limit | number | Above this, sending stops. |
data.email.breakers.bounce_rate.measured_over | integer | How many emails the share is of: the last 200 at most. |
data.email.breakers.bounce_rate.counts_from | integer | The breaker only acts from this many emails on. |
data.email.breakers.bounce_rate.action | suspend | What happens above the limit: all sending stops. |
data.email.breakers.complaints | object | Spam complaints. |
data.email.breakers.complaints.value | integer | Recipients who reported the emails as spam. |
data.email.breakers.complaints.limit | integer | At this many, sending stops. One already halves the daily limit. |
data.email.breakers.complaints.days | integer | The days the complaints are counted over. |
data.email.breakers.complaints.action | suspend | What happens at the limit: all sending stops. |
data.email.breakers.unsubscribe_rate | object | Unsubscribes. |
data.email.breakers.unsubscribe_rate.value | number | The share of the people written to in 30 days who unsubscribed. |
data.email.breakers.unsubscribe_rate.limit | number | Above this, the daily limit is halved. |
data.email.breakers.unsubscribe_rate.counts_from | integer | The breaker only acts from this many people on. |
data.email.breakers.unsubscribe_rate.action | throttle | What happens above the limit: half the speed. |
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. |
示例
curl "https://api.won.dev/v1/account?days=30" \
-H "Authorization: Bearer $WON_API_KEY"{
"data": {
"balance": 48.08,
"key": {
"test": false,
"budget": 20,
"spent": 6.42,
"remaining": 13.58
},
"period": {
"since": "2026-10-23",
"until": "2026-11-22"
},
"spent": 11.92,
"by_operation": [
{
"operation": "email.campaigns.send",
"calls": 4,
"cost": 7.17
},
{
"operation": "trade.companies.search",
"calls": 23,
"cost": 4.6
},
{
"operation": "email.replies.reply",
"calls": 5,
"cost": 0.15
}
],
"recent": [
{
"request_id": "req_7f3k2m9x4p1q8w3e",
"operation": "email.replies.reply",
"cost": 0.03,
"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,
"email_sent": 0.03,
"email_sent_dedicated": 0.01,
"email_capacity": 0.03,
"email_dedicated_domain": 25,
"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
},
"email": {
"tenant_id": null,
"status": "ok",
"daily_limit": 150,
"sent_today": 42,
"breakers": {
"bounce_rate": {
"value": 0.011,
"limit": 0.03,
"measured_over": 180,
"counts_from": 50,
"action": "suspend"
},
"complaints": {
"value": 0,
"limit": 2,
"days": 30,
"action": "suspend"
},
"unsubscribe_rate": {
"value": 0.02,
"limit": 0.05,
"counts_from": 50,
"action": "throttle"
}
}
}
},
"query": {
"days": 30
},
"notice": null,
"usage": {
"cost": 0,
"balance": 48.08,
"replayed": false
}
}扣费记录
GET https://api.won.dev/v1/account/charges
列出账户的每一笔扣费,按时间倒序:每次付费调用返回了什么、花了多少,以及每个发送活动按天汇总的邮件费用。免费调用和测试 key 的调用不在其中。可以用它对账,比如给每个客户分配一个 key,再按客户核对花费。免费。
参数
参数放在查询字符串里。
| 参数 | 类型 | 必填 | 说明(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.campaigns.send. |
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. |
响应
| 字段 | 类型 | 说明(API 原文) |
|---|---|---|
data | object[] | The charges of this page. |
data[].id | string | The request ID, such as req_7f3k2m9x4p1q8w3e. A campaign's emails are summed up per campaign and day, under an ID of their own. |
data[].operation | string | The operation that was charged, such as trade.companies.search. |
data[].campaign_id | string | null | For the emails of a campaign: which campaign. 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_sent. |
data[].results[].records | integer | |
data[].at | string | When, as an ISO 8601 timestamp in UTC. For a campaign's day, when it was last added to. |
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. |
示例
curl "https://api.won.dev/v1/account/charges?limit=2" \
-H "Authorization: Bearer $WON_API_KEY"{
"data": [
{
"id": "req_7f3k2m9x4p1q8w3e",
"operation": "email.replies.reply",
"campaign_id": null,
"by_this_key": true,
"cost": 0.03,
"results": [
{
"unit": "email_sent",
"records": 1
}
],
"at": "2026-11-22T09:14:03.000Z"
},
{
"id": "eml_7p1q8w3e5r4k2m9x_20261121",
"operation": "email.campaigns.send",
"campaign_id": "cmp_7p1q8w3e5r4k2m9x",
"by_this_key": true,
"cost": 0.87,
"results": [
{
"unit": "email_sent",
"records": 29
}
],
"at": "2026-11-21T21:58:40.000Z"
}
],
"has_more": true,
"next_cursor": "cur_Qm9vVGhpc0lzQVNhbXBsZQ",
"notice": null,
"usage": {
"cost": 0,
"balance": 48.08,
"replayed": false
}
}