Overview

OpenAPI contracts -> running services without writing code!
Apistry is a runtime engine that uses OpenAPI 3.0 contracts to provide a fully functional REST service. This is accomplished Without writing service-specific code β business logic is added only where explicitly needed via actions. The contract is extended to have all the needed config to drive the service.
It is now possible to have a fully operational service up and running in minutes!
...because routing, validation, and persistence are derived directly from the contract.
This page shows the fastest way to get Apistry running. Detailed explanations live in Getting Started and Guides.
β¨ Features
π Contract-Driven Runtime
- OpenAPI 3.0 as the Source of Truth β Define your API once; Apistry generates routes, validation, and persistence automatically
- No Service Code by Default β No controllers, routers, or boilerplate to get a working service
- Swagger UI Included β Interactive documentation for every running endpoint
π§ Validation & Normalization
- Automatic Request & Response Validation β Powered by AJV and JSON Schema
- Deterministic Canonicalization β Defaults, coercion, and enum normalization applied consistently
- Strict Contract Enforcement β Invalid requests never reach business logic
ποΈ Data & Persistence
- Automatic Collection Creation β Databases and collections are created and validated from OpenAPI tags at startup
- NeDB (Built-in) β In-memory or filesystem-backed JSON document database for fast local development
- MongoDB Support (Licensed) β Production-ready adapter with MongoDB-style semantics
- JSON Document Model β Designed to work with any document-oriented database
π Querying & Bulk Operations
- Rich Query Operators β eq, neq, gt, lt, gte, lte, isNull, isNotNull, and wildcard matching
- Bulk Inserts, Updates, and Deletes β Operate on multiple records efficiently
- List Responses with Metadata β Optional pagination and total-count information
π§ Extensibility & Orchestration
- Orchestration Actions β Add custom business rules and workflows only where needed
- Built-in Actions β Includes
http.call,contract.normalize.response, and other core actions - Custom Actions (Licensed) β Write and register your own business rules and orchestration logic
- Explicit Lifecycle Stages β Business validation and orchestration are cleanly separated from system mechanics
βοΈ Platform & Deployment
- Fastify-Based β High-performance, low-overhead Node.js runtime
- CLI-First Experience β Start and manage services in seconds
- AWS Lambda Ready β Serverless deployment support (coming soon)
Why This Matters
Apistry removes boilerplate and enforces a clear service lifecycle, so developers focus on business meaning, not infrastructure mechanics.
π» Quick Start
π§° 1. Install
Install apistry globally
$: npm install -g apistry
added 191 packages in 6s
63 packages are looking for funding
run `npm fund` for details
π 2. OpenAPI contract
Apistry, being a contract based service, requires a well-defined contract to startup. The following examples have been provided to get you started quickly:
- Books (
books.v1.yaml) - Cars (
cars.v1.yaml) - Has most sample endpoints and features - Notes (
notes.v1.yaml) - Polymorphic example - Swapi (
swapi.v2.yaml) - Demonstrates use of Actions to call external APIs and do contract normalizations - Utils (
utils.v1.yaml) - Simple utility endpoints for health checks and ??? - Videos (
videos.v1.yaml)
Download contracts.zip and extract all contracts and sample data files
$: cd ~
$: curl -o contracts.zip https://www.apitapestry.net/apistry/assets/contracts.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 995k 100 995k 0 0 3986k 0 --:--:-- --:--:-- --:--:-- 3981k
$: unzip -q contracts.zip
contract.zip directory structure:
/contracts
βββ books.v1.yaml
βββ cars.v1.yaml
βββ notes.yaml
βββ swapi.v2.yaml
βββ utils.v1.yaml
βββ videos.v1.yaml
βββ data β Example data files for import
β βββ books.json
β βββ cars.json
β βββ notes.json
β βββ videos.json
βββ nedb β Example database files
βββ books.db
βββ cars.db
βββ notes.db
βββ videos.db
π’ 3. Database
Apistry comes packaged with an in memory, filesystem backed DB that functions similar to MongoDB called NeDB.
The downloaded contracts.zip file contained db files that already have data needed to run the contracts.
For now, we will start the service using the -d flag to point to the nedb directory that contains the NeDB files.
π₯οΈ 4. Start the Server
Starting the server is fast and easy.
$: apistry serve -c contracts -d contracts/nedb
ββββββββββββββββββββββββββββββββββββββββ
π serve
ββββββββββββββββββββββββββββββββββββββββ
β’ Contract Path : /Users/myUser/contracts
β’ Db Connection : nedb:///Users/myUser/contracts/nedb
β’ License : β
β’ Log Level : info
β’ Log Mode : cli
β’ Port : 3000
β’ Host : localhost
β’ Swagger Enabled: enabled
β’ Service Name : APIstry
β’ Service Desc : OpenAPI contracts -> running services without writing code!
β’ Raw : { dbDir: "contracts/nedb", logLevel: "info", contract: "contracts" }
ββββββββββββββββββββββββββββββββββββββββ
[15:37:12] INFO: errors_plugin_registered
[15:37:12] INFO: server_starting
[15:37:12] INFO: db_connected
[15:37:13] INFO: β
Loaded 37 routes!
[15:37:13] INFO: Server listening at http://[::1]:3000
[15:37:13] INFO: Server listening at http://127.0.0.1:3000
[15:37:13] INFO: server_started
Local server is now running!
π‘ 5. Make API Calls
You can now make requests to your api using any REST client - including your browser. Here are some
example endpoints:
- Get all blue cars: GET: http://localhost:3000/v1/cars?color=Blue
- Get all features of a car: GET: http://localhost:3000/v1/cars/{carid}/features
- Get all events of a car: GET: http://localhost:3000/v1/cars/{carid}/events
Curl example:
# Get all cars
curl -X GET "http://localhost:3000/v1/cars" -H "accept: application/json"
Call using a browser:
url: http://localhost:3000/v1/cars?color=Blue

Hitting the docs endpoint in browser:

What just happened?
- Apistry read your OpenAPI contracts
- Generated routes, validation, and persistence automatically
- Exposed Swagger UI for exploration
- No service code was written
π οΈ 6. When do I write code?
Custom code is only required when you need business rules or orchestration. Everything else is driven by the contract. See "Creating Orchestration Actions" in the documentation for more details.
π¦ Whatβs Next?
Now that you have a running service, you may want to explore:
- Service Lifecycle β How Apistry enforces validation, normalization, orchestration, and persistence
- Writing Orchestration Actions β Adding business rules and workflows (licensed feature)
- Contract Design Guidelines β Designing APIs that work well with Apistryβs runtime
- CLI Reference β Full command-line options and flags
All documentation is available in the left navigation.
βΉοΈ Support
If you need help using Apistry or have any questions, you can use GitHub Discussions
If you have a bug or feature request, create an issue for it.
π License
Apistry includes an open-source core licensed under the Apache License 2.0.
The following capabilities require a paid commercial license:
- Production database adapters (including MongoDB)
- Authoring and registering custom orchestration actions
The built-in NeDB adapter and provided actions are available for local development and evaluation.
See the documentation for details on licensing and feature availability.