The API
BuiltThe API is the only way in. The console, the CLI, the MCP server and your own scripts all call the same HTTP routes, so each passes the same permission and scope checks, and anything one can do another can.
One source of truth
Section titled “One source of truth”The routes are Go structs (Huma). From them make gen writes an OpenAPI 3.1 document, and from that
document the typed console client, the CLI commands, the MCP tools and the YAML JSONSchema. So there
is no hand-kept list of routes to drift from the code: the API reference is the
rendered document, and a new route shows up in every client on the next generation.
Calling it
Section titled “Calling it”Send a bearer token in the Authorization header. Mint your own with the console’s Create token
action or omniglass auth create-token; the CLI page covers the first
owner, and agent tokens are a narrower kind for
software acting on your behalf.
curl -H "Authorization: Bearer $OMNIGLASS_TOKEN" https://omniglass.example.com/api/v1/locationsEvery route is gated by a <resource>:<action> permission, and every query a route runs is narrowed to
the scope your grants reach, so a token sees exactly what its user does.
The shape of the contract
Section titled “The shape of the contract”- Resources and
:verbmethods. Routes are AIP-style: a collection (/locations), an item by name or id, and a custom method after a colon for an action that is not a plain update. - Batch creates.
POST /locations:batchCreate,/systems:batchCreateand/components:batchCreateeach take a list of up to 1000 of the single create’s own bodies underrequests, run in order in one transaction, every row or none.validate_only: trueruns the same transaction and rolls it back, answering 200 with what a write would create; a write answers 201 with abatch_idevery audit row it wrote carries asfrom_batch. A refused row is answered as its single create answers it, led byrequests[3]:. See creating in batches. - Names address. A resource you type the name of answers to it; the id it returns survives a rename.
- Lists filter, order and page by cursor.
- Errors are one
problem+jsonenvelope, with the field a 422 refused named. - Writes are audited, and long-running work returns an action you read back rather than holding the request open.
The full contract, with the reasoning behind each choice, is on the API architecture page.
Where to go next
Section titled “Where to go next”- The CLI for scripting without writing HTTP.
- Agents and MCP to put an AI agent on the same API.
- Contributing to change the API itself: a route starts as a test and a Huma
struct, and
make gendoes the rest.