U
UpVoot Docs

Error Codes

All error codes returned by the UpVoot platform and how to handle them.

HTTP errors (on WebSocket upgrade)

StatusCodeCauseResolution
400INVALID_KEY_FORMATAPI key does not match expected formatEnsure the key starts with sk_live_ and is 72 characters total
401KEY_NOT_FOUNDNo key with this hash existsGenerate a new key from the dashboard
402INSUFFICIENT_BALANCEAccount has 0 pointsPurchase more points from the billing page
403KEY_REVOKEDKey has been revokedGenerate a replacement key
404AGENT_NOT_FOUNDAgent associated with this key was deletedCreate a new agent and generate a new key
429RATE_LIMITEDToo many concurrent connections from this accountReduce concurrent calls or contact support for higher limits
500PLATFORM_ERRORInternal platform errorRetry after 5 seconds; report persistent errors to support

Runtime JSON error messages

These are sent as JSON text frames during an active call when a recoverable error occurs. The connection remains open unless noted.

codeMeaningConnection
STT_ERRORSpeech-to-text processing failed for this chunkStays open — next audio chunk is retried
LLM_TIMEOUTLanguage model took too long to respondStays open — agent says a brief fallback phrase
TTS_ERRORVoice synthesis failedStays open — retried on next turn
BALANCE_EXHAUSTEDPoints ran out mid-callClosed after call_end message
MAX_TURNS_REACHEDAgent hit configured turn limitClosed after call_end message

Recommended retry policy

const MAX_RETRIES = 3;
const RETRY_DELAY_MS = [1000, 2000, 5000]; // exponential backoff

async function connectWithRetry(apiKey: string, attempt = 0): Promise<WebSocket> {
  try {
    const ws = new WebSocket(`wss://api.upvoot.com/voice/${apiKey}`);
    await new Promise<void>((resolve, reject) => {
      ws.onopen = () => resolve();
      ws.onerror = () => reject(new Error("Connection failed"));
    });
    return ws;
  } catch (err) {
    if (attempt >= MAX_RETRIES) throw err;
    await new Promise((r) => setTimeout(r, RETRY_DELAY_MS[attempt]));
    return connectWithRetry(apiKey, attempt + 1);
  }
}

Do not retry on 401, 402, 403, or404 — these indicate a configuration problem, not a transient failure.

On this page

No Headings