Relay

Relay / Developer documentation

A Swagger UI alternative for local API testing

Relay is an open-source Swagger UI alternative for developers who want a testing workspace beside their FastAPI, Express or Fastify backend. It reads generated OpenAPI operations and mounts at /relay/ on your application's existing localhost port.

Swagger UI remains a strong choice for interactive OpenAPI documentation. Relay is useful when you also want endpoint-level authentication overrides, manual progress statuses and portable request/response reports in your local development workflow.

How the workflows compare

Decision Relay Swagger UI
Starting point Your backend's generated OpenAPI document An OpenAPI document
Primary workflow Local endpoint testing, responses, statuses and reports Interactive API documentation and trying operations
Integration Python or Node package with bundled UI at /relay/ npm packages, Docker or static distributions
Where to use it Loopback development backends Documentation deployments configured for your API
Authorization in Relay Shared and per-endpoint bearer, Basic, header API key and None See Swagger UI configuration for supported security schemes
Sharing in Relay .relay/JSON reports; optional Git or authenticated realtime statuses See Swagger UI deployment and customization options

This comparison describes Relay's supported workflow, not a claim that Swagger UI lacks customization. See the official Swagger UI installation guide and configuration reference for its current capabilities.

Add Relay beside FastAPI's existing docs

You can keep FastAPI's /docs and use Relay at /relay/. There is no need to remove your existing documentation to evaluate it.

python -m pip install relay-backend
from fastapi import FastAPI
from relay_backend import install_relay

app = FastAPI(title="Inventory API")

@app.get("/health", tags=["System"])
def health():
    return {"status": "ok"}

install_relay(app)

Run the application with its usual command and open /relay/ on the same port. In Relay, expand System, select GET /health, and execute the request. The response should show your handler's JSON and HTTP status.

Where Relay helps

When checking user and administrator routes, keep a shared token for common requests and override authentication beside one endpoint. Your backend still enforces permissions. After executing, inspect the actual response and export a report for a teammate. Keep manual implementation status beside the same operation instead of treating an HTTP response as proof that all work is complete.

FastAPI discovers the generated schema natively. Express needs an OpenAPI document or schema provider; Relay cannot infer undocumented types. Fastify can use @fastify/swagger. The Node guide covers both integrations.

When to keep Swagger UI

Keep Swagger UI when your main goal is publishing interactive API documentation or when its existing configuration already meets your team's needs. Relay's local-only boundary makes it unsuitable as a public developer portal. It also does not currently provide multipart uploads or OAuth browser authorization flows.

Common questions

Is Relay free?

Yes. Relay is Apache-2.0 open-source software. Local API testing does not need a Relay account or subscription. Optional team infrastructure has its own setup and hosting responsibilities.

Does it replace my OpenAPI generator?

No. Endpoint definitions remain generated by your backend. Relay consumes the contract; it does not turn undocumented routes into a complete schema.

Is it the GraphQL Relay framework?

No. Install relay-backend from PyPI or npm and use the nibir-ai/relay repository. This Relay is an API testing workspace.

FastAPI integration · Testing and authentication · Free Postman alternative