> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hellonear.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> How the HelloNear backend API is described: the OpenAPI spec, the server, auth, errors and streams. Every route is in the Endpoints tab.

The HelloNear backend API is described by an OpenAPI 3 spec, kept in the repository at [`docs/openapi.json`](https://github.com/Hellonear-AI/hellonear/blob/main/docs/openapi.json) and rendered from it in the **Endpoints** tab of this site, where each route has a playground that can call the hosted API. The prose contract, with every field and event, is [`docs/api-contract.md`](https://github.com/Hellonear-AI/hellonear/blob/main/docs/api-contract.md).

* **Server:** `https://api.hellonear.xyz` (NEAR testnet), or `http://localhost:4000` when you [run it locally](https://docs.hellonear.xyz/run-locally.md).
* **Auth:** every route except health, status and auth needs the session cookie `hn_session`. Get one as a guest with `POST /v1/auth/demo`, or sign in with a NEAR wallet (NEP-413).
* **Errors:** `{ error, ...details }` with an HTTP status. See [Errors](https://docs.hellonear.xyz/errors.md).
* **Streams:** chat, approval and workflow runs answer with server-sent events. See [Streaming events](https://docs.hellonear.xyz/events.md).

A worked example with curl is in the [Quickstart](https://docs.hellonear.xyz/quickstart.md#through-the-api), and every route in a table is in the [API overview](https://docs.hellonear.xyz/api.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.