Sample API — v1

API Documentation

One REST API for all four Guardyen AI products. JSON in, JSON out, average AI decision under 40ms.

Base URL

https://api.guardyen.com/v1

Authentication

Send your secret key as a Bearer token. Test keys start with gy_test_sk_, live keys with gy_live_sk_. Never use secret keys in a browser or app.

Example

curl -X GET https://api.guardyen.com/v1/ping \
  -H "Authorization: Bearer gy_test_sk_..." \
  -H "Content-Type: application/json"

Sandbox vs live

Test keys hit the sandbox: same endpoints, simulated AI decisions, no real money. Use amount 666 to force a high-risk score and 500 to force a route error.

Errors

Error format

{
  "error": {
    "code": "invalid_request",
    "message": "amount is required",
    "request_id": "req_01HF..."
  }
}
CodeHTTPMeaning
invalid_request400A required field is missing or malformed.
unauthorized401API key missing, invalid or revoked.
forbidden403Your key doesn't have access to this product.
not_found404The resource does not exist.
rate_limited429Too many requests. Retry after the Retry-After header.
server_error500Something went wrong on our side. Safe to retry.

Rate limits

1,000 requests per second per live key, 100 per second in sandbox. Every response includes X-RateLimit-Remaining.

Webhooks

Register an HTTPS endpoint in your dashboard. Each event is signed with the Guardyen-Signature header (HMAC-SHA256 of the raw body with your webhook secret). Reply with 2xx within 5 seconds; we retry up to 8 times with backoff.

Product guides