local API control for frontend teams

Your backend isn’t ready.
Your frontend can be.

Create a controllable local API from JSON, models, or OpenAPI. Then flip any response, error, delay, or whole scenario from one panel.

empty cart ·unauthorized user ·3s latency ·checkout failed — one click away.

Quick start Watch the 20-second demo

no account no cloud no code changes one binary

127.0.0.1:8000/__laqi

20-second demo poster — a real storefront UI beside the laqi panel; click GET /products → empty, the UI empties — 16:9

or browse files

for whom

One local API. Different ways to move faster.

laqi is for the moments when an API is missing, unreliable, inconvenient, or simply not behaving the way you need to test.

frontend

Ship the interface before the backend arrives

Start from a JSON contract, an OpenAPI file, or a TypeScript model. Point your app at laqi and keep building while the real API is still in progress.

model → seeded data → local endpoint → working UI

quality

Make edge cases routine

Force an empty state, a 401, a 500, or slow loading whenever you need it. Reproduce the state precisely instead of waiting for an unstable environment or lucky timing.

empty · slow · unauthorized · error

agents

Give coding agents an API they can control

With MCP, an agent can create endpoints, generate data, import OpenAPI, and switch responses — while you see the result in a real frontend.

model / OpenAPI → agent → mock files → panel

real HTTP

Test beyond one browser tab

Use the same mocks from a physical phone, another machine, React Native, or curl. laqi serves real HTTP responses.

quick start

Contract, run, point your app

$ npm i -g laqi@2

01

Write the contract

A JSON file in ./laqi/. One key per route, a named response for each state you care about. Add "delay": 2400 to any of them and you have built the slow state too.

{
  "GET /todos": {
    "default": "ok",
    "responses": {
      "ok": {
        "status": 200,
        "body": [{ "id": 1 }]
      },
      "empty": {
        "status": 200,
        "body": []
      },
      "error": {
        "status": 500
      }
    }
  }
}

02

Run it

One command. The panel opens with it, and the folder is watched from then on.

$ laqi start

⚡ laqi 2.0.0
serving   127.0.0.1:8000
panel     127.0.0.1:8000/__laqi
watching  ./laqi/  7 endpoints

03

Point your app at it

Change one base URL. Everything else — states, errors, latency — now happens in the panel.

// .env.local
VITE_API_URL=http://127.0.0.1:8000

// or per-request, no state change:
fetch("/todos", {
  headers: {
    "X-Laqi-Response": "error"
  }
})

predictable by design

Every response has an explanation.

A request header, a one-off panel choice, an active scenario, or the file default: laqi resolves responses in a clear order and tells you which layer won.

You always know why a response won — the panel shows it, the terminal logs it, and every response carries it in an X-Laqi-Resolved header.

Concepts → Resolution →
  1. 1

    header

    X-Laqi-Response on one request · changes nothing

  2. 2

    state

    you clicked a chip in the panel · persists

  3. 3

    scenario

    offline, logged-out, empty-state · one at a time

  4. 4

    default

    whatever the file says · the baseline

what you get

Built for the fifty times a day you ask "what if this fails?"

one click

Put one endpoint in any state

Make the next request succeed, fail, return empty data, or wait — without a rebuild or restart.

scenarios

Move the whole API together

Activate a named situation — logged out, checkout broken, offline — and change multiple endpoints in one move.

live log

See what your app actually requested

Every request is visible, including unmatched ones. Find out why a mock is not answering instead of guessing.

latency

Design slow states on purpose

Add delay to any response and test the loading experience users will actually see.

plain files

Keep the API contract in your repo

Mocks are ordinary JSON files: editable, reviewable, and shareable with the team.

real HTTP

Use it wherever HTTP reaches

Connect web, mobile, devices, curl, and other clients — not just an intercepted browser request.

30-second demo poster — activate scenario 'checkout-broken': empty cart, payment error, visible delay — one click, several endpoints

or browse files

30-second demo poster — paste a TypeScript Order interface, generate seeded data, a working UI appears on localhost

or browse files

built for AI-assisted workflows

Let your agent build the mocks.
Keep control of the states.

laqi’s MCP server gives coding agents tools to create endpoints, import OpenAPI, generate realistic data, and switch responses. The result is still ordinary JSON and a local panel your team can inspect.

Using laqi with AI agents →
  1. 1 Order.ts / openapi.yaml
  2. 2 agent via laqi mcp
  3. 3 laqi/orders.json
  4. 4 panel · your team flips states

Build your first controllable API

A JSON file, one command, one base URL — and every state your frontend needs to handle is a click away.

Quick start Read the docs
$ npm i -g laqi@2

Plain JSON in your repo · runs on your machine · the panel stays local — --share exposes only mock responses, never the control plane.