Error codes

Every Vorlek error returns the same envelope shape. Agents should branch on error.code, error.category, error.retry_safe, and error.fix.action; messages are human-readable context.

Envelope shape

{
  "status": "error",
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded for provider 'sendgrid'. Retry after 12 seconds.",
    "category": "user_input",
    "retry_safe": true,
    "provider": "sendgrid",
    "fix": {
      "action": "retry_after_delay",
      "hint": "Respect the Retry-After header before retrying this provider."
    }
  },
  "meta": {
    "request_id": "01JD5K9X7M0Q8V0QY4FYVQ3WZV"
  }
}

Category & retry semantics

CategoryMeaningTypical response
user_inputCaller input, account state, connection state, or selected tool/provider is wrong.Fix input or state. Retry only when retry_safe is true.
provider_faultProvider-side terminal failure after Vorlek reached the provider.Inspect provider reason, fix provider-side state, then retry.
transientTemporary Vorlek/provider/network condition.Retry with exponential backoff. Honor Retry-After where present.
systemVorlek-side bug or unexpected internal state.Report request_id; retry only if retry_safe.

We surface two limits. X-RateLimit-* headers report short-window throttling (per-minute token bucket per provider). meta.quota reports your plan period quota. For most free-tier usage, meta.quota is what you hit first; the rate limiter fires on bursts.

Canonical code table

HTTPCodeCategoryretry_safeRecovery
401AUTH_MISSINGuser_inputfalseSend Authorization: Bearer vk_live_....
401AUTH_INVALIDuser_inputfalseVerify or rotate the Vorlek API key.
401AUTH_REVOKEDuser_inputfalseRotate the API key and retry with the new value.
403AUTH_FORBIDDENuser_inputfalseRe-issue/reconnect credentials with the required provider scope.
409EMAIL_TAKENuser_inputfalseSign in or use a different email.
404ACCOUNT_NOT_FOUNDuser_inputfalseContact support with request_id.
409PROVIDER_ALREADY_CONNECTEDuser_inputfalseDisconnect or rotate the existing connection first.
400PROVIDER_AUTH_INVALIDuser_inputfalseReconnect the provider with a valid key and required scopes.
404CONNECTION_NOT_FOUNDuser_inputfalseRun vorlek connect <provider> first.
400CONNECTION_INVALIDuser_inputfalseReconnect or rotate provider credentials.
500CONNECTION_DECRYPT_FAILEDsystemfalseReconnect provider; Vorlek should investigate by request_id.
400INVALID_PARAMSuser_inputfalseFix the request body or CLI flags.
400FIELD_TYPE_MISMATCHuser_inputfalseMatch the existing provider field type, or use a new property name.
404NOT_FOUNDuser_inputfalseCheck the resource identifier.
413PAYLOAD_TOO_LARGEuser_inputfalseSplit or reduce the payload.
501TOOL_NOT_SUPPORTEDuser_inputfalseUse a supported provider/tool pair.
400TOOL_NOT_CONFIGUREDuser_inputfalseReserved for Phase 5+ config-gated tools.
429QUOTA_EXCEEDEDuser_inputtrueWait for period reset or upgrade plan.
429RATE_LIMITEDuser_inputtrueHonor the Retry-After header.
409IDEMPOTENCY_CONFLICTuser_inputfalseUse a fresh idempotency key for a different request body.
429PROVIDER_RATE_LIMITEDtransienttrueHonor provider retry hints or exponential backoff.
503PROVIDER_UNAVAILABLEtransienttrueRetry after backoff.
502PROVIDER_FAILEDprovider_faultfalseInspect provider-side reason, fix, then retry.
500INTERNAL_ERRORsystemtrueServer bug; report request_id.

Recovery patterns for agents

if response.status == "success":
    proceed()
elif response.error.retry_safe:
    sleep_with_backoff()
    retry()
elif response.error.code in ["AUTH_INVALID", "AUTH_REVOKED"]:
    refresh_or_rotate_api_key()
    retry_once()
elif response.error.code == "QUOTA_EXCEEDED":
    show_upgrade_or_wait_until(response.meta.quota.resets_at)
else:
    log(response.error, response.meta.request_id)
    halt()

Lock note. This taxonomy is frozen-additive through v1.x. New codes may be added; renaming, removing, or changing semantics of existing codes is a major-version bump.