Rivier/ Reference/ models

Models batch create

post/models/v1/batches

Many completions, embeddings or speech requests of one kind, run in the background under the project's limits. The same idempotency key answers the batch it started, so a retry never starts a second one. models.batch.completed reaches the project's webhooks when it ends.

Before you call

Credential
Authorization: Bearer $KEY
Scope
models:write
Graphql
Mutation.modelsBatchCreate
Sdk
models.batch.create
Cli
models batch create
Events
models.batch.completed

Request bodyapplication/json, required

  • kindstringrequired
    One of: chat, embeddings, speech.
  • requestslist of objectrequired
    • idstringrequired
      Your id for the request; the result carries it At most 80 characters.
    • bodyobjectrequired
  • idempotencyKeystringrequired
    The same key answers the batch it started, so a retry never starts a second one At most 200 characters.
  • purposestring or null

Responses

  • 202application/json
    Success
    • idstringrequired
    • objectbatchrequired
    • kindstringrequired
    • statestringrequired
      One of: queued, running, completed, cancelled, failed.
    • idempotencyKeystringrequired
    • countsobjectrequired
      • totalnumberrequired
      • donenumberrequired
      • failednumberrequired
    • costUsdnumberrequired
    • createdAtstringrequired
    • startedAtstring or nullrequired
    • endedAtstring or nullrequired
  • 400application/json
    The request was malformed
    • errorstringrequired
    • messagestring
  • 401application/json
    No valid credential
    • errorstringrequired
    • messagestring
  • 403application/json
    The credential lacks the scope, origin or address
    • errorstringrequired
    • messagestring
  • 429application/json
    Over the key's rate limit; see Retry-After
    • errorstringrequired
    • messagestring

This page as Markdown