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/v1Authentication
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..."
}
}| Code | HTTP | Meaning |
|---|---|---|
| invalid_request | 400 | A required field is missing or malformed. |
| unauthorized | 401 | API key missing, invalid or revoked. |
| forbidden | 403 | Your key doesn't have access to this product. |
| not_found | 404 | The resource does not exist. |
| rate_limited | 429 | Too many requests. Retry after the Retry-After header. |
| server_error | 500 | Something 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.