---
title: "OpenAPI spec · Docs"
description: "Get the OpenAPI 3 spec of Donut Browser's local REST API from your app or from donutbrowser.com, generate typed clients, and open it in Swagger UI or Postman."
url: "https://donutbrowser.com/docs/openapi/"
---

# The OpenAPI spec

Every endpoint, field and schema of the local REST API is in an OpenAPI 3 document. There are two copies:

- Your app serves the spec of the version you run at `http://127.0.0.1:10108/openapi.json` (also `/v1/openapi.json`). It needs no token.
- The website publishes the documented endpoints at [`https://donutbrowser.com/openapi.json`](https://donutbrowser.com/openapi.json), so you can generate a client before you install the app.

The spec covers the REST API only. Remote MCP is JSON-RPC, described on the [Remote MCP page](https://donutbrowser.com/docs/remote-mcp).

## Fetch the spec

```bash
curl -sS http://127.0.0.1:10108/openapi.json > openapi.json
```

```javascript
import { writeFile } from "node:fs/promises";

const response = await fetch("http://127.0.0.1:10108/openapi.json");
await writeFile("openapi.json", await response.text());
```

```python
import json, requests

spec = requests.get("http://127.0.0.1:10108/openapi.json", timeout=10).json()
with open("openapi.json", "w") as f:
    json.dump(spec, f, indent=2)
```

```powershell
Invoke-RestMethod -Uri "http://127.0.0.1:10108/openapi.json" |
  ConvertTo-Json -Depth 100 |
  Set-Content -Path "openapi.json"
```

## Generate a client

```bash
# TypeScript types
npx openapi-typescript http://127.0.0.1:10108/openapi.json --output donut-api.d.ts
```

```bash
# Python client
openapi-generator-cli generate -i openapi.json -g python -o ./donut_client
```

```bash
# Go client
go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
oapi-codegen -package donut -o donut/client.go openapi.json
```

```bash
# Rust client
openapi-generator-cli generate -i openapi.json -g rust -o ./donut-client-rs
```

Every `/v1` call still needs the bearer token. See [Authentication](https://donutbrowser.com/docs/authentication).

## Explore it

Open the spec in Swagger UI, then paste your token in the **Authorize** dialog to call your own app:

```bash
docker run -p 8080:8080 \
  -e SWAGGER_JSON=/openapi.json \
  -v "$(pwd)/openapi.json:/openapi.json" \
  swaggerapi/swagger-ui
```

Postman and Insomnia import the same file as a collection.
