RelayPointdocs

Reference

Errors

The error format, every error code and which errors to retry.

Error format

Every error has the same JSON shape, with an HTTP status that matches the code. request_id is also sent in the X-Request-Id header of every response: include it when you contact support. If you send your own X-Request-Id (up to 128 letters, digits, ., _, : or -), it is echoed back and used as request_id, and RelayPoint's own id is in RelayPoint-Request-Id. Both find the request in your logs. Some errors add fields, such as details, amount_owed_usd or verify_url.

JSON
{
  "error": {
    "code": "insufficient_balance",
    "message": "Spending is paused: this account owes $3.20. Top up to clear the amount owed; new requests resume once the wallet is above $0.",
    "request_id": "req_…",
    "amount_owed_usd": 3.2
  }
}

Error codes

CodeHTTPMeaningRetry
invalid_request400A field is missing or invalid. details lists each problem with its path.no
invalid_json400The body is not valid JSON.no
unknown_product400model is not a product your account can use with this endpoint.no
video_too_long400The avatar video would run longer than max_seconds (or the platform maximum). The answer includes the estimate; shorten the script. Nothing was charged.no
consent_required400A voice clone or your own avatar needs input.consent (subject_name, attested_by, method). Nothing was charged.no
content_rejected400The content looks like impersonation without consent, or the provider's moderation refused it. Nothing was charged.no
insufficient_provider_credit402Your own HeyGen or ElevenLabs account has no credit left. Top it up with the provider. Nothing was charged.no
upstream_rejected400The model refused this input (for example unsupported content). Nothing was charged.no
provider_unavailable400RelayPoint Connect: a provider in providers can't be connected on this account yet. providers lists each one with its reason; GET /v1/connect/status shows them all. See RelayPoint Connect.no
opt_in_required400WhatsApp: a template needs the contact's recorded opt-in. Add it with POST /v1/whatsapp/contacts (opt_in). See WhatsApp.no
unauthorized401No API key was sent.no
invalid_api_key401The key is wrong, revoked or expired.no
insufficient_balance402Not enough credits for this call (required_usd, available_usd), or spending is paused because the wallet is below $0 (amount_owed_usd). Top up, then retry.no
package_required402Live RelayPoint Connect needs an active RelayPoint Connections package (Dashboard › Billing). Test keys work without it.no
spend_cap_reached402The call would go over a monthly cap of the key, the account or the sub-account.no
forbidden403The key can't do this (for example a test key on a live-only operation, or a sub-account that isn't yours).no
feature_disabled403The feature is switched off for this workspace (for example AI assist in the Connect settings).no
ip_not_allowed403The request came from an IP address outside the key's or the account's allow-list, or (with Domain lock on) a server call came from an IP that isn't on the allowed servers list.no
domain_not_allowed403Domain lock is on and the call came from a website that isn't on the key's allowed domains. Ask RelayPoint support to add the domain. See Domain lock.no
missing_scope403The key doesn't have the scope this endpoint needs.no
account_suspended403The account, or its reseller, is suspended. Contact support or your provider.no
kyc_required403Business verification is needed first (verify_url links to the dashboard). See Credits, billing & KYC.no
byok_required403The product runs only on your own Claude or OpenAI key, or no key is set for the provider you asked for (keys_url links to the keys page). See Your own Anthropic or OpenAI key.no
not_found404No such resource for this account. Ids of other accounts also return 404.no
method_not_allowed405This path doesn't accept that HTTP method.no
conflict409The resource is in a state that doesn't allow this (for example a duplicate external_ref).no
idempotency_conflict409A request with the same Idempotency-Key is still running. Retry after a short wait.yes
window_closed409WhatsApp: more than 24 hours since the contact's last message, so free-form text isn't allowed. Send an approved template.no
payload_too_large413The body is over the endpoint's size limit (1 MB for most endpoints).no
byok_key_invalid424Your own Anthropic or OpenAI key was refused by the provider (401/403). Replace or fix it; RelayPoint never switches to its own models silently.no
unsupported_media_type415Send JSON with Content-Type: application/json (or multipart where the endpoint takes files).no
idempotency_mismatch422This Idempotency-Key was already used with a different request body or path.no
validation_failed422A social post that some networks can't take as it is. targets lists each one with its errors and warnings; nothing was published. See Social posting.no
rate_limited429Too many requests. Wait the number of seconds in Retry-After.yes
daily_limit_reached429A fair-use cap per account was reached (posts per connected account per day, WhatsApp messages per number per day, or X posts per month through RelayPoint's X app). Retry the next day.yes
internal_error500Something failed on our side. Retry; if it persists, contact support with the request_id.yes
upstream_unavailable503No model could serve the call right now. Nothing was charged.yes
upstream_timeout504The model didn't answer in time. Nothing was charged.yes

Retrying safely

  • Retry only 429, 409 idempotency_conflict and 5xx, with exponential backoff, and respect Retry-After when present.
  • Send an Idempotency-Key on POST requests and reuse it for every retry of the same operation, so a retried call is never charged twice. See Rate limits & idempotency.
  • Calls that fail upstream (upstream_*) release their hold: you are only charged for successful work.
import { RelayPoint, RelayPointError } from "@relaypoint/sdk";

// The SDK retries 429, 5xx and network errors itself (up to maxRetries) and sends an
// Idempotency-Key on every POST, so a retry is never charged twice. Pass your own key
// to make retries across processes safe too:
const rp = new RelayPoint({ apiKey: process.env.RELAYPOINT_API_KEY, maxRetries: 3 });
try {
  await rp.chat.completions.create(body, { idempotencyKey: orderId });
} catch (e) {
  if (e instanceof RelayPointError && e.code === "insufficient_balance") {
    // ask the account owner to top up
  }
  throw e;
}