Skip to main content

Error Response Format

All errors return a consistent format with actionable suggestions.
{
  "error": {
    "code": "error_code",
    "message": "Human-readable description",
    "suggestion": "How to fix it"
  }
}

Error Reference

CodeHTTPDescriptionSuggestion
invalid_api_key401API key missing or invalidCheck your API key in the dashboard
unauthorized401Could not resolve organizationVerify your API key is valid
rate_limited429Too many requestsWait and retry, or upgrade your plan
extension_daily_limit429Chrome extension daily limit reachedUpgrade to Pro for unlimited use
session_not_found404Session ID doesn’t existCheck the session_id from sanitize
session_expired410Session has expiredSessions last 24 hours, re-sanitize
empty_text400Text field is emptyProvide text to sanitize
text_too_large413Text exceeds 100KBSplit into smaller chunks
invalid_request400Malformed request bodySee API docs for the correct request format
invalid_pattern400Regex pattern is invalidCheck your pattern syntax
pattern_not_found404Pattern ID doesn’t existList patterns to find valid IDs
insight_not_found404Insight ID doesn’t existList insights to find valid IDs
internal_error500An unexpected error occurredTry again or contact support

Rate Limits

PlanRequests/minute
Free20
Pro600
Pro Plus2,000

Rate Limit Headers

HeaderDescription
X-RateLimit-LimitYour rate limit
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetUnix timestamp when limit resets

Handling Errors in Python

from ambientmeta import AmbientMeta
from ambientmeta.exceptions import RateLimitError, NotFoundError

client = AmbientMeta(api_key="am_live_xxx")

try:
    result = client.sanitize(text)
except RateLimitError as e:
    print(f"Rate limited: {e.message}")
except NotFoundError:
    print("Session not found or expired, re-sanitize")