Batteries

Inference

Two models, named for what they are for rather than what they are. Nothing you send is stored; only the token count is.

Every call below goes to the address in your SAASIE_INFERENCE_URL environment variable, with Authorization: Bearer <token>. Read both from the environment — they are injected, and hardcoding either is how an app breaks when the platform moves. See getting the credential.

POST /v1/inference/embed

Embed text as vectors

One string or a batch. Vectors come back in the order they were sent, which is what makes a batch usable — pair them with your own ids by position.

Request body

FieldType
model string Which logical model to use. Only saasie/embed embeds. saasie/fast · saasie/embed, defaults to saasie/embed
input* string | string[] One string or many. Many is not just convenience — a batch is one round trip and one cold start.

200 — One vector per input

FieldType
embeddings* number[][] One vector per input, in the order they were sent.
model* string
dimensions* number Length of each vector. Read it rather than hard-coding it: it changes if the model behind saasie/embed does.
usage* object
remainingToday* number

When it does not work

400Too large a batch, or a generation model
401Missing or invalid service token
403The Saasie is stopped
429The daily embedding cap is spent, or this batch would not fit
502The inference provider failed

POST /v1/inference/generate

Generate text

One prompt or a conversation, one answer. Not streamed: the answer arrives whole, which keeps the daily cap checkable before the work is done rather than after.

Request body

FieldType
model string Which logical model to use. Only saasie/fast generates. saasie/fast · saasie/embed, defaults to saasie/fast
prompt string A single instruction. Shorthand for one user message. length 1–100000
messages object[] A conversation, oldest first. Use instead of prompt. up to 64 items
maxTokens integer Ceiling on the answer's length. Capped by the platform; left out, the platform's default. 1–9007199254740991
temperature number 0–2, defaults to 0.7

200 — The completion and what it cost

FieldType
text* string
model* string The logical model that served it.
finishReason* string length means the answer hit maxTokens and is cut off — ask again with a larger one. stop · length · other
usage* object
remainingToday* number Generation tokens left before the daily cap.

When it does not work

400Neither or both of prompt and messages, or an embedding model
401Missing or invalid service token
403The Saasie is stopped
429The daily token cap is spent, or this request would not fit
502The inference provider failed

GET /v1/inference/models

What this Saasie can call, and what is left today

The names are logical and stable. Which model actually serves one is the platform's to change — that is what makes it possible to improve them without breaking your app.

200 — The catalogue

FieldType
models* object[]

When it does not work

401Missing or invalid service token

Generated from openapi.json, which the service renders from its own routes. * marks a required field. Every error body is { "error": { "code", "message", "details"? } }.