API keys can now enforce monthly USD spend limits

1 min read

Speechify API keys can now carry a monthly USD spend limit, returning 402 spend_cap_exceeded once a key reaches its budget for the calendar month.

Developer Relations · SpeechifyAI Labs

Speechify API keys can now carry a monthly USD spend limit. Once the key reaches its budget for the current calendar month, new requests fail with 402 spend_cap_exceeded until you raise the limit, use another key, or the month rolls over.

Spend limits are the blast door for API credentials. If a key leaks, a script loops, or a test workload accidentally points at production, the key can only spend the budget you gave it.

What does the limit cover?

The limit is per API key and measured in US dollars. It counts billed usage through the same billing engine that produces your invoice, which means it covers speech synthesis, Agents calls, outbound batches, and LLM gateway usage where that key is the caller.

Keys without a limit behave exactly as before.

The window is the calendar month in UTC. Limits reset automatically at 00:00 UTC on the first day of the month.

What happens when a key reaches the limit?

New requests fail with the standard error envelope:

{
  "error": {
    "code": "spend_cap_exceeded",
    "message": "This API key has reached its monthly spend cap."
  },
  "request_id": "..."
}

Handle this separately from payment_required. payment_required means the workspace balance needs attention. spend_cap_exceeded means this particular key reached the budget you chose for it.

In-flight calls are not cut off. The limit gates new requests and new dispatches.

Where to configure it

Set a limit when creating a key, or edit an existing key from the API Keys page in the console. The secret does not change when you add, raise, lower, or remove a limit.

Read the spend limits guide for the exact behavior and error shape.