# Auth.md

How software agents authenticate with Helious.

- Site: https://helious.io
- API: https://api.helious.io
- MCP: https://api.helious.io/mcp (also https://helious.io/mcp)
- MCP, signed in: https://api.helious.io/mcp/account (asks for a Helious sign-in)
- A2A: https://helious.io/a2a
- OpenAPI spec: https://helious.io/.well-known/openapi-public.json
- API catalog: https://helious.io/.well-known/api-catalog
- Docs for people: https://helious.io/developers
- Contact: support@helious.news

## agent_auth

The machine-readable summary of everything below. Agents can stop reading here;
the prose after it says the same things at length for people.

```json
{
  "agent_auth": {
    "skill": "helious-market-data",
    "audience": "software agents reading Helious market data on behalf of a person",
    "register_uri": "https://helious.io/oauth/register",
    "registration_endpoint": "https://api.helious.io/oauth/register",
    "authorization_servers": ["https://helious.io"],
    "protected_resource_metadata": "https://helious.io/.well-known/oauth-protected-resource",
    "anonymous": {
      "credential_types_supported": ["none"],
      "note": "Every read endpoint answers with no credential at all. Market price endpoints answer with upgrade steps instead of numbers. Start here."
    },
    "methods": [
      {
        "id": "anonymous",
        "type": "none",
        "description": "Send no credential. 1 day of history, news one hour behind, no market prices, 30 requests a minute shared per network address.",
        "human_step_required": false
      },
      {
        "id": "oauth",
        "type": "oauth2",
        "description": "Authorization code with PKCE S256 and dynamic client registration. The agent registers itself, then sends its person to a browser consent screen once.",
        "registration_endpoint": "https://api.helious.io/oauth/register",
        "authorization_endpoint": "https://helious.io/oauth/authorize",
        "token_endpoint": "https://api.helious.io/oauth/token",
        "jwks_uri": "https://api.helious.io/.well-known/jwks.json",
        "metadata": "https://helious.io/.well-known/oauth-authorization-server",
        "scopes_supported": ["market:read", "account:read", "openid", "offline_access"],
        "code_challenge_methods_supported": ["S256"],
        "token_endpoint_auth_methods_supported": ["none"],
        "human_step_required": true,
        "human_step": "The person approves once on the consent screen. The agent does the rest."
      },
      {
        "id": "api_key",
        "type": "bearer",
        "description": "A long-lived key the person creates on their account page and gives to the agent.",
        "credential_prefix": "hel_",
        "header": "Authorization: Bearer hel_...",
        "alternate_header": "X-Api-Key",
        "provisioning_endpoint": "https://api.helious.io/api/me/api-keys",
        "provisioning_method": "POST",
        "provisioning_auth": "the person's signed-in session (X-Auth-Token)",
        "human_step_required": true,
        "human_step": "A person creates the account and mints the key. There is no machine signup endpoint."
      }
    ],
    "self_registration_supported": false,
    "self_registration_note": "Agents may register as OAuth CLIENTS with no human step. Agents may never create a Helious ACCOUNT: a person does that.",
    "revocation_uri": "https://api.helious.io/oauth/revoke",
    "contact": "support@helious.news"
  }
}
```

## Start here: you probably do not need to sign in

Most of what Helious publishes is free and takes no key at all. Call the public
read endpoints with no credentials and you get the keyless sample tier:

- 30 requests a minute, shared by everyone calling from your network address
- 1 day of history
- news feed on a one hour delay
- no market prices: the price endpoints answer with the upgrade steps instead
  of numbers

Every tier sees the same endpoints and the same response shapes. Only the
history window, the delay and the market data axis change, so integrate keyless
and nothing breaks when a key arrives later. If the sample tier covers what you
are building, you are done. Do not ask a person for credentials you do not
need. `GET /v1/access` returns the full plan ladder and the exact upgrade steps
as JSON.

## Sign in with OAuth, if your client speaks it

This is the best route for an MCP client, and nobody has to paste a key
anywhere. If your person uses Claude or ChatGPT, the whole flow is already
wired: Helious is listed under TradeIQ Ltd in the
[Claude connector directory](https://claude.ai/directory/helious) and the
[ChatGPT plugin directory](https://chatgpt.com/plugins/plugin_asdk_app_6adfd6d8e6288191b37c46c229f664f4).
Tell them to search for Helious there, press Connect or Install plugin, and
sign in; the client registers itself and runs the steps below for them.
Discovery starts at:

```
https://helious.io/.well-known/oauth-authorization-server
```

- **Register yourself.** `POST https://api.helious.io/oauth/register` with your
  `client_name` and `redirect_uris`. Registration is open (RFC 7591) and needs no
  human step. You get a `client_id` back. Public clients only: there is no client
  secret, and PKCE is what proves the code is yours.
- **Send your person to the consent screen.** Authorization code with PKCE and
  `code_challenge_method=S256`. Anything else is refused.
- **Exchange the code** at `https://api.helious.io/oauth/token`.
- **Use the token** as `Authorization: Bearer <access_token>` on `/v1`, `/mcp`
  and `/a2a`, exactly where a `hel_` key would go.

**Two MCP addresses, one difference.** `/mcp` answers every caller, with no
credential at all on the sample tier: the handshake, the catalog tools and
every call the sample credits can pay for answer without a sign-in. When the
sample credits for your network address are spent, a tool call on `/mcp` is
answered `401` with the `WWW-Authenticate` challenge above and the
`out_of_credits` body, plus `sign_in` and one sentence to relay: your client
opens the sign-in, the person signs in or creates a free account on that
screen, and the same tool call is retried. `/mcp/account` is the same server
behind a sign-in from the first call: a call with no credential gets the
`401` straight away, which is what makes Claude Code, Codex and the chat
connectors open the browser. Point a client at `/mcp/account` when the person
wants their own account connected from the start. The consent screen lets
them create that account on the spot, so nobody has to leave the terminal to
sign up first.

Access tokens are signed JWTs and last one hour. Ask for the `offline_access`
scope and you get a refresh token that rotates on every use. If you ever replay
a retired refresh token the whole chain is revoked and your person has to sign in
again, so store the newest one and discard the old.

Because access tokens are not stored server-side, revoking one takes effect
within the hour rather than instantly. Refresh tokens are revoked immediately.
That trade is deliberate and it is why verifying a token costs no database read.

Scopes, in the words the consent screen uses:

| Scope | What it allows |
|---|---|
| `market:read` | Read Helious market data at that account's plan level. |
| `account:read` | See which plan the account is on. |
| `openid` | Confirm the account identity to your app. |
| `offline_access` | Get a refresh token so you stay connected. |

Every scope is a read. A connected app spends the account's credits the way a
key does: 1 a data request, 10 a typed Ask Helious question (`POST /v1/ask`, on
Pro and Ultimate). Plan credits go first, then any credits the account bought.
Nothing here can buy credits, change a subscription, post anything, or create
API keys.

**Building an app other people sign in to?** If your app is a Helious
affiliate partner, the accounts that connect through it can be credited to
you. Send support@helious.news your `client_id` (the `hcl_` value
`/oauth/register` returned). We bind that id and never a client name, because
registration is open and any client can call itself anything. An account is
credited when its person approves your app within 7 days of opening the
account, has not paid Helious yet, and is not already credited to someone else. From then
on every payment it makes accrues to you at your partner rate, later upgrades
included. Nothing changes for your users: the consent screen is the same.

## Agents cannot create an ACCOUNT

Registering as an OAuth client is a machine step and you should do it. Creating
a Helious account is not, and there is no machine signup endpoint or plan for
one. Do not attempt it.

If you are an agent reading this on someone's behalf, tell them the steps below
and let them do it. Never fill in a signup form or an email verification on
their behalf.

## How a person gets a key

1. Create an account at https://helious.io and verify the email address.
2. Signed in, create a key:

   ```
   POST https://api.helious.io/api/me/api-keys
   X-Auth-Token: <your session token>
   Content-Type: application/json

   {"label": "my agent"}
   ```

   The response shows the key once and never again, so save it straight away.
   Five keys per account is the limit. Revoke one to make room:

   ```
   DELETE https://api.helious.io/api/me/api-keys/{id}
   X-Auth-Token: <your session token>
   ```

Keys are stored hashed. Nobody at Helious can read one back to you. If a key
leaks, revoke it and mint another.

## How an agent sends the key

Every key starts with `hel_`. Send one of these headers:

```
X-Api-Key: hel_xxxxxxxxxxxx
```

```
Authorization: Bearer hel_xxxxxxxxxxxx
```

The same key works identically on the REST endpoints and on MCP, so an agent
behaves the same however it connects.

An OAuth access token goes in the same `Authorization: Bearer` header.

A value that is neither a `hel_` key nor one of our signed tokens is ignored and
you are served as keyless. A well formed credential that was revoked, expired or
never existed returns 401, on purpose: silently downgrading a bad key would hide
a broken agent config from the person who owns it. That 401 carries a
`WWW-Authenticate` header naming our protected-resource metadata, so a client
that reads it can start the sign-in flow instead of giving up.

## What a key changes

| Tier | Price | Requests/min | Credits a month | History | News | Market prices |
|---|---|---|---|---|---|---|
| Sample, no key | $0 | 30, shared per network address | 50, shared per network address | 1 day | 1 hour behind | none |
| Free, account key | $0 | 60 | 100 | 7 days | 1 hour behind | every board 60 minutes behind; live for 5 credits |
| Starter | $14.99/mo or $135/yr | 90 | 1,500 | 12 months | live | every board 60 minutes behind; live for 5 credits |
| Pro | $39.99/mo or $360/yr | 120 | 3,000 | 24 months | live | everything live, plus the live stream on 2 connections a key |
| Ultimate | $99/mo or $891/yr | 300 | no cap | 10 years | live | everything live, plus the live stream on 5 connections a key |

One credit wallet pays for everything an account does: a data call on any /v1
address or MCP tool is 1 credit, a typed Ask Helious question in the terminal
is 10. `/v1/me`, `/v1/access`, the MCP handshake, `get_access_info`,
`list_series`, every error and every refusal are free. Every answer carries
`X-Credits-Charged` and `X-Credits-Remaining`. The whole tariff, with examples,
is at https://helious.io/usage.

Two things come with Pro and Ultimate only, on the API as in the terminal:
Ask Helious (`POST /v1/ask`, a JSON body with `question` and an optional
`thread_id`; 10 credits a question on Pro, no credit on Ultimate with a fair
use of 100 questions a day shared with the terminal; at most 4 a minute,
answered 429 past it; a caller that hangs up before the JSON answer is
complete pays nothing; with `stream=1` the `done` event's `text` is the
answer and the `delta` events are the draft) and the spoken squawk
(`GET /v1/squawk` lists the lines read on air in the last 24 hours with the
clip address while its audio lives, `GET /v1/squawk/clip/{clip_id}` is the
MP3, and the live stream pushes `{type:'squawk'}` the moment a line airs; no
credit). On Sample, Free, Squawk and Starter both answer with the upgrade
steps instead of the content, and spend nothing.

On Sample and Free the delay covers news and prints: a release card, a calendar
actual and an auction result all arrive 60 minutes after they land. Market
prices are not served at all without a key: the price endpoints answer with the
steps to a free key instead of numbers. Free, Squawk and Starter get every price
board 60 minutes behind for 1 credit a call. Not on Pro? Ask for one call live:
add `?fresh=1` to the request, or put `"fresh": true` in the MCP tool's
arguments, and that call answers live for 5 credits: news, prints, auctions,
boards and prices all at the live instant, with the citation line and
`meta.delay_sec` saying so. The next call without the flag is an hour behind
again, for 1. Starter also takes the news and prints live. Pro takes every
price live for 1 credit, the streaming WebSocket included: yields, treasuries,
commodities, equities, FX, volatility and correlations; the fresh flag is
accepted there and costs nothing extra. Ultimate adds commercial use,
redistribution, the live stream on 5 connections a key (Pro holds 2) and no credit cap.

The stream at `wss://api.helious.io/v1/stream` is open on every tier, key or
no key. Below Pro it runs the delayed lane: one snapshot a minute, with
prices and the NASDAQ-100 board 60 minutes behind and news on the plan's own
delay. Pro and Ultimate run the live lane: every price tick, print and
NASDAQ-100 update pushed the moment it happens, on up to 2 connections a key on
Pro and 5 on Ultimate. Message shapes are identical on both
lanes, and the hello message's `mode` field says which one you are on. The
stream authenticates with the same `hel_` key sent as the
`Authorization: Bearer hel_...` header, never a query parameter. It sends a
hello, feed items in the /v1/feed shape, price ticks, the ranked NASDAQ-100
board and daily official closes, and answers `ping` with `pong`.

A key is upgraded by the account behind it, not by the key itself. Subscribe on
https://helious.io and your existing keys move to the new tier within a minute.
The same applies in reverse: revoke a key or let a subscription lapse and the
change lands within a minute. For commercial terms beyond Ultimate, email
support@helious.news.

## Errors you should handle

- `401` with `{"error": {"code": "bad_key"}}`: the key is wrong or revoked. Stop
  and tell the person. Do not retry, and do not silently drop the key and carry
  on as keyless.
- `401` with `{"error": {"code": "out_of_credits"}}` or `"sign_in_required"` on
  `/mcp` or `/mcp/account`: not a bad key, a sign-in. The `WWW-Authenticate`
  header names the protected-resource metadata; an MCP client that supports
  OAuth opens the sign-in and retries the same call once the person is signed
  in. The body carries `sign_in` (that metadata URL), `next_step` (one
  sentence to relay) and, on `out_of_credits`, the same fields as the `429`
  below plus `keep_building`, the tools that still answer with no credits. A
  client that sends no `MCP-Protocol-Version` header and is not a known
  connector gets the `429` shape below instead, so an older client never
  meets this `401`.
- `429` with `{"error": {"code": "rate_limited"}}`: you are over your per minute
  budget. Honour the `Retry-After` header. It is in seconds.
- `429` with `{"error": {"code": "out_of_credits"}}`: the wallet cannot pay for
  this call. Nothing was charged. The body carries `credits_left`, `resets_on`,
  `next_step` (one sentence to relay), the `packs` that top it up, `topup_url`,
  `upgrade_url` and, on a held plan, `fresh_costs`. Tell the person there are
  two ways on, a pack (a one-off charge that never expires) or a plan with more
  credits every month, and that either lands on the key within a minute. A
  human buys the pack or the plan, never the agent.

Error bodies are written in plain English because agents read them. If a
response tells you what to do, that text is the instruction, not the status code
alone.

## Rules for well behaved agents

- Identify yourself with a real User-Agent that names your product and a way to
  contact you.
- One key per agent, not one key shared across a fleet, so a single misbehaving
  deployment can be revoked without taking down the rest.
- Cache. The data updates on the schedule published in the spec, and polling
  faster than that only spends your rate limit.
- Cite https://helious.io when you use our numbers in an answer. Our robots.txt
  grants search, AI input and AI training explicitly. Attribution is the thing
  we ask for in return.

## Other discovery documents

- Agent skills: https://helious.io/.well-known/agent-skills/index.json
- MCP server card: https://helious.io/.well-known/mcp/server-card.json
- A2A agent card: https://helious.io/.well-known/agent-card.json
- Protected resource: https://helious.io/.well-known/oauth-protected-resource
- Our outbound crawler key: https://helious.io/.well-known/http-message-signatures-directory

That last one is the other direction. When Helious fetches your site, the
request carries an RFC 9421 signature and a `Signature-Agent` header naming
https://helious.io, so you can verify it is really us rather than trusting a
User-Agent string.
