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

# API Overview

> nums API reference and setup

Welcome to the nums API. Increment, read, and display counters as JSON, text, or badges.

## Base URL

* Hosted instance: `https://nums.advay.ca/`
* Self-host: `https://<project>.vercel.app`

## Authentication

* Only `/hit` requires your secret. Send as `X-Auth-Token` header or `?token=` query.
* Read endpoints (`/count`, `/count.txt`, `/badge`, `/badge.json`) are public.

## Environment

* `SECRET_TOKEN` — required for write access to `/hit`
* `UPSTASH_REDIS_URL` and `UPSTASH_REDIS_PASSWORD` — recommended for persistence (or set `REDIS_URL`)

## Quick examples

<CodeGroup>
  ```bash Increment theme={null}
  curl -H "X-Auth-Token: $SECRET_TOKEN" "https://nums.advay.ca/hit?id=home"
  ```

  ```bash Read JSON theme={null}
  curl "https://nums.advay.ca/count?id=home"
  ```

  ```bash Read text theme={null}
  curl "https://nums.advay.ca/count.txt?id=home"
  ```
</CodeGroup>

<Tip>
  Use your own deployment for POST /hit tests that require your secret.
</Tip>
