API Documentation
Integrating panic.design requires zero code changes.
[ Your Backend ] ◄─────► [ panic.design Edge Gateway ] ◄─────► [ External Client ] (Target Host) (Global W2 Proxy Nodes) (W1 Ingress)
1. Authentication
All requests to the control plane and data plane must be authenticated using your PANIC_TOKEN. Pass it via the standard HTTP Authorization header.
2. Proxy Data Plane Integration
Create an ephemeral edge token to initiate a chaos proxy session.
POST
/api/tokens/createRequest Body Schema
| Field | Type | Attributes | Description |
|---|---|---|---|
targetHost | string | required | The FQDN of your backend. |
fault | string | required | Fault pattern: 502 Bad Gateway, 504 Gateway Timeout, 429 Rate Limit, or latency (Traffic Degradation). |
latency | integer | optional | Target latency in ms (required if fault is latency). |
jitter | integer | optional | Latency jitter fluctuation in ms. |
packetLoss | integer | optional | Packet loss percentage (0-100). |
distribution | string | optional | Statistical distribution: Uniform, Normal or Spikes. |
mutilationStrategy | string | optional | Strategy for payload mutilation: None, Unexpected EOF, Type Poisoning, Empty Shell. |
customTtl | integer | optional | Token TTL in seconds (default: 600). |
3. Edge Error Matrix
| HTTP Status | X-Panic-Error String | Resolution |
|---|---|---|
| 403 Forbidden | SECURITY_VIOLATION | Invalid token or Turnstile challenge failed. Check token TTL. |
| 429 Too Many Requests | QUOTA_EXCEEDED | Concurrent active token limit reached (Max 5). Wait for expiration. |
| 502 Bad Gateway | EDGE_ROUTING_FAILED | Simulated or real upstream failure during chaotic injection. |
| 504 Gateway Timeout | UPSTREAM_TIMEOUT | Upstream server failed to respond within the Edge TTL threshold. |
Appendix: LGPA Engine
The Localized Geodesic Proximity Algorithm (LGPA) guarantees authentic physical displacement mapping across global proxy layers.
Phase 1: Latency Calibration
Isolate Edge execution time. Derive pure single-trip Time-of-Flight (T1/T3).
Phase 2: Geodesic Linear Interpolation
Compute virtual W2 coordinate via fractional latency alpha factor.
Phase 3: Distance Perimeter Check
Execute Haversine scan across 300+ edge cluster topology.
Phase 4: Vector Angle Arbitration
Calculate spherical Azimuth bearing to resolve equidistant data centers.
Phase 5: Mesh Dictionary Snapping
Snap to physical W2 infrastructure node for verified spatial telemetry.