---
title: "Errors · Function API"
description: "The error shape, every status and error type, and which to retry."
canonical: https://functionvoice.ai/docs/api/errors
---

# Errors

An error has the HTTP status, a message to read, and a type to act on:

```json title="Response"
{
  "error": {
    "code": 403,
    "message": "This API key has reached its spending limit of $25.00 this month (UTC).",
    "metadata": {
      "error_type": "spend_limit",
      "limit_source": "key_month"
    }
  }
}
```

| Field | Type | Description |
| --- | --- | --- |
| `error` | object |  |
| `error.code` | integer | The HTTP status. |
| `error.message` | string | What went wrong, to read. |
| `error.metadata` | object |  |
| `error.metadata.error_type` | string | What went wrong, to act on. |
| `error.metadata.limit_source` | string | With `spend_limit` only. |

## Error types

| Status | `error_type` | Meaning |
| --- | --- | --- |
| 400 | `invalid_request` | A field is missing or wrong. The message says which. |
| 400 | `unsupported_audio_format` | Not WAV, M4A or PCM. |
| 401 | `missing_api_key` | No key in the Authorization header. |
| 401 | `invalid_api_key` | The key is wrong or revoked. |
| 401 | `expired_api_key` | The key is past its expiry. |
| 402 | `payment_required` | Add a payment method in the dashboard. |
| 403 | `forbidden` | The key isn't allowed to use this model. |
| 403 | `ip_not_allowed` | The request came from outside the key's IP allowlist. |
| 403 | `spend_limit` | The key reached its spending limit. `metadata.limit_source` says which: `key_lifetime`, `key_week` or `key_month`. |
| 404 | `not_found` | No such endpoint or model. |
| 405 | `method_not_allowed` | The wrong method for the endpoint. |
| 408 | `timeout` | A stream went quiet for 20 seconds before its commit. |
| 413 | `payload_too_large` | Over 10 minutes or 24 MB of audio. |
| 429 | `rate_limited` | Over 120 requests a minute for the key. Wait for `Retry-After`. |
| 500 | `internal_error` | Something went wrong on our side. Try again. |
| 502 | `transcription_failed` | The audio couldn't be transcribed this time. Try again. You aren't charged. |
| 503 | `unavailable` | The service is briefly unavailable. Try again after `Retry-After`. |

## Retrying

Retry `429` after `Retry-After`, and `500`, `502` and `503` with backoff. The rest need a change to the request, the key or the account: show their message. Failed and refused requests aren't charged.
