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.

Body

At least one request object must be included.

Request

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

Supported models can be found here.

Transform

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