v9

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01211389.1 KB

Batch completions

Queue multiple LLM conversations for later retrieval.

post/ai/batches

Request body

promptsstring[] required

The questions or instructions to use as chat prompts.

model'chatgpt' | 'gemini' | 'perplexity'

The AI model to chat with.

devicestring

The name as returned by the devices resource of the device to emulate chatting on (these names are case insensitive but must include form- or URL-encoded spaces and punctuation marks); device emulation is unused by default.

countrystring

The two-letter ISO code of the country to chat from (these codes are case insensitive); a random country is used by default.

subdivisionstring

The alphanumeric second part (proceeding the separator) of a first-level subdivision code in the (prerequisite) country to chat from (these codes are case insensitive); a random subdivision is used by default.

citystring

The commonly spelled name of the city in the (prerequisite) country to chat from (these names are temporarily case sensitive and required to include form- or URL-encoded spaces and punctuation marks); a random city is used by default.

languagestring

[Planned] The commonly spelled name or two-letter ISO code of the language to chat in (these names and codes are case insensitive but required to include form- or URL-encoded spaces and punctuation marks); the language is unset by default.

displaystring

[Planned] The commonly spelled name or two-letter ISO code of the chat interface’s display language (these names and codes are case insensitive but required to include form- or URL-encoded spaces and punctuation marks); the display language is unset by default or set to the language if given.

format'json' | 'rendered' | 'raw (planned)'

The format to output to.

expirationinteger

The age in days of when to consider a cached completion expired, where 0 disables caching.

callbackstring

The HTTP or HTTPS callback URL or Amazon SQS queue URL or ARN to notify when the batch completions have been retrieved; any SQS queue must grant sqs:SendMessage permission to the arn:aws:iam::180363035301:role/api-instance AWS principal.

Example request

{
  "prompts": [
    "Where can I buy a vintage guitar?",
    "Help me find guitar repair shops nearby.",
    "Do any local stores sell vinyl records?",
    "[Additional prompts here]"
  ],
  "model": "gemini",
  "format": "rendered",
  "callback": "https://webhook.site/02e249f8-1faf-4fab-bcf5-78ce683e85a8"
}

Response

A job identifier and confirmation count.

idstring uuid required

The identifier to retrieve the batch conversations with.

countinteger required

The number of prompts in the batch as confirmed by the API.

Example response

{
  "id": "a0482596-c2ad-445a-a435-727002156a20",
  "count": 37
}