pip install lapsh
# Or from source:
git clone https://github.com/Lap-Platform/lap.git
cd lap
pip install -r requirements.txtDependencies: pyyaml, tiktoken, rich
Optional extras:
pip install lapsh[langchain] # LangChain integration
pip install lapsh[tokens] # Token counting with tiktoken# Use directly (no install)
npx @lap-platform/lapsh compile api.yaml -o api.lap
# Or install globally
npm install -g @lap-platform/lapsh
# Or add to a project
npm install @lap-platform/lapshIf you just need the compiler:
git clone https://github.com/Lap-Platform/lap.git
cd lap
pip install pyyaml tiktoken rich
lapsh --helplapsh compile examples/verbose/openapi/stripe-charges.yaml -o stripe.lapOutput:
✓ Compiled stripe-charges.yaml → stripe.lap
✓ 5 endpoints | 4,291 chars | standard mode
The compiled LAP file:
@lap v0.1
@api Stripe Charges API
@base https://api.stripe.com
@version 2024-12-18
@auth Bearer bearer
@endpoint POST /v1/charges
@desc Create a charge
@required {amount: int # Amount in cents., currency: str # ISO 4217 code.}
@optional {source: str, customer: str, description: str, metadata: map, ...}
@returns(200) {id: str, amount: int, currency: str, status: str, paid: bool, ...}
@errors {400: Invalid request., 401: Auth failed., 402: Card declined., 429: Rate limited.}
lapsh compile examples/verbose/openapi/stripe-charges.yaml --leanOutput (lean mode strips descriptions):
@lap v0.1
@api Stripe Charges API
@base https://api.stripe.com
@version 2024-12-18
@auth Bearer bearer
@endpoint POST /v1/charges
@required {amount: int, currency: str}
@optional {source: str, customer: str, description: str, metadata: map, ...}
@returns(200) {id: str, amount: int, currency: str, status: str, paid: bool, ...}
@errors {400, 401, 402, 429}
lapsh inspect stripe.lapLAP is a structured, typed format for API documentation. Here's what each directive means:
| Directive | Purpose | Example |
|---|---|---|
@lap |
Format version | @lap v0.1 |
@api |
API name | @api Stripe Charges API |
@base |
Base URL | @base https://api.stripe.com |
@version |
API version | @version 2024-12-18 |
@auth |
Auth scheme | @auth Bearer bearer |
| Directive | Purpose | Example |
|---|---|---|
@endpoint |
Method + path | @endpoint POST /v1/charges |
@desc |
Description | @desc Create a charge |
@required |
Required params | @required {amount: int, currency: str} |
@optional |
Optional params | @optional {limit: int=10} |
@returns(N) |
Response schema | @returns(200) {id: str, status: str} |
@errors |
Error codes | @errors {400, 401, 429} |
| Type | Meaning | Example |
|---|---|---|
str |
String | name: str |
int |
Integer | amount: int |
num |
Number (float) | price: num |
bool |
Boolean | active: bool |
map |
Object/dict | metadata: map |
any |
Any type | data: any |
[type] |
Array | tags: [str] |
type? |
Nullable | email: str? |
type(format) |
Format hint | created: int(unix-timestamp) |
enum(a|b|c) |
Enumeration | status: enum(active|inactive) |
type=default |
Default value | limit: int=10 |
- Standard mode — keeps
@descand# commentannotations. Best for debugging and human review. - Lean mode (
--lean) — strips all descriptions. Maximum compression for production agent use.
- Compiling OpenAPI Specs — batch compilation, handling large specs
- Framework Integration -- LangChain, Context Hub, SDKs
- CLI Reference — all commands with examples