| Layer | What it is | Auth |
|---|---|---|
/api/v1 | The REST surface, base https://app.contenthero.ai/api/v1 | API key, bearer token |
@contenthero/sdk | A typed TypeScript kernel over /api/v1 | API key |
@contenthero/mcp / hosted MCP | The same surface as agent tools | OAuth or key |
@contenthero/cli | The same surface as shell commands | contenthero login or key |
TypeScript SDK
Conventions
- Async: generation endpoints smart-wait, then return an
outputIdto poll. Use the wait helpers orget_generation_status. - Chaining: references accept a raw URL or an output-id token
<uuid>-<N>. - Cost preflight: every generate call has a cost-only mode that charges nothing.
- Scopes: keys are scope-gated; a
403names the missing scope. - Rate limits: per-key, returning
429when exceeded.
A full per-endpoint reference is in progress. For now, the SDK types are the authoritative contract for request and response shapes, and
contenthero schema dumps every command’s input schema from the CLI.