1. Open an OpenAPI spec
Bruno can view and work with existing OAS files. Full steps, including screenshots, are in Viewing Existing OAS Files.- Open Preferences → Features and enable API Spec.
- An API Spec section appears in the Bruno sidebar.
- Click + in that section, choose Open API Spec, and pick a
.yamlor.jsonfile from disk. - The spec appears in the sidebar. Click it to open the viewer.

2. Create a Mock Server from the spec
- Enable Mock Servers under Preferences → Beta if they are not already on.
- Click the + icon next to Mock Servers in the sidebar.
- Enter a name. Set the source to API Spec and select the spec you want to generate from.
- Optionally open Advanced settings to set the port and response delay (ms).
- Click Create.


3. Generate from API Spec
On the Responses tab you get two entry points:- New Mock Response - a blank mock you fill in yourself.
- Generate from API Spec - one mock response per operation and status in the spec. Bodies come from examples in the spec when present, otherwise from the schema where Bruno can derive them.

4. Sync with Spec
If the OpenAPI file changes, use Sync with Spec. Bruno re-imports the spec and updates responses that still match an operation (method and path). Custom responses you added or changed stay in place. Use this after you add endpoints, rename paths, or update example payloads in the spec.5. Start the server
Start the server from the dashboard header. Bruno starts with port 4000 and increments to find a new available port for each new mock server. You can also change it in the Advanced settings upon creation or via the gear icon. After the server is running, each mock API is available athttp://localhost:4000 or its chosen port.
6. Response Editor
Each mock response opens in an editor with two side-by-side sections:- Left pane: rules, demo request, response URL, Try button, and Open as New Request button (when to return this response)
- Right pane: expected body, headers, and try results (what the response should look like)

200 and 400, for example), open each response and add rules so the mock can choose among them.
Rules and demo request
Use this side to decide when this response is returned.Rules
To add matching logic, click Add rule or the Edit icon (top-right of the response). The Rules and Demo Request tabs appear. See Rules on the dashboard guide for field-level detail. You can match on body, headers, and query parameters so the same path can return different payloads (admin vs guest, missing field vs valid body, and so on). Match controls how those conditions combine:
After you add or change rules, click Save in the top-right of the editor. Rules are not applied until you save.

Expected body and headers
Use this side to see what the mock returns: the Expected body and Headers, plus the status code. The body can be JSON, HTML, text, or XML. Headers are independent of body type — setContent-Type and any other headers the client should see.
Try Result shows the response body and headers from Expected and Headers after you click Try (with the server running).
7. Inspect traffic
After the server is running:- Routes - registered method and path combinations from the spec (and any extra responses you added), plus hit counts.
- Request Log - each incoming request, the selected mock (or No Match), and the Match Trace Inspector when a rule did not behave as expected.
Next steps
- Mock Servers from Collection - same dashboard, sourced from collection examples instead of a spec.
- Create a mock server - collection, spec, and standalone sources.
- Run a mock server - dashboard, rules, routes, and request log.