OpenAPI-driven · terminal-first · agent-ready
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.
{
"id": 1,
"name": "Ana",
"email": "ana@example.com"
}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.
Browse operations grouped by tag, edit params, auth, headers and body, send with alt+enter and read the response with highlighting, jq filters, cookies, timing and checks.
$ lazyapi api.ymlRun every operation with its checks and tests, in parallel, with retries. Reports as pretty text, JSON, JUnit or TAP, and the same exit codes everywhere.
$ lazyapi run api.yml --output junitAn MCP server confined to a root directory: agents list and describe operations, send requests, write tests and flows, and run them, with readable failures.
$ lazyapi mcp --root .Operations grouped by tag. s sends the selected one and the response shows up right there.
real captures of lazyapi examples/openapi.yml · ← → or [ ] to switch
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.
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 --flowsPassed 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 failedThen open the TUI on the same spec: ./lazyapi examples/openapi.yml. More in Getting Started.
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()
})paths:
/users/{id}:
get:
operationId: getUser
x-lazyapi-tests: .lazyapi/tests/getUser.jsconst 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.
Everything lives in .lazyapi/ next to the spec and is versioned with it. Secrets and local state stay out of git.
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.
| Code | Meaning |
|---|---|
0 | everything passed |
1 | a check failed |
2 | usage error |
3 | something could not run (spec, network, config) |