API reference
The Spanway gateway publishes an OpenAPI 3 document at /openapi.json and an interactive explorer at / on every running instance. This reference is generated from a snapshot of that document taken from a gateway running with an enterprise license, so it includes the enterprise routes for custom roles, access requests, compliance and billing. The snapshot is bundled with the site as openapi.json, which you can load into any OpenAPI tool or client generator.
Endpoints are grouped by the tag the gateway assigns to them. Each tag page lists its endpoints with a summary, the description from the gateway source, path and query parameters, the request body fields, an example curl request, and the documented responses.
Authentication
Every request except the public and health endpoints needs an Authorization: Bearer <key> header. Use the master key for administrative routes, or a virtual key created with POST /key/generate. The examples read the key from the SPANWAY_API_KEY environment variable. The gateway also accepts the key in the x-spanway-api-key header and, for Anthropic-style clients, in x-api-key. Routes a key cannot reach return 401 or 403 with an error body. Routes open to anonymous callers carry an empty security list in the document, and their examples send no key.
Base URL
All examples assume the gateway listens on http://localhost:4000. OpenAI-compatible routes are served both with and without the /v1 prefix, so /v1/chat/completions and /chat/completions are the same endpoint. If you serve the gateway under a sub-path with SERVER_ROOT_PATH, prepend that path to every route.