Plan, pricing and sending limits
/v1/usageHosted only. Pricing and whether billing charges yet, this month's sent and received counts against their free allowances (5,000 sent and 20,000 received), counted separately (received only for credentials that may read all received mail), and the rolling daily sending limit (none in good standing) with the evaluation before it. Workspace-wide: keys restricted to domains get 403. Dashboard sessions may receive a cached result until the workspace creates an email or records an email event (quantized to 10-second buckets during high-volume sending), or for up to 60 seconds, and compute at most 30 such Overview reads a minute: past that they get their last result (cache header stale) or 429 DASHBOARD_RATE_LIMITED. API keys, MCP and agent tokens always get fresh results.
Needs Sent mail: read on the whole workspace.
Example
import { createClient } from '@nightmail/sdk/client';
import { getUsage } from '@nightmail/sdk';
const client = createClient({
baseUrl: 'https://nightmail.dev',
auth: scheme => scheme.scheme === 'bearer'
? process.env.NIGHTMAIL_API_KEY
: undefined,
});
const result = await getUsage({
client,
throwOnError: true,
});
console.log(result.data);curl --request GET \
--url 'https://nightmail.dev/v1/usage' \
--header "Authorization: Bearer $NIGHTMAIL_API_KEY"Responses
200Success
Usagebillingrequiredobjectbilling.enabledrequiredbooleanUsage is taken from the prepaid balance (enforcement is enforce).
billing.enforcementrequiredstringoff or shadow: nothing is charged yet (shadow records what would be); enforce: usage is charged hourly. The balance is GET /v1/billing.
pricingrequiredobjectpricing.currencyrequiredstringpricing.perThousandrequirednumberPrice per 1,000 emails: each recipient of a sent email, each received message. SES mailbox simulator sends count like any other send.
pricing.freeEmailsrequiredintegerThe sent allowance (same as freeSentEmails), kept for older clients. Sent and received each have their own allowance (freeSentEmails, freeReceivedEmails), counted separately: sends beyond theirs are charged even while received mail is still free, and the other way round.
pricing.freeSentEmailsrequiredintegerSent emails (each recipient) included free each calendar month (UTC).
pricing.freeReceivedEmailsrequiredintegerReceived messages included free each calendar month (UTC), separate from the sent allowance.
pricing.freeStorageBytesrequiredintegerBytes of received mail older than 90 days stored free.
monthrequiredobjectmonth.fromrequiredstringStart of the current calendar month, UTC.
month.sentrequiredintegerEmails created this month, each counted once however many recipients it has.
month.receivedrequiredinteger or nullMessages received this month on any address, routed, unrouted or spam. Null unless the credential may read every received message (owners, admins and manage credentials): members and read-only keys never learn about mail they can't open.
month.billedSentrequiredintegerSent emails billing counts this month, each recipient once (Hosted sending; mail canceled or rejected before it went out is taken off). The free sent allowance and the price apply to this count.
month.billedReceivedrequiredinteger or nullReceived messages billing counts this month: mail Amazon's spam scan flagged and simulated mail are free. The free received allowance and the price apply to this count. Null like received.
dailyrequiredobject or nullNull until the workspace connects hosted sending.
daily.caprequiredinteger or nullRecipients allowed per rolling 24 hours; null when this workspace has no daily limit.
daily.usedrequiredintegerRecipients charged in the rolling 24 hours, SES mailbox simulator addresses included.
daily.resetAtrequiredstring or nullWhen capacity next frees up or the limit changes.
daily.steprequiredinteger or nullIndex into steps of the step this workspace is on; null past them: no daily limit (cap null), or one set by the score, a warning or an operator.
stepsrequiredobject[]The daily limits a new workspace passes through: only the evaluation. After it, a workspace in good standing (score 75 and up, no warning) has no daily limit; bad signals set one (GET /v1/sender-score). Only real SES acceptances count: simulated sends and simulator addresses use the limit but never end the evaluation.
steps[].caprequiredintegerRecipients per rolling 24 hours at this step.
steps[].requiresrequiredstringWhat a workspace needs to reach this step, in plain words.
simulatedrequiredbooleanThis installation simulates SES: no email leaves it, and simulated sends never count against the daily limit.
400, 401, 403, 404, 409, 413, 422, 429, 500, 503Request failed; use error.code and requestId to diagnose.
ApiErrorerrorrequiredobjecterror.coderequiredstringerror.messagerequiredstringerror.requestIdrequiredstringerror.fieldstringerror.retryablerequiredbooleanerror.resetAtstringNext capacity change for a Hosted rolling send limit.
error.detailsobject[]Every problem found, when there is more than one part, such as rule diagnostics with rule, line, column, message and hint, or a measurement, such as CONTENT_TOO_LARGE_TO_SCREEN with screenedBytes and limitBytes (and index in a batch).
error.requiredobjectOn a 403 permission refusal: what the request needs that this credential lacks. The Nightmail-Required-Permission header says the same.