# API reference (/docs/api)

> Link to the live OpenAPI / Swagger documentation for the ServerMetry API.



ServerMetry publishes a full OpenAPI 3.1 specification. Use the interactive Swagger UI for request/response schemas, or fetch the raw JSON for code generation.

## Live docs [#live-docs]

| Resource     | URL                                                                                  |
| ------------ | ------------------------------------------------------------------------------------ |
| Swagger UI   | [https://api.servermetry.com/docs](https://api.servermetry.com/docs)                 |
| OpenAPI JSON | [https://api.servermetry.com/openapi.json](https://api.servermetry.com/openapi.json) |

Local development (API on port 3601):

* Swagger: `http://localhost:3601/docs`
* Spec: `http://localhost:3601/openapi.json`

## Auth overview [#auth-overview]

* **Session / cookie** — browser dashboard (better-auth)
* **Server agent key** — `sp_live_…` for agent metrics endpoints
* **MCP key** — `sp_mcp_…` Bearer token for the MCP endpoint (see [MCP setup](/docs/mcp))

Exact auth requirements are documented per operation in Swagger.

## Related [#related]

* [Agent install](/docs/agent) — how agents authenticate
* [MCP setup](/docs/mcp) — AI tool access without writing REST clients
* Product docs index: [`/llms.txt`](/llms.txt)
