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.

Create a mock 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.


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.

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.Start the server
Click Start Server in the dashboard header. The first start uses port 4000 unless you set another port in Advanced settings. Call the mock athttp://localhost:<port> plus the operation path. Change the port later from Mock Server Settings (gear icon).
Response Editor
Each mock response opens in an editor with two side-by-side sections:- Left: rules, demo request, response URL, Try button, and Open as New Request button (when to return this response)
- Right: 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.
Left section: rules and demo request
Use this side to decide when this response is returned. After you start the server, each mock API is available athttp://localhost:4000 plus the operation path, unless you changed the port in Advanced settings. Change the port later from Mock Server Settings (gear icon).
Rules
To add matching logic, click Add rule or the Edit icon (top-right of the response). The Rules and Demo Request sections 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.

Right section: expected body and headers
Use this side to define 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. Only those values appear — the tab does not invent extra fields.
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 with Response Examples - 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.