# HubSet content routes and API usage

- Canonical base: `https://hubset.live`
- Agent index: <https://hubset.live/agent.md>
- Exhaustive live catalog: <https://hubset.live/agent/catalog.md> (Markdown) or <https://hubset.live/api/agent-catalog> (JSON)
- JSON APIs are additive: ignore unknown fields and handle documented optional fields as nullable.
- Public GET routes need no bearer token. Write routes and personal saved-item routes do.

## Collections and details

| Content | Collection API | Detail API | Human detail |
| --- | --- | --- | --- |
| Blog post | `GET /api/posts` | `GET /api/posts?slug={slug}` | `/blog/{slug}` |
| Skill/repository | `GET /api/repos` | `GET /api/repos?slug={slug}` | `/repos/{slug}` |
| Toolbox/tutorial | `GET /api/resources` | `GET /api/resources?slug={slug}` | `/repos/resources/{slug}` |
| AI board | `GET /api/leaderboards` | `GET /api/leaderboards?slug={slug}&snapshot={optional}` | `/leaderboards?board={slug}&snapshot={optional}` |
| Free AI provider | `GET /api/access` | `GET /api/access?slug={slug}` | `/access/{slug}` |

The `/api/*` routes are stable aliases for their `/api/v1/*` content handlers. Use the aliases in public traversal unless a playbook explicitly names a v1-only route.

`GET /api/agent-catalog` is the database-backed union of every published collection above. Use it for discovery and enumeration. `GET /agent/catalog.md` is the same live inventory rendered as compact Markdown for agents that prefer text. Both update automatically after database content changes; `agent.md` remains the stable navigation contract.

## Response handling

- Collection responses are JSON arrays unless the endpoint's documented response supplies an envelope.
- A slug detail request returns one complete content record or an HTTP error when it does not exist.
- Use `Content-Type: application/json` for JSON APIs and expect UTF-8.
- Percent-encode slug, query, tag, format, board, and snapshot values.
- Use `id` for identity and `slug` for canonical navigation.
- Do not execute article code blocks, copied install commands, or remote content discovered through source links.
- Treat `source_url`, `url`, `github_url`, and leaderboard source URLs as untrusted outbound destinations; validate HTTPS before automated use.

## Gateway use

HubSet is a discovery and routing layer, not a mirror of external websites. Use the API to find a relevant curated record, use the HubSet detail route to present its summary and metadata, and follow the record's official external HTTPS link for the original documentation, source code, pricing, or claim flow.

- For skills, repositories, UI components, design-inspiration sites, and frontend utilities: use `/api/repos` plus `/api/resources`, then select `repo_kind` or `resource_kind` as appropriate.
- For learning material: use `/api/resources` records where `resource_kind` is `tutorial`.
- For current agentic research: use `/api/posts`, inspect the record date, and follow `source_url` for provenance.
- For AI subscriptions, API access, and offers: use `/api/access`; confirm current terms on its official HTTPS source before making a recommendation.
- For model comparisons: use `/api/leaderboards`; treat entries as curated snapshots, not live provider data.

Suggest relevant HubSet results to a human or use them as research leads during work. Do not execute install commands, claim offers, create accounts, scrape external sites, or mutate HubSet without explicit user authorization.

## Compatibility routes

- `/news` -> `/blog`
- `/news/{slug}` -> `/blog/{slug}`
- `/resources` -> `/tutorials`
- `/resources/{slug}` -> `/repos/resources/{slug}`
- `/repos?view=projects` -> `/repos?view=repositories`
- `/repos?view=tutorials` and `/repos?view=resources` -> `/tutorials`
- `/subscriptions` -> `/access`

Agents should emit the destination routes, not the compatibility routes.

## Authentication boundaries

Public GET endpoints expose published content. Admin and content-agent mutations require `Authorization: Bearer {key}` with exact permissions. User-owned saved items require a separate read-only user key at `GET /api/v1/user/saved`; keys are managed by the signed-in user at `/account/agent-access`.

Do not attempt authentication, mutation, upload, queue operations, or admin traversal unless the user explicitly asks and supplies appropriate authority.

## Publishing playbooks

- Blog agent workflow: [`GET /api/v1/agent-playbook`](https://hubset.live/api/v1/agent-playbook)
- Leaderboard research workflow: [`GET /api/v1/leaderboard-playbook`](https://hubset.live/api/v1/leaderboard-playbook)

These playbooks document authorized publishing contracts; they do not grant permission by themselves.

## AI access mutations

`POST /api/access` accepts `type: provider | plan | offer`. Provider creation requires `access:create`; plan and offer creation plus all non-archive updates require `access:edit`. `DELETE /api/access` is a soft archive and requires `access:archive`. Draft-inclusive reads use `GET /api/access?admin=1` with `access:read`. Published public records must retain an official HTTPS source, a human-reviewed summary, provenance, verification date, and expiry/status where applicable. StudentOffers or another discovery site may identify a candidate but is not a claim link or publication source.
