API reference

Model service

Completions and embeddings from the models set for this project, the names it can use, and its usage.

Scopes for this area: models:read, models:write and models:admin.

4 operations

completion

MethodRouteWhat it doesLevelCommand
POST/models/v1/chat/completionsAsk a model through one of the project's routes. The body and the answer follow the OpenAI chat completions format; `model` is a route name from the model list, never a model's own name. With `stream: true` the answer arrives as server-sent events. Uses the project's token allowance.writerivier models completion create

embedding

MethodRouteWhat it doesLevelCommand
POST/models/v1/embeddingsEmbeddings for one text or a list, in the OpenAI embeddings format. `model` is an embeddings route name from the model list. Say `input_type: "query"` for a search query; texts to be searched are the default.writerivier models embedding create

model

MethodRouteWhat it doesLevelCommand
GET/models/v1/modelsThe route names this project can call, and whether each answers completions or embeddings. Which model stands behind a name is set by Rivier and can change without notice; the name stays.readrivier models model list

usage

MethodRouteWhat it doesLevelCommand
GET/models/v1/usageWhat the project has used of the model service: its token allowances this period, and how far it is into its spending limits for today and this month, as a share.readrivier models usage get