Skip to main content

REST API Errors

The Meter API uses standard HTTP status codes and returns JSON error messages.

HTTP status codes

Error response format

All errors return JSON with a detail field:

Common errors

401 Unauthorized

Cause: Invalid or missing API key
Solutions:
  • Verify Authorization header is included
  • Check API key is correct
  • Ensure key hasn’t been deleted

400 Bad Request

Cause: Invalid request parameters
Common causes:
  • Missing required fields
  • Invalid field types
  • Malformed JSON
  • Invalid UUIDs
Solutions:
  • Check request body matches expected format
  • Verify all required fields are present
  • Ensure JSON is valid

404 Not Found

Cause: Resource doesn’t exist
Solutions:
  • Verify the UUID is correct
  • Check the resource hasn’t been deleted
  • Ensure you have permission to access it

422 Unprocessable Entity

Cause: Request is valid but contains semantic errors
Solutions:
  • Check field values meet semantic requirements (e.g., valid URL format)
  • Verify data relationships are valid

500 Internal Server Error

Cause: Server-side error
Solutions:
  • Retry the request after a delay
  • If persistent, contact support
  • Check API status page

Handling errors

JavaScript

Python

curl

Best practices

For 429, 500, and 503 errors, retry with appropriate backoff:
Always check HTTP status codes before parsing responses:
Include request details when logging errors:

Rate limiting

Strategy generation endpoints (/api/strategies/generate, /api/watch) are rate limited to prevent overloading the underlying LLM service.

429 Too Many Requests

When you hit rate limits, the API returns:
The Retry-After header tells you how many seconds to wait before retrying.

Handling rate limits

JavaScript:
Python:

503 Service Unavailable

If the LLM service is temporarily unavailable:

Next steps

Python SDK Errors

Error handling in the Python SDK

REST API Overview

Learn about the REST API

Authentication

Understand authentication errors

Need help?

Email me at mckinnon@meter.sh