Run Batch Transforms

POST /v1/batches/transforms/run

Run multiple transforms on input file, text, or URL in a single call

Request

Headers

An API Key is required to access this endpoint.

NameValue

x-api-key

your_api_key

Body

At least one request object must be included.

NameTypeDescription

requests

List of requests to include in the batch request.

Request

Either input file, text, or URL is required but not more than one.

NameTypeDescription

text

string

Text used for transforms.

model

string

Model used to run transform.

transforms

An array of transform objects.

webhookId

string (optional)

Unique ID for the webhook.

Supported models can be found here.

Transform

NameTypeDescription

type

enum

Supported enums:

CUSTOM_PROMPT

CATEGORIZE CHAPTERIZE

SUMMARIZE TRANSLATE

name

string (optional)

Unique field name for the transform. Required with multiple transforms.

Example

const url = "https://api.getomni.ai/v1/batches/transforms/run";
const headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
};

const data = {
    "requests": [
        { "model": "gpt-4o", "text": "Lorem ipsum dolor sit amet", type: "SUMMARIZE" },
        { "model": "gpt-4o", "text": "Lorem ipsum dolor sit amet", type: "SUMMARIZE" },
        { "model": "gpt-4o", "text": "Lorem ipsum dolor sit amet", type: "SUMMARIZE" },
    ]
};

fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Response

The API returns the response in JSON format.

The request will return a 200 with a batchId and status. You can use this batchId to check the processing status and fetch results.

Example

{
  "batchId": "e368f726-aa81-435a-8c41-0830b665b4ec",
  "result": "https://api.getomni.ai/v1/batches/transforms/run?batchId=98778b09-0312-4fdc-be5c-d9504261cc66",
  "status": "PENDING"
}

Last updated