API Reference
API Reference
Base URL, request conventions, and the endpoints Stac exposes.
The API is HTTP + JSON over TLS (multipart for the endpoints that accept a file upload). Every endpoint lives under one base URL and takes the same bearer token.
POST
https://api.trystac.com/v1Conventions
- Content type.
application/json, except/v1/documents/extract,/v1/images/extract, and/v1/documents/generate's direct mode input, which aremultipart/form-data. - The
modelfield is always ignored. Your stack has exactly one model assigned; any value you send is replaced with it. See Core concepts. - Unknown fields. Ignored on input, so a newer SDK stays compatible with an older API version.
- Errors. A non-2xx status with a
{ "detail": "..." }body — see Errors.
Endpoints
| Endpoint | Description | |
|---|---|---|
| POST | /chat/completions | OpenAI-compatible chat, including image input and tool calling |
| POST | /messages | Anthropic-compatible chat, same underlying model |
| GET | /models | The model your stack accepts |
| POST | /documents/extract, /images/extract | PDF or image in, schema-validated JSON out |
| POST | /documents/generate | HTML in (yours, or model-generated from an instruction), PDF out |
Note
/v1/completions, /v1/embeddings, and /v1/responses (OpenAI-compatible)
and /v1/messages/count_tokens (Anthropic-compatible) also work, for SDKs
and tools that expect them, but chat completions and messages cover nearly
every use case — start there.
Versioning
The /v1 prefix is the contract. Additive changes — new fields, new
endpoints, new enum values — ship without a version bump, so clients must
tolerate fields they don't recognize. Breaking changes get a new prefix and a
migration window announced in the changelog.

