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/create

Request Body Schema

FieldTypeAttributesDescription
targetHoststringrequiredThe FQDN of your backend.
faultstringrequiredFault pattern: 502 Bad Gateway, 504 Gateway Timeout, 429 Rate Limit, or latency (Traffic Degradation).
latencyintegeroptionalTarget latency in ms (required if fault is latency).
jitterintegeroptionalLatency jitter fluctuation in ms.
packetLossintegeroptionalPacket loss percentage (0-100).
distributionstringoptionalStatistical distribution: Uniform, Normal or Spikes.
mutilationStrategystringoptionalStrategy for payload mutilation: None, Unexpected EOF, Type Poisoning, Empty Shell.
customTtlintegeroptionalToken TTL in seconds (default: 600).
Authorization: Bearer $PANIC_TOKEN
# Inject this header into your edge router or API gateway.

3. Edge Error Matrix

HTTP StatusX-Panic-Error StringResolution
403 ForbiddenSECURITY_VIOLATIONInvalid token or Turnstile challenge failed. Check token TTL.
429 Too Many RequestsQUOTA_EXCEEDEDConcurrent active token limit reached (Max 5). Wait for expiration.
502 Bad GatewayEDGE_ROUTING_FAILEDSimulated or real upstream failure during chaotic injection.
504 Gateway TimeoutUPSTREAM_TIMEOUTUpstream 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.