Referência da API

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.

POSThttps://api.trystac.com/v1

Conventions

  • Content type. application/json, except /v1/documents/extract, /v1/images/extract, and /v1/documents/generate's direct mode input, which are multipart/form-data.
  • The model field 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

EndpointDescription
POST/chat/completionsOpenAI-compatible chat, including image input and tool calling
POST/messagesAnthropic-compatible chat, same underlying model
GET/modelsThe model your stack accepts
POST/documents/extract, /images/extractPDF or image in, schema-validated JSON out
POST/documents/generateHTML in (yours, or model-generated from an instruction), PDF out

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.