Trendtrack
Trendtrack
DashboardGet API keyIntroducción
Primeros pasosAutenticaciónCréditos y facturaciónErroresLímites de tasaTime windowsSolución de problemas
Guías

Errores

Aprende la estructura estable de errores y los códigos de error públicos más importantes.

Stable error envelope

{
  "error": {
    "code": "missing_api_key",
    "message": "Missing API key.",
    "requestId": "req_123"
  }
}

Expect a stable JSON envelope and use the error code for logic, not the human message alone.

Common public error codes

  • missing_api_key
  • invalid_api_key
  • credential_not_found
  • credential_revoked
  • credential_expired
  • workspace_public_api_disabled
  • workspace_public_api_suspended
  • forbidden
  • rate_limited
  • insufficient_credits
  • internal_error

Status code guidance

  • 401: missing or invalid authentication
  • 402: insufficient credits for the requested work
  • 403: authenticated but not allowed
  • 404: the requested resource was not found
  • 429: rate limited; check Retry-After

Error code reference

error.codeHTTPRetry?What to do
missing_api_key401NoSet Authorization: Bearer <key> on the request.
invalid_api_key401NoRe-copy the key from workspace settings — watch for whitespace or x-api-key confusion.
credential_not_found401NoThe key was deleted. Issue a new one.
credential_revoked401NoThe key was rotated. Issue a new one.
credential_expired401NoRenew the key from workspace settings.
workspace_public_api_disabled403NoPublic API access must be explicitly enabled for the workspace; a missing access row is treated as disabled.
workspace_public_api_suspended403NoContact support — billing or compliance hold.
forbidden403NoThe key does not have permission for that resource. Check scope.
rate_limited429YesRespect Retry-After then retry. See Rate Limits.
insufficient_credits402NoTop up or wait for the monthly refill. Don't retry blindly.
internal_error500YesRetry with backoff. Include requestId when reporting.

Worked example: insufficient_credits

Response body (402)
{
  "error": {
    "code": "insufficient_credits",
    "message": "Not enough credits to complete this request.",
    "requestId": "req_01HZ…"
  }
}

On a 402, do not retry blindly. Call GET /v1/usage to read the current balance and the monthly refill date, then either top up or surface the gap to the caller. Agents that loop over many pages should check X-Credits-Remaining on successful metered calls and stop before the next request would fail.

Créditos y facturación

Comprende los créditos, las recargas, los headers de uso y el comportamiento por consumo.

Límites de tasa

Gestiona correctamente las respuestas 429 y utiliza Retry-After de forma segura.

On this page

Stable error envelopeCommon public error codesStatus code guidanceError code referenceWorked example: insufficient_credits