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

# API Reference

> Base URL, envelope shape, and conventions shared by every v1 endpoint.

## Base URL

```text theme={null}
https://www.try-orbit.com/api/v1
```

There is one environment — production and staging frontends both call this same backend.

## Response envelope

Every successful response:

```json theme={null}
{ "data": { /* ... */ } }
```

List endpoints:

```json theme={null}
{ "data": [ /* ... */ ], "nextCursor": null }
```

Every error:

```json theme={null}
{ "error": { "code": "not_found", "message": "Content not found.", "requestId": "req_..." } }
```

See [Errors](/api-reference/errors) for the full code list.

## Idempotency

Every credit-spending `POST` (currently: `POST /v1/content`, `POST /v1/schedules`) requires an `Idempotency-Key` header — a UUID you generate per logical operation, reused on retries:

```text theme={null}
Idempotency-Key: 3fa85f64-5717-4562-b3fc-2c963f66afa6
```

Omitting it on a route that requires it returns `400 missing_idempotency_key`. Replaying the same key within the dedup window returns the original response verbatim — no re-execution, no second charge.

## Pagination

List endpoints currently return up to 100 rows, newest first, with `nextCursor: null` (cursor pagination beyond 100 rows isn't implemented yet — flagged here rather than implied by the envelope shape alone).

## Rate limits

Every `/v1/*` request is rate-limited per API key: **120 requests/minute** overall, and a tighter **10 requests/minute** specifically on `POST /v1/content` (the one route that spends credits and calls a real model). A blanket per-IP floor (300 requests/minute) also applies before your key is even checked, so a flood of invalid keys never reaches the database.

Exceeding a limit returns `429` with a `Retry-After` header (seconds until the window resets) and:

```json 429 theme={null}
{ "error": { "code": "rate_limited", "message": "Too many requests. Retry after 42s.", "requestId": "req_..." } }
```

<Note>
  There's no `X-RateLimit-Remaining` header yet — only the hard `429` once you hit the ceiling. Your credit balance ([`GET /v1/credits`](/api-reference/credits)) and the account's daily generation ceiling are separate, spend-based limits enforced independently on every credit-spending call.
</Note>
