TypeScript-first API client built on OpenAPI. File-based, type-safe, LLM-optimized.
A lightweight Postman alternative that:
- Lives inside your codebase (
.api/folder) - Built on
openapi.json— no new formats to learn - TypeScript-first for type safety and autocomplete
- LLM-optimized (agents can create, run, and test requests)
- Handles environments, variables, and post-request scripts
- Long-lived sessions (auth tokens persist)
Postman/Bruno pain points:
- Proprietary formats — Bruno uses
.bru, Postman uses JSON with custom schema - Not git-native — Collections sync to cloud, not your repo
- No TypeScript types — LLMs and devs can't get autocomplete/validation
- Not OpenAPI-first — Import works, but it's a one-way conversion
- Heavy — Electron apps, accounts, cloud sync for a glorified HTTP client
The gap: No tool is truly file-first, OpenAPI-native, TypeScript-typed, and LLM-friendly.
your-repo/
├── openapi.json # Source of truth
├── .api/
│ ├── config.ts # Environments, variables
│ ├── requests/
│ │ ├── auth.login.ts # TypeScript request definitions
│ │ ├── users.get.ts
│ │ └── users.create.ts
│ └── scripts/
│ └── save-token.ts # Post-request hooks
// .api/requests/auth.login.ts
import { defineRequest } from 'tsreq';
import { api } from '../generated';
export default defineRequest({
operation: api.auth.login,
body: {
email: '{{env.TEST_EMAIL}}',
password: '{{env.TEST_PASSWORD}}',
},
afterResponse: async (response, ctx) => {
if (response.ok) {
ctx.setVariable('accessToken', response.data.token);
}
},
});// .api/config.ts
export default {
environments: {
local: { baseUrl: 'http://localhost:3000' },
staging: { baseUrl: 'https://staging.api.example.com' },
production: { baseUrl: 'https://api.example.com' },
},
variables: {
accessToken: null,
},
session: {
persist: true,
ttl: '180d',
},
};# Run a request
tsreq run auth.login --env staging
# Run with variables
tsreq run users.create --var userId=123
# Generate types from OpenAPI
tsreq generate ./openapi.json
# Interactive TUI
tsreq
# JSON output for LLM consumption
tsreq run auth.login --json- Types from OpenAPI — Generate types from
openapi.json, requests are type-checked - LLMs love TS — Claude/GPT can write valid requests with autocomplete knowledge
- ts-rest/tRPC compatible — Same contract, different runtime
- Executable — Import in tests or run via CLI
- Generate types from
openapi.json - TypeScript request definitions
- Environment variables (
.envsupport) - Post-request scripts (save tokens, etc.)
- CLI runner
- JSON output for LLM consumption
- TUI for interactive use
- Request chaining
- Session persistence
- Import from Bruno/Postman
- VS Code extension
- Watch mode
- Mock server from OpenAPI
| Tool | Format | OpenAPI | TypeScript | LLM-Friendly |
|---|---|---|---|---|
| Bruno | .bru (custom) |
Import only | ❌ | |
| Postman | JSON (custom) | Import only | ❌ | ❌ |
| Slumber | YAML | ❌ | ❌ | ✅ |
| httpYac | .http |
❌ | ❌ | |
| tsreq | TypeScript | ✅ Native | ✅ | ✅ |
# Install dependencies
bun install
# Start development
bun run dev
# Run checks
bun run checktsreq/
├── apps/
│ ├── web/ # Landing page (Astro)
│ ├── docs/ # Documentation (Starlight)
│ └── tui/ # Terminal UI (OpenTUI)
├── packages/
│ └── ... # Core library (coming soon)
- LLMs are writing code — They need type-safe, file-based tools
- Bruno proved the market — 22k+ GitHub stars for a file-first API client
- TypeScript dominance — Most API backends are TS now
- OpenAPI is standard — Everyone has it, no one builds on it properly
MIT
Built with Better-T-Stack and OpenTUI.