Runtime simulation

Simulate API Errors and Network Latency

Mock API Studio can add a fixed response delay and a seeded probability of HTTP 503 failures across the local runtime. Change these controls while the server is running to exercise loading, timeout, retry, and generic service-failure interfaces.

Add fixed response latency

Set project latency in milliseconds to delay mock responses consistently. A fixed value makes UI behavior reproducible when checking skeletons, disabled controls, navigation races, and request cancellation.

Configuration
Latency: 800 ms
Error rate: 0%
Seed: 42

Simulate service failures

Set an error percentage to make requests fail probabilistically with HTTP 503. A seed makes the generated data deterministic, but callers should still treat failure injection as a scenario rather than depend on a particular request number.

HTTP
HTTP/1.1 503 Service Unavailable
content-type: application/json

{ "error": "Simulated server error" }

Change controls at runtime

The local control API can update latency, error rate, record count, and seed, reset data, or regenerate records. Control routes are intended for local development automation.

HTTP
PUT /_mock/config
content-type: application/json

{ "latency": 1200, "errorRate": 0.25 }

Know the current boundary

Failures are currently a global probability with a fixed 503 response. Route-specific status scenarios such as forced 409, 422, 429, or 500 responses are not configurable yet. Use real 400, 401, 404, and relationship 409 behavior where those states arise naturally.

Related questions

Can I configure a different status for each route?

Not currently. Probabilistic simulation returns HTTP 503 globally; some other statuses arise from validation, auth, missing data, and relationship behavior.

Keep exploring

Last updated September 17, 2026. Product behavior described here is verified against the current Mock API Studio runtime.