Skip to main content
When something goes wrong, the SURCHI API always returns a structured JSON error response with a machine-readable error code, a human-readable message, the HTTP status code, and — where applicable — a details object with context-specific information to help you debug quickly. Understanding the error format and knowing which codes to expect from each endpoint will help you build robust integrations that recover gracefully from transient failures and surface meaningful errors to your users.

Error Response Format

All error responses use the same envelope as successful responses, but with success: false and an error object in place of data.

HTTP Status Codes

Error Code Reference

Handling Rate Limits

When you exceed your rate limit, the API returns HTTP 429 with a Retry-After header specifying how many seconds to wait before your window resets. The following JavaScript helper demonstrates an exponential-backoff retry pattern that respects this header:
Monitor these response headers on every request to stay ahead of your limit before you hit it:

Common Issues

A 401 response means the API could not authenticate your request. Work through these checks in order:
  1. Verify the header format. The header must be exactly Authorization: Bearer sk_live_xxxxxxxxxxxx — including the Bearer prefix followed by a single space. Do not include quotes around the key value.
  2. Check for trailing whitespace. Copy-paste errors often introduce a trailing space or newline at the end of the key. Trim your key string before sending.
  3. Confirm the key has not been revoked. Log in to surchi.xyz/dashboard → Settings → API Keys and verify the key appears as active.
  4. Check you are using the correct environment. Test keys (prefixed sk_test_) will not work against the production base URL and vice versa.
A TOKEN_NOT_FOUND error with a contract address you are confident is correct almost always comes down to a mismatched network parameter.
  • Double-check that the network value in your request matches the chain the token actually lives on. For example, a Polygon token passed with network=ethereum will return 404.
  • Verify the address is the token contract address, not a pool address or wallet address.
  • For newly launched tokens (under ~5 minutes old), indexing may not be complete. Wait 60 seconds and retry.
  • Make sure the address casing is correct for EVM chains — SURCHI accepts both checksummed and lowercase addresses, but some addresses with invalid checksums may be rejected with INVALID_ADDRESS.
An AUDIT_UNAVAILABLE error means SURCHI’s AI audit engine is temporarily busy or being updated. This is a transient state, not a permanent failure.
  • Wait 30 seconds and retry your request. Most AUDIT_UNAVAILABLE windows are resolved within one minute.
  • Check the SURCHI status page if the error persists for more than five minutes.
  • The audit endpoint has a longer timeout than other endpoints (up to 10 seconds) due to AI processing time. If you are seeing timeouts rather than 503 errors, increase your HTTP client timeout to at least 15 seconds.
If you are receiving RATE_LIMIT_EXCEEDED errors unexpectedly, check the following:
  • Read the X-RateLimit-Remaining header on your responses. You may be sharing a key across multiple processes or services that are each consuming quota independently.
  • Check your plan’s limit. The Free plan allows only 10 requests per minute. If you are making more than this — including retries — you will hit the limit quickly. Consider upgrading to Standard or Pro.
  • Avoid polling short-interval loops. If you are calling /v1/trending in a tight loop, add a minimum delay of at least 60 seconds between calls — the feed only refreshes once per minute anyway.
  • Cache responses where possible. Token data, portfolio snapshots, and audit results change slowly. Store responses locally and serve from cache rather than re-fetching on every page load.