# Authentication and limits

> For the complete documentation index, see [llms.txt](https://www.shortsintel.com/llms.txt). Every docs page is also available as markdown: add .md to its URL. To connect, read [agents.md](https://www.shortsintel.com/agents.md).

> Bearer keys, OAuth on the MCP endpoint, who owns what, and the request and concurrency limits a key runs under.

- Sign in: A bearer key on every request, or OAuth 2.1 on the MCP endpoint.
- Requests: 60 per minute per key, free reads included.
- Runs: 10 in flight at once per organization.
- Owner: Every key belongs to an organization and spends its one Balance.

Every call authenticates as one organization. A REST client sends a bearer key. An Assistant connecting over MCP can send a key or sign in through OAuth. Either way the request spends the same organization’s Balance under the same two limits.

## When to use a key or OAuth

| Your client | Use |
| --- | --- |
| A script, server or REST integration | A bearer key |
| An Assistant such as Claude or Cursor, connected over MCP | OAuth, so nobody pastes a secret into a config file |
| An MCP client that cannot do OAuth | A bearer key, which the MCP endpoint also accepts |
| A client that should only read | A read-only bearer key |

## Bearer keys

Create keys in the [console](https://www.shortsintel.com/console/keys). A key is shown once, at creation. We store only a hash of it, so a lost key cannot be recovered and a stolen database cannot be replayed against the API. If you lose one, issue another and revoke the old one. Send it as a bearer token on every request:

```bash
Authorization: Bearer sk_live_YOUR_KEY
```

The console shows the first few characters of each key so you can tell them apart. Revoking a key takes effect on the next request. Issue one key per integration, because revoking is the only way to cut a client off, and it should cut off only that client.

Three settings are chosen when you create a key:

| Setting | What it does | A refused call answers |
| --- | --- | --- |
| Expiry | Optional. After the date, every call is refused. A key without one never expires. | `key_expired` (401) with `expired_at` |
| Scope | Full or read-only, fixed after creation. A read-only key makes every free read and every `estimate=true` quote, and may file feedback. Paid calls and other writes are refused before any Run. | `key_scope_insufficient` (403) with `scope` and `required` |
| Monthly Credit cap | Optional. A call that could take this UTC month's Charges past the cap is refused before any Run. | `key_spend_cap_exceeded` (402) |

OAuth connections are always full and have no cap.

Some calls cannot know their worst case up front, so `x-price.max_credits` is null. Under a cap, such a call is admitted on its quote, and its budget is the smaller of `max_credits` and what the cap has left. An idempotent replay returns its Run unchecked.

Creating or refreshing a Tracker, adding a new target to a Collection and refreshing a Collection analyse new videos and Ads only up to that budget. Past it the Run settles `partial`, charged for what completed, with `result.budget_stopped` naming the limit. A Research refresh and a Focus edit or preview quote their worst case, so a budget never stops them.

## OAuth on the MCP endpoint

The MCP server at `https://www.shortsintel.com/api/mcp` accepts the same bearer keys and also speaks OAuth 2.1. A connection goes like this:

1. The client discovers the authorization server from the endpoint.
2. The user signs in.
3. The user picks the organization the connection acts for.
4. The client gets a short-lived access token. It refreshes the token on its own.

Every request checks the access token and the membership. The organization chosen at consent is read from the database each time, so removing someone from an organization locks their Assistant out immediately, before the token expires.

Three codes are specific to this path:

| Code | Meaning | Fix |
| --- | --- | --- |
| `invalid_token` (401) | The token failed verification. | Refresh the token. |
| `organization_not_selected` (403) | The connection carries no organization to bill. | Authorize again. |
| `organization_access_revoked` (403) | The user has left the organization. | Authorize again. |

The [MCP quickstart](https://www.shortsintel.com/docs/mcp) walks through connecting a client either way.

## Who owns what

A key belongs to an organization, not to a person. The organization owns the Balance, the Runs, the Trackers, the webhook endpoints and the spend log. Every key it issues spends that one Balance, so a staging key stuck in a loop drains the same Credits as production.

Everything is scoped to that owner and nothing crosses between owners. Asking for another organization’s Run answers `not_found` (404) instead of a forbidden, so you cannot learn that something exists unless it is yours.

`GET /v1/runs` · Free.

curl:

```bash
curl "https://www.shortsintel.com/v1/runs?limit=25&status=running" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
```

TypeScript:

```typescript
const response = await fetch(
  "https://www.shortsintel.com/v1/runs?limit=25&status=running",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer sk_live_YOUR_KEY",
    },
  },
);

if (!response.ok) {
  throw new Error(`ShortsIntel ${response.status}`);
}

const data = await response.json();
```

Python:

```python
import requests

response = requests.get(
    "https://www.shortsintel.com/v1/runs?limit=25&status=running",
    headers={
        "Authorization": "Bearer sk_live_YOUR_KEY",
    },
)
response.raise_for_status()

data = response.json()
```

`GET /v1/runs` · Free. Lists only your own Runs.

## The two limits

| Limit | Counted per | Over it |
| --- | --- | --- |
| 60 requests per minute | Key, or user for an OAuth connection | `rate_limit_exceeded` |
| 10 Runs in flight | Organization | `concurrency_limit_exceeded` |

The request limit counts per user over OAuth because tokens rotate and a client can hold several. Free reads count toward it, so a tight polling loop is throttled even though it is never charged. Over the limit you get `429` with `rate_limit_exceeded`:

429 · `rate_limit_exceeded` or `concurrency_limit_exceeded`, with `Retry-After`.

```json
{
  "type": "https://www.shortsintel.com/docs/reference/errors/rate_limit_exceeded",
  "title": "Rate limit exceeded",
  "status": 429,
  "code": "rate_limit_exceeded",
  "detail": "60 requests per minute per key. Retry after the number of seconds in `Retry-After`.",
  "retryable": true,
  "action": "Wait `retry_after_seconds`, then retry the same request.",
  "limit": 60,
  "retry_after_seconds": 12,
  "resets_at": "2026-09-08T09:15:00.000Z"
}
```

You can pace yourself before the `429`. Every response that counted toward the limit, the `429` included, carries the IETF draft rate-limit headers:

```text
RateLimit-Policy: 60;w=60
RateLimit: limit=60, remaining=42, reset=17
```

`remaining` is how many requests are left in the window, and `reset` is the seconds until the window resets. One MCP tool call counts once, however many routes it calls.

A `401` carries neither header, because it is refused before the limit is checked. Neither does a response served while the limiter is briefly unavailable. Treat a missing header as unknown, never as unlimited.

The Run limit counts only Runs still running. Finished Runs never count. It is the limit that protects a Balance from a looping agent. The request limit caps how fast calls arrive, and the Run limit caps how much paid work runs at the same time.

Both limits answer 429 with `Retry-After`. On `rate_limit_exceeded`, slow down: sleep the seconds given and spread your calls out. On `concurrency_limit_exceeded`, do not slow down: wait for one of your own Runs to finish, because only that frees a slot. Then retry the same request. Nothing was charged and no Run was created.

Adding keys adds request headroom but no Run headroom, since the Run limit is per organization. If a limit is too tight for what you are building, [contact us](https://www.shortsintel.com/contact). The [errors guide](https://www.shortsintel.com/docs/concepts/errors) lists every other code.

## Example: check that a key works

Read your Balance. It is free, so it is the cheapest way to test a new key:

`GET /v1/account/balance` · Free.

curl:

```bash
curl "https://www.shortsintel.com/v1/account/balance" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"
```

TypeScript:

```typescript
const response = await fetch(
  "https://www.shortsintel.com/v1/account/balance",
  {
    method: "GET",
    headers: {
      "Authorization": "Bearer sk_live_YOUR_KEY",
    },
  },
);

if (!response.ok) {
  throw new Error(`ShortsIntel ${response.status}`);
}

const data = await response.json();
```

Python:

```python
import requests

response = requests.get(
    "https://www.shortsintel.com/v1/account/balance",
    headers={
        "Authorization": "Bearer sk_live_YOUR_KEY",
    },
)
response.raise_for_status()

data = response.json()
```

`GET /v1/account/balance` · Free.

## Questions about authentication and limits

### Can I recover a lost key?

No. Only a hash of each key is stored. Issue a new key in the console and revoke the lost one.

### Do more keys give me more Runs at once?

No. The 10-Run limit is per organization. Each key gets its own 60 requests per minute.

### What should I do after a 429?

Read the code. On `rate_limit_exceeded`, wait the `Retry-After` seconds and slow down. On `concurrency_limit_exceeded`, wait for a Run to finish. Then retry. Nothing was charged.
