import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.billing.usage();
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.usage()
print(result)curl 'https://api.mails.ai/v1/billing/usage' \
-H "Authorization: Bearer $MAILS_API_KEY"mails usage{ "name": "mails_get_usage", "arguments": {} }{
"workspace_id": "wsk_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"tier": "<tier>",
"tier_status": "<tier_status>",
"period_start": "2026-10-04T12:00:00.000Z",
"period_end": "2026-10-04T12:00:00.000Z",
"usage": {
"sends": 0,
"parses": 0,
"inbound_skipped": 0,
"webhook_deliveries": 0,
"sends_cost_usd": 0,
"parses_cost_usd": 0
},
"caps": {
"monthly_sends": 0,
"monthly_parses": 0,
"agents": 0,
"hourly": 0,
"daily": 0,
"hourly_inbound": 0,
"daily_inbound": 0
}
}200 Current-period usage and caps.
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
404 Resource not found in this workspace, or the agent
a send names is archived (agent_archived).
500 Internal server error.Get current usage
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.billing.usage();
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.usage()
print(result)curl 'https://api.mails.ai/v1/billing/usage' \
-H "Authorization: Bearer $MAILS_API_KEY"mails usage{ "name": "mails_get_usage", "arguments": {} }{
"workspace_id": "wsk_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"tier": "<tier>",
"tier_status": "<tier_status>",
"period_start": "2026-10-04T12:00:00.000Z",
"period_end": "2026-10-04T12:00:00.000Z",
"usage": {
"sends": 0,
"parses": 0,
"inbound_skipped": 0,
"webhook_deliveries": 0,
"sends_cost_usd": 0,
"parses_cost_usd": 0
},
"caps": {
"monthly_sends": 0,
"monthly_parses": 0,
"agents": 0,
"hourly": 0,
"daily": 0,
"hourly_inbound": 0,
"daily_inbound": 0
}
}200 Current-period usage and caps.
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
404 Resource not found in this workspace, or the agent
a send names is archived (agent_archived).
500 Internal server error.A key tied to one agent cannot read it (403 insufficient_scope): usage and costs are counted for the whole workspace, and GET /v1/metrics counts that agent's mail.
Response
Your workspace id (wsk_…).
Your plan: free, pro, scale or metered, or an older plan, outbound or outbound_pro. While a payment is past due, caps are Free's whatever this says.
active, or past_due after a failed renewal payment: the workspace then has Free plan limits until the payment goes through. canceled and paused refuse every send, with 402 subscription_canceled and payment_required.
Start of the usage period: the first day of this month, 00:00 UTC. The counts in usage start over each month.
End of the usage period, exclusive: the first day of next month, 00:00 UTC.
This period's counts.
The limits of the plan the workspace is held to now: its own, or Free's while a payment is past due.
Was this page helpful?