Resources / Serverless

What is a Wisp endpoint? One URL, one function, live in minutes

A Wisp endpoint is one HTTP route backed by one function. What it receives, what it returns, its settings and limits, and how to call it.

In Wisp, everything your backend does over HTTP is an endpoint: one URL, backed by one function, written in JavaScript or Python. You describe what it should do; Wisp writes the function, deploys it and gives you the URL.

The URL

Every project gets its own subdomain, and each endpoint is a path on it:

https://<project>.fn.wispfn.com/<endpoint>

Anything after the endpoint's name arrives as a subpath, so GET /orders/1042/items reaches the orders endpoint with req.subpath = "/1042/items". With a custom domain it can be https://api.yourcompany.com/orders instead.

The function

An endpoint is a single handler that receives the request and returns a response:

export async function handler(req) {
  const name = req.query.name ?? 'world';
  return { status: 200, body: { message: 'Hello, ' + name + '!' } };
}
def handler(req):
    name = req["query"].get("name", "world")
    return {"status": 200, "body": {"message": f"Hello, {name}!"}}

The request carries the method, path, query, headers, parsed body and caller IP. Return an object or array and it's sent as JSON; return a string for text or HTML; return bytes for files and images.

One method per endpoint

Each endpoint answers one method — GET, POST, PUT, PATCH or DELETE. Reading and creating orders are two endpoints, for example GET /orders and POST /create-order. CORS and preflight requests are handled for you.

Schemas

Each endpoint can declare an input and an output schema (JSON Schema). The assistant writes and maintains them; they document your API and become the tool definitions when your project is used as an MCP server.

Settings

SettingWhat it does
VisibilityPublic, private (API key required) or internal (only other endpoints and tasks can call it)
Edge cachingServe repeat GET responses from the edge without running code
LimitA per-minute and per-day call limit for this endpoint

Limits

Each request can run for up to 15 seconds with 256 MB of memory, and requests and responses can be up to 6 MB. Anything that must persist goes in the project's storage — key-value data, tables or files — not on disk.

Draft and live

Every change creates a new draft version. Add ?test to the URL to call the draft; callers keep getting the published version until you publish. Any version can be rolled back in one click.

Functions, schedules and before/after

Try it

Open wispfn.com, describe an endpoint in a sentence — "a currency converter using a public exchange-rate API" — and you'll have a working URL to call in about a minute. Full reference: Functions in the docs.

Build it with Wisp — describe an API, get it live.

Related