TorqueTorque

Search docs

Search Torque documentation pages & sections

API Errors & Rate Limits

Platform API v1 returns structured JSON errors. Use status + error.code for branching — not message strings. OpenAPI documents common responses per route; this page is the cross-surface index.

Error Shape (v1)

{
  "error": {
    "code": "COOLDOWN",
    "message": "Human-readable summary",
    "details": { "retryAfterMs": 150000 }
  }
}

TypeScript: TorqueV1ErrorBody from @torquefi/types. SDK clients throw TorqueIntelligenceError (etc.) with code and statusCode.

Error Codes

HTTPCodeLayerTypical cause
401UNAUTHORIZEDAuthMissing Authorization header
401INVALID_API_KEYAuthUnknown sk_live_… key
401INVALID_TOKENAuthInvalid or expired smart wallet JWT
403BUSINESS_INACTIVEAuthBusiness account not active
403INTEGRATOR_PRO_REQUIREDDataPro integrator gate — see Entitlements guide
403EVM_WALLET_REQUIREDExecuteNo EVM wallet on user account
403EVM_WALLET_INVALIDExecuteStored EVM address invalid
403SOLANA_WALLET_REQUIREDExecuteNo Solana address on user account
400INVALID_JSONRequestMalformed JSON body
400VALIDATION_ERRORRequestMissing or invalid fields
400BUILD_FAILEDExecuteRoute builder could not construct tx
404NOT_FOUNDREADResource not found (e.g. no brief available)
429COOLDOWNIntelligenceforce=1 reroll cooldown — see details.retryAfterMs
402assistant_credits_exhaustedAssistantFree-tier message limit (legacy body shape)
502JUPITER_ERRORExecuteSolana swap upstream failure
503CONFIG_ERRORPlatformServer misconfiguration (e.g. Convex URL)
503INTELLIGENCE_UNAVAILABLEIntelligenceFeed assembly unavailable
500INTERNAL_ERRORPlatformUnhandled pipeline failure
500INTELLIGENCE_ERRORIntelligenceGeneric feed error

Execute routes may return additional builder-specific codes in BUILD_FAILED messages. See Actions API and the live OpenAPI spec per route.

Rate Limits

SurfaceLimitErrorClient action
Intelligence force=15 min cooldown per wallet429 COOLDOWNRetry after details.retryAfterMs
Assistant chat (free tier)20 messages / 30 days per wallet402 assistant_credits_exhaustedUpgrade or wait for credit reset

General READ routes (feed, datasets, markets) do not publish global per-key rate limits today. Use exponential backoff on 503/500 from your BFF.

Retry: Intelligence Cooldown

force=1 on trade-angles (and related views) triggers a live reroll with a per-wallet cooldown. The SDK retries automatically when configured; raw HTTP clients should sleep for details.retryAfterMs.

handle-cooldown.ts
import type { TorqueV1CooldownErrorBody } from '@torquefi/types'

async function fetchWithCooldownRetry(fetchFn: () => Promise<Response>) {
  const res = await fetchFn()
  if (res.status !== 429) return res

  const body = (await res.json()) as TorqueV1CooldownErrorBody
  if (body.error?.code !== 'COOLDOWN') return res

  const ms = body.error.details?.retryAfterMs ?? 60_000
  await new Promise((r) => setTimeout(r, ms))
  return fetchFn()
}

Assistant Credits (402)

Free-tier wallets hit a message quota. The response uses a legacy top-level shape in some paths:

{ "error": "assistant_credits_exhausted", "message": "…" }

Programmatic integrators with a business key typically bypass wallet free-tier limits for server-side chat. In-app browser sessions may still be subject to credits.

See Also

Was this helpful?