Create Task

This API is used to create a task for various purposes, such as generating audio content based on the specified parameters and input data.

API Endpoint

POST https://api.genaifactory.ai/v1/create_task

Headers

Name
Type
Required
Description

formalcloud-api-key

string

Yes

API key for authentication

Content-Type

string

Yes

Must be set to application/json

Request Body

Name
Type
Required
Description

task_type

string

Yes

Specifies the type of task to create:

  • TTS

params

object

Yes

Parameters specifying task details.

input_data

array of objects

Yes

Input data for the task.

Parameters (params)

Name
Type
Required
Description

reporter_voice

string

Yes

The reporter's voice model:

  • AMERICAN_MALE_1

  • AMERICAN_MALE_2

  • AMERICAN_MALE_3

  • AMERICAN_FEMALE_1

  • AMERICAN_FEMALE_2

  • AMERICAN_FEMALE_3

  • BRITISH_MALE_1

  • BRITISH_MALE_2

  • BRITISH_MALE_3

  • BRITISH_FEMALE_1

  • BRITISH_FEMALE_2

  • BRITISH_FEMALE_3

  • AUSTRALIAN_MALE_1

  • AUSTRALIAN_MALE_2

  • AUSTRALIAN_MALE_3

  • AUSTRALIAN_FEMALE_1

  • AUSTRALIAN_FEMALE_2

  • AUSTRALIAN_FEMALE_3

  • CANADIAN_MALE_1

  • CANADIAN_MALE_2

  • CANADIAN_MALE_3

  • CANADIAN_FEMALE_1

  • CANADIAN_FEMALE_2

  • CANADIAN_FEMALE_3

Input Data (input_data)

Name
Type
Required
Description

type

string

Yes

The type of input (e.g., text).

text

object

Yes

Contains the content to be processed.

Text Object

Name
Type
Required
Description

content

string

Yes

The text content to process for the task.

Example Request

curl --location 'http://api.genaifactory.ai/v1/create_task' \
--header 'formacloud-api-key: to replace' \
--header 'Content-Type: application/json' \
--data '{
    "task_type": "TTS",
    "params": {
        "reporter_voice": "US_MALE_01"
    },
    "input_data": [
        {
            "type": "text",
            "text": {
                "content": "To resolve this issue, you can run the command as the root user in the Dockerfile. By default, the Docker build process executes commands as root, so this is often a configuration or permissions issue in the Docker environment. Below are several ways to address the issue"
            }
        }
    ]
}'

Response

Returns a JSON object containing the task details.

Field
Type
Description

created_at

string

The timestamp when the task was created.

task_id

integer

The unique identifier for the task.

task_status

string

The current status of the task.

task_type

string

The type of task created.

Example Response

{
    "created_at": "Sat, 16 Nov 2024 05:24:47 GMT",
    "task_id": 333,
    "task_status": "CREATED",
    "task_type": "TTS"
}

Last updated