Run Transforms

POST /v1/transforms/run

Run transforms on input file, text, or URL

Request

Headers

An API Key is required to access this endpoint.

NameValue

x-api-key

your_api_key

Body

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

NameTypeDescription

file

File

File used for transforms.

text

string

Text used for transforms.

url

string

URL used for transforms.

model

string

Model used to run transform.

transforms

An array of transform objects.

webhookId

string

Unique ID for the webhook.

Supported models can be found here.

Transform

NameTypeDescription

config

Config options specific to the model.

type

enum

Supported enums:

CATEGORIZE CHAPTERIZE

CUSTOM_PROMPT SUMMARIZE TRANSLATE

name

string (optional)

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

Config

The config varies based on the type of model being used. CHAPTERIZE does not require a config.

CUSTOM_PROMPT

NameTypeDescription

prompt

string

String describing the transform. Does not support template literals.

SUMMARIZE

NameTypeDescription

summaryLength

number

Number indicating summary length: 1 for short, 2 for medium, and 3 for long.

summaryType

enum

Supported enums:

bullets headline paragraph

TRANSLATE

NameTypeDescription

translateFrom

string

Source language for translation. Use two-letter lowercase abbreviation.

translateTo

string

Target language for translation. Use two-letter lowercase abbreviation.

Example

{
  "url": "https://omniai-test.s3.amazonaws.com/e853113c-45c0-4ff1-be49-b0a6013a3498.srt", 
  "transforms": [
    { 
      "name": "chapters",
      "type": "CHAPTERIZE"    
    },
    { 
      "config": {
        "summaryLength": 1,
        "summaryType": "paragraph"
      },
      "name": "summary",
      "type": "SUMMARIZE"    
    }
  ]
}

Response

The API returns the response in JSON format.

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

Example

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

Last updated