Skip to content

OpenAPI-driven · terminal-first · agent-ready

>_ lazyapi

Explore, test and automate any API straight from its OpenAPI spec. A terminal UI for humans, a CLI for CI, an MCP server for agents.

No collections to keep in sync: every response is checked against the spec, and your tests are JavaScript files committed next to it.

lazyapi examples/openapi.yml
>_ lazyapi · openapi.ymlenv: local→ http://127.0.0.1:4010
🔍 press / to filter
── auth (1) ──
── system (1) ──
── users (4) ──
GET/users/{id}
Get a user
Server: http://127.0.0.1:4010
200 OK1ms · 60 B
{
  "id": 1,
  "name": "Ana",
  "email": "ana@example.com"
}
s send • j/k move • tab response tab • R run tests • ctrl+k commands • ? help

One spec, three interfaces ​

The OpenAPI document is the single source of truth. There are no collections to export, no environments to rebuild: point LazyAPI at your spec and every operation is ready to explore, send and test.

See it in action ​

Every response is checked ​

Each exchange — from the TUI, the CLI, a flow or an agent — goes through the same checks. --no-contract turns off request and contract for deliberately invalid calls.

1 · request[PASS]the request sent matches the spec: required params, types, body schema
2 · status[PASS]the status code is declared in the operation's responses
3 · contract[PASS]response headers and body match the declared schema
4 · test[PASS]each test() in the operation's script passes

Two minutes, no server needed ​

bash
git clone https://github.com/githiago-f/lazyapi.git && cd lazyapi
go build -o lazyapi ./cmd/lazyapi

./lazyapi mock examples/openapi.yml &          # fake API from the spec's examples
./lazyapi run examples/openapi.yml --methods all --flows
text
Passed GET /users/{id} — 200 OK (1ms)
  [PASS] request: request matches the OpenAPI spec
  [PASS] status: status 200 is declared
  [PASS] contract: response matches the OpenAPI schema
  [PASS] returns the requested user
========================================
Operations: 7 passed, 0 failed, 0 errors, 0 skipped (20ms)
Checks:     40 passed, 0 failed

Then open the TUI on the same spec: ./lazyapi examples/openapi.yml. More in Getting Started.

Tests are JavaScript next to your spec ​

js
import { z } from "https://esm.sh/zod@3.23.8"   // URL imports, pinned in .lazyapi/lazyapi.lock
import { login, bearer } from "./helpers.js"    // relative imports

test("returns the user", () => {
  expect(response).toHaveStatus(200)
  expect(response.json()).toHaveProperty("email")
})

test("chained call with a token", () => {
  const me = lazyapi.send("getUser", { params: { id: "1" }, headers: bearer(login()) })
  expect(me).toMatchSchema()
})
yaml
paths:
  /users/{id}:
    get:
      operationId: getUser
      x-lazyapi-tests: .lazyapi/tests/getUser.js
js
const created = lazyapi.send("createUser", { body: { name: "Ana", email: "ana@example.com" } })
test("created", () => expect(created).toHaveStatus(201))

const removed = lazyapi.send("deleteUser", { params: { id: String(created.json().id) } })
test("deleted", () => expect(removed).toHaveStatus(204))

Scripts run in a sandbox with request, response, env, vars, lazyapi.send, faker, test, expect and console. See Test Scripts.

Git-native ​

Everything lives in .lazyapi/ next to the spec and is versioned with it. Secrets and local state stay out of git.

text
api/
  openapi.yml
  .lazyapi/
    config.yml          named environments: server, vars, HTTP options, credentials
    envs/staging.env    variables            (committed)
    secrets/staging.env tokens, passwords    (git-ignored, mode 600)
    tests/  flows/  data/
    lazyapi.lock        pinned URL imports
    .local/             drafts and history   (git-ignored)

Read Environments & Auth for the details.

Exit codes ​

CodeMeaning
0everything passed
1a check failed
2usage error
3something could not run (spec, network, config)

Released under the GPLv3 License.

/ search•[ ] prev/next•j/k scroll•h home•t theme•home