OnlyAPI
Get started

Developer docs

Build APIs from any folder.

OnlyAPI scans a project tree and turns usable files into local runtime endpoints. Use this reference to create a workspace, upload a folder, preview auto-generated routes, and call them.

Quickstart

Create a folder-backed API.

  1. Create a project Open the dashboard, click New project, name the API, and create the workspace.
  2. Upload a folder Choose a local folder. OnlyAPI scans the tree, skips hidden files, and previews generated paths before upload.
  3. Copy a runtime URL Use the Endpoints tab to copy a route URL, curl command, fetch call, or project manifest.
  4. Add functions when static data is not enough Use .function.js files for local serverless handlers that receive params, query, headers, and body.

Folder files

Upload a folder; endpoints are inferred.

Drop in the folder you already have. OnlyAPI removes a shared project root, treats an api folder as an optional route anchor when present, and creates routes from the remaining file paths. Files without a method suffix become GET endpoints.

my-store-api/
  custom/
    status.json
  health.json
  items/
    index.json
    [id].json
  orders/
    {orderId}.patch.json
GET /custom/status
GET /health
GET /items
GET /items/:id
PATCH /orders/:orderId

Serverless functions

Run lightweight handlers from your folder.

Add function before the JavaScript extension to make a route executable. OnlyAPI removes that marker when it builds the route, then calls an exported handler or default function at runtime.

api/
  hello.get.function.js
  jobs/
    run.post.function.js
export function handler(event) {
  return {
    statusCode: 200,
    headers: { "content-type": "application/json; charset=utf-8" },
    body: JSON.stringify({
      message: "Hello from OnlyAPI",
      params: event.params,
      query: event.query
    })
  };
}

Routing

File names become endpoint contracts.

File pattern Generated route
api/health.get.json GET /health
api/items/index.get.json GET /items
api/items/[id].get.json GET /items/:id
orders.create.post.json POST /orders.create

Method suffixes are optional. Supported suffixes are get, post, put, patch, delete, head, and options; files without one default to GET. Dynamic segments can use [id] or {id}. Hidden files and folders are skipped during automatic route generation.

Management API

Local project endpoints.

GET /health

Check that the local backend is running.

GET /api/projects

List project summaries sorted by most recently updated.

POST /api/projects

Create a project with name and optional description.

POST /api/projects/:projectId/upload

Upload files and regenerate the route inventory for a project.

GET /api/projects/:projectId

Fetch a full project with files, routes, activity, and usage stats.

Runtime

Call the generated API.

Runtime URLs use the project ID followed by the generated route path. A request to a JSON file returns the parsed data wrapped with OnlyAPI metadata and route params.

curl -X GET "https://onlyapi.wispbyte.app/runtime/api_abc123/items/sample-id"
{
  "onlyapi": {
    "projectId": "api_abc123",
    "routeId": "generated-route-id",
    "params": {
      "id": "sample-id"
    }
  },
  "data": {
    "id": "sample-id",
    "name": "OnlyAPI item"
  }
}

Limits

Local upload guardrails.

250 files per upload
5 MB per file
40 MB request body
1000 routes per project
5 sec function timeout