API v1StableLast updated Oct 2026Changelog →
Get started

Test & live modes

Test and live keys, whoami and the environment header.

Every key belongs to one environment, test or live, fixed when the key is created. You switch modes by switching keys: messy_test_… or messy_live_….

Both modes use the same engines and draw from the same monthly allowance. Test mode keeps things separate and labeled. It is not a free or mocked tier.

Simulate errors (test keys only)

Add X-Messy-Simulate to any request made with a test key to get a specific error back instantly. Nothing runs and nothing is counted against your allowance. Live keys reject the header.

curl -X POST https://messyapi.com/api/v1/normalize-phone \
  -H "Authorization: Bearer $MESSYAPI_TEST_KEY" \
  -H "X-Messy-Simulate: rate_limit_exceeded" \
  -H "Content-Type: application/json" -d '{}'

Values: rate_limit_exceeded (429 with Retry-After), usage_limit_exceeded (429), invalid_request (400), unauthorized (401), forbidden (403), internal_error (500), dependency_unavailable (503 with Retry-After). Responses carry X-Messy-Simulated: true.

Check a key with whoami

GET /api/v1/whoami shows the environment, organization, plan and product access for a key. It is never metered.

curl https://messyapi.com/api/v1/whoami \
  -H "Authorization: Bearer $MESSYAPI_API_KEY"
{ "environment": "test", "live": false, "organization_id": "org_...", "key_id": "key_...", "plan": "free", "records_limit": 5000, "products": [...] }

The environment header

Every authenticated response includes X-Zapinner-Environment: test|live next to X-Request-Id. The legacy header name is kept for compatibility.

Before you go live

  • Store test and live keys as separate secrets.
  • Check the environment header or whoami in CI.