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, /v1/images/edits, and /v1/documents/generate's direct mode input, which are multipart/form-data.
  • The model field is ignored. Your stack has exactly one model assigned; any value you send is replaced with it. See Core concepts. The one exception is /v1/images/edits, where the field is passed through as sent.
  • 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. The image routes also return a second shape, with a machine-readable code.

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/images/generations, /images/editsA prompt in, an image out — or edit existing images by reference
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.