Skip to main content

GET /api/sites/:slug/openapi.json

Returns an OpenAPI 3.0.3 specification generated from the site’s manifest. The spec includes a path for every discovered view (as a GET operation) and every action and workflow (as POST operations), with full input schemas and response shapes. This endpoint is the primary integration point for AI agents — point your agent at this URL and it can discover and invoke all available operations without any manual wiring.

Path parameters

slug
string
required
The site identifier. For example, example-com for https://example.com. Use GET /api/sites to list all available slugs.

Swagger UI

An interactive Swagger UI for the same spec is available at:
GET /api/sites/:slug/docs
Open this URL in your browser to explore and manually test discovered endpoints.

Example

curl http://127.0.0.1:8787/api/sites/example-com/openapi.json

Using the spec with an AI agent

Most tool-using LLM frameworks can consume an OpenAPI spec directly. Point your agent at the spec URL and it will be able to call discovered operations by name:
# Example: OpenAI with a custom tool loader
import openai, requests

spec = requests.get("http://127.0.0.1:8787/api/sites/example-com/openapi.json").json()

# Pass the spec to your agent framework's OpenAPI tool loader.
# The agent can now call read_product_list, workflow_submit_login, etc.
Each operation’s operationId, summary, input schema, and response schema give the LLM enough context to choose and invoke the right operation without additional prompting.
The servers array in the spec points to http://{host}:{port}, reflecting the --host and --port values the server was started with. If you run BrowserWire on a non-default address, the spec’s server URL updates automatically.

Error responses

StatusBody
404{ "ok": false, "error": "No manifest found for site 'example-com'" }