Skip to main content

Error Response Format

When an error occurs, the API returns a JSON response with details:
{
  "error": {
    "code": "invalid_api_key",
    "message": "The API key provided is invalid.",
    "status": 401
  }
}
FieldDescription
codeMachine-readable error code
messageHuman-readable description
statusHTTP status code

Error Codes

Authentication Errors (4xx)

CodeStatusDescriptionSolution
invalid_api_key401API key is invalid or malformedCheck your API key is correct
missing_api_key401No API key providedAdd Authorization: Bearer <key> header
expired_api_key401API key has been revokedGenerate a new key in the dashboard
insufficient_permissions403Key doesn’t have required permissionsUse a key with appropriate permissions

Request Errors (4xx)

CodeStatusDescriptionSolution
invalid_request400Request body is malformedCheck your JSON syntax
missing_required_field400Required field is missingInclude all required fields
invalid_field_value400Field value is invalidCheck field types and formats
agent_not_found404Agent doesn’t existVerify the agent name
rate_limit_exceeded429Too many requestsSlow down and retry with backoff

Server Errors (5xx)

CodeStatusDescriptionSolution
internal_error500Unexpected server errorRetry the request; contact support if persistent
agent_error500Agent execution failedCheck agent logs in dashboard
timeout504Request timed outUse streaming or break up large tasks

Handling Errors in SDKs

Python

from reminix import Reminix
from reminix.errors import (
    AuthenticationError,
    NotFoundError,
    RateLimitError,
    APIError
)

client = Reminix()

try:
    response = client.agents.invoke("my-agent", prompt="hello")
except AuthenticationError as e:
    print(f"Check your API key: {e.message}")
except NotFoundError as e:
    print(f"Agent not found: {e.message}")
except RateLimitError as e:
    print(f"Rate limited. Retry after: {e.retry_after}s")
except APIError as e:
    print(f"API error: {e.code} - {e.message}")

TypeScript

import Reminix from '@reminix/sdk';
import {
  AuthenticationError,
  NotFoundError,
  RateLimitError,
  APIError
} from '@reminix/sdk';

const client = new Reminix();

try {
  const response = await client.agents.invoke('my-agent', {
    prompt: 'hello'
  });
} catch (e) {
  if (e instanceof AuthenticationError) {
    console.error('Check your API key:', e.message);
  } else if (e instanceof NotFoundError) {
    console.error('Agent not found:', e.message);
  } else if (e instanceof RateLimitError) {
    console.error(`Rate limited. Retry after: ${e.retryAfter}s`);
  } else if (e instanceof APIError) {
    console.error(`API error: ${e.code} - ${e.message}`);
  }
}

Rate Limiting

The API enforces rate limits to ensure fair usage:
LimitValue
Requests per minute60
Requests per day10,000
When rate limited, you’ll receive a 429 response with a Retry-After header:
HTTP/1.1 429 Too Many Requests
Retry-After: 30
Best practices:
  • Implement exponential backoff
  • Cache responses when possible
  • Use webhooks for async workflows

Retry Strategy

For transient errors (5xx, timeouts), implement retry with exponential backoff:
import time
from reminix import Reminix
from reminix.errors import APIError

client = Reminix()

def invoke_with_retry(agent, max_retries=3, **kwargs):
    for attempt in range(max_retries):
        try:
            return client.agents.invoke(agent, **kwargs)
        except APIError as e:
            if e.status >= 500 and attempt < max_retries - 1:
                time.sleep(2 ** attempt)  # 1s, 2s, 4s
                continue
            raise

response = invoke_with_retry("my-agent", prompt="hello")

Getting Help

If you encounter persistent errors:
  1. Check the Status Page for outages
  2. Review agent logs in the dashboard
  3. Contact [email protected] with:
    • Error code and message
    • Request ID (from response headers)
    • Timestamp of the error