---
title: "AI"
description: "Describe what should happen with your files and an AI model takes care of it, transcribe the speech of audio and video files, have a text spoken, or remove personal data from documents."
canonical_url: "https://cloudconvert.com/docs/operations/ai"
---
# AI

> Describe what should happen with your files and an AI model takes care of it, transcribe the speech of audio and video files, have a text spoken, or remove personal data from documents.

AI operations let an AI model work on your files.

<note>

All AI operations are in beta: parameters and results may still change, and AI models can make mistakes.

</note>

- AI can be turned off for your account or team in the [AI settings](https://cloudconvert.com/dashboard/ai). Jobs with AI tasks are then rejected, and AI tasks fail with the code `AI_DISABLED`.
- `ai/stt`, `ai/tts` and `ai/redact` run on our own servers, your files are not sent to a third party. They consume credits like conversions, by their processing time.

## AI Agent <badge color="primary" label="Beta" size="lg"></badge>

With an `ai/agent` task, you describe in plain language what should be done with your files. The agent then creates the required tasks inside the same [job](https://cloudconvert.com/docs/raw/api-reference/jobs.md): create a job with an import task, an `ai/agent` task which uses it as `input`, and an export task which uses the `ai/agent` task as `input`.

- The agent does not see the content of your files, only the prompt, the file names and the results of its tasks, such as metadata.
- Its tasks are regular tasks of the job, with the `ai/agent` task as `parent_task_id`. One `ai/agent` task can create up to 50 tasks.
- It imports from and exports to the locations named in your prompt or in the other tasks of the job only. `export/url` and your connected cloud storages are always possible.
- The `engine` is the AI model. If it is not set, the default model is used.
- The `ai/agent` task itself does not consume credits, the tasks it creates do as usual.
- A job runs one `ai/agent` task at a time (`AGENT_ALREADY_RUNNING` otherwise). Requests with an `ai/agent` task are limited to 6 per minute and 60 per hour (HTTP status `429`, code `AI_RATE_LIMIT_EXCEEDED`).

#### Result

Tasks which use the `ai/agent` task as `input` get the output files of the tasks the agent has created. The `message` of the task is a short summary by the agent, or the answer if you asked a question. The `result` contains:

- `output_tasks`: the IDs of the tasks whose output files are the result.
- `steps`: the steps the agent has taken.
- `suggestions`: up to three follow-up requests the agent suggests.
- `question`: `true` if the agent needs something from you, such as a password or the target format. The `message` is the question then. Answer it with another `ai/agent` task in the same job.

<table>
<thead>
  <tr>
    <th>
      Code
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        AGENT_NO_OUTPUT
      </code>
    </td>
    
    <td>
      The agent finished without output files, for example because it answered a question. Tasks using it as <code>
        input
      </code>
      
       are cancelled with this code: set <code>
        ignore_error
      </code>
      
       on them if this should not fail the job.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        AGENT_DECLINED
      </code>
    </td>
    
    <td>
      The request asks for something CloudConvert cannot do. The <code>
        message
      </code>
      
       says why.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        AGENT_FAILED
      </code>
    </td>
    
    <td>
      Tasks of the agent have failed and it could not correct the cause.
    </td>
  </tr>
</tbody>
</table>

#### Example Prompts

- `Make this video smaller, at most 30 MB.`
- `Convert all files to PDF and merge them into one PDF, in alphabetical order of the file names.`
- `Convert the first page to PNG with a resolution of 2000x2000. If there are more pages, convert the pages after the first one to PNG with a maximum resolution of 1000x1000.`
- `How many pages does this PDF have?`

#### Task Parameters

### ai/agent task parameters

- `operation` _string_ required: Value is `ai/agent`.
- `input` _string or array of task names_: The input task name(s) for this task.
- `prompt` _string_ required: What the agent should do with the input files. The agent creates the required tasks in this job.
- `engine` _string_: The AI model the agent uses. If not set, the default model is used.
- `timeout` _integer_: Timeout in seconds after the task will be cancelled.

### Example job

Raw request:

```json
{
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
        },
        "agent": {
            "operation": "ai/agent",
            "input": "import-my-file",
            "prompt": "Convert the first page to PNG with a resolution of 2000x2000. If there are more pages, convert the pages after the first one to PNG with a maximum resolution of 1000x1000."
        },
        "export-the-result": {
            "operation": "export/url",
            "input": "agent"
        }
    }
}
```

CLI:

```bash
# Install the CloudConvert CLI: npm install -g cloudconvert-cli
$ cloudconvert ai/agent \
    --prompt='Convert the first page to PNG with a resolution of 2000x2000. If there are more pages, convert the pages after the first one to PNG with a maximum resolution of 1000x1000.' \
    zombies.pdf
```

cURL:

```bash
$ curl -X POST "https://api.cloudconvert.com/v2/jobs" \
    -H "Authorization: Bearer API_KEY" \
    -H "Content-type: application/json" \
    -d '{
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
        },
        "agent": {
            "operation": "ai/agent",
            "input": "import-my-file",
            "prompt": "Convert the first page to PNG with a resolution of 2000x2000. If there are more pages, convert the pages after the first one to PNG with a maximum resolution of 1000x1000."
        },
        "export-the-result": {
            "operation": "export/url",
            "input": "agent"
        }
    }
}' 
```

PHP:

```php
use \CloudConvert\CloudConvert;
use \CloudConvert\Models\Job;
use \CloudConvert\Models\Task;

$cloudconvert = new CloudConvert(['api_key' => 'API_KEY']);

$job = (new Job())
   ->addTask(
       (new Task('import/url', 'import-my-file'))
         ->set('url', 'https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf')
     )
   ->addTask(
       (new Task('ai/agent', 'agent'))
         ->set('input', 'import-my-file')
         ->set('prompt', 'Convert the first page to PNG with a resolution of 2000x2000. If there are more pages, convert the pages after the first one to PNG with a maximum resolution of 1000x1000.')
     )
   ->addTask(
       (new Task('export/url', 'export-the-result'))
         ->set('input', 'agent')
     ); 

$cloudconvert->jobs()->create($job);
```

Node.js:

```js
import CloudConvert from 'cloudconvert';

const cloudConvert = new CloudConvert('api_key');

let job = await cloudConvert.jobs.create({
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf"
        },
        "agent": {
            "operation": "ai/agent",
            "input": "import-my-file",
            "prompt": "Convert the first page to PNG with a resolution of 2000x2000. If there are more pages, convert the pages after the first one to PNG with a maximum resolution of 1000x1000."
        },
        "export-the-result": {
            "operation": "export/url",
            "input": "agent"
        }
    }
});
```

Python:

```python
import cloudconvert

cloudconvert.configure(api_key='API_KEY')

cloudconvert.Job.create(payload={
    'tasks': {
        'import-my-file': {
            'operation': 'import/url',
            'url': 'https://cloudconvert-blog.s3.eu-central-1.amazonaws.com/public/test-files/zombies.pdf'
        },
        'agent': {
            'operation': 'ai/agent',
            'input': 'import-my-file',
            'prompt': 'Convert the first page to PNG with a resolution of 2000x2000. If there are more pages, convert the pages after the first one to PNG with a maximum resolution of 1000x1000.'
        },
        'export-the-result': {
            'operation': 'export/url',
            'input': 'agent'
        }
    }
})
```

<tip to="https://cloudconvert.com/job-builder?operation=ai/agent">

Use the **Job Builder** to generate and try out ai/agent jobs.

</tip>

## Speech to Text <badge color="primary" label="Beta" size="lg"></badge>

An `ai/stt` task transcribes the speech of an audio or video file to plain text (`txt`), subtitles (`srt`, `vtt`) or `json` with the segments and their timestamps. The `engine` is `whisper`, its `engine_version` the model (`large-v3`).

The language is detected from the first 30 seconds of speech. Set `language` if you know it: this is more reliable for short files and files which start with music or silence. Parts without speech are skipped. `translate` translates the speech to English, `max_line_length` splits long subtitles at word boundaries.

#### Result

Besides the `files`, the `result` contains the `language` (ISO 639-1, as set or detected), its `language_probability` (0 to 1) and the `duration` in seconds. The `json` output has the same values, the `text` and the `segments`:

```json
{
  "language": "en",
  "language_probability": 0.99,
  "duration": 12.4,
  "text": "Welcome to the show. Today we talk about file conversions.",
  "segments": [
    { "id": 0, "start": 0.52, "end": 2.1, "text": "Welcome to the show." },
    { "id": 1, "start": 2.6, "end": 5.84, "text": "Today we talk about file conversions." }
  ]
}
```

With `word_timestamps`, each segment has its `words` with `start`, `end`, `word` and `probability`.

A file without an audio track fails with the code `STREAM_MISSING`, one whose audio cannot be read with `OPEN_FAILED`.

#### Task Parameters

### ai/stt task parameters

- `operation` _string_ required: Value is `ai/stt`.
- `input` _string or array of task names_ required: The audio or video file to transcribe.
- `engine` _string_: Use a specific engine for the transcription. The default is whisper.
- `engine_version` _string_: The model of the engine. The default is large-v3.
- `filename` _string_: Choose a filename (including extension) for the transcript. By default it is named after the input file.
- `timeout` _integer_: Timeout in seconds after the task will be cancelled. By default, tasks time out after 5 hours.

Additional operation-specific parameters can be available depending on the input format and output format. Use the [operations API](https://cloudconvert.com/docs/raw/api-reference/operations.md#list-operations) to identify these dynamic parameters, for example by filtering for `ai/stt` and including `options`: `GET https://api.cloudconvert.com/v2/operations?filter[operation]=ai/stt&include=options`.

### Example job

Raw request:

```json
{
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://example.com/interview.mp3"
        },
        "transcribe-my-file": {
            "operation": "ai/stt",
            "input": "import-my-file",
            "output_format": "srt"
        },
        "export-the-transcript": {
            "operation": "export/url",
            "input": "transcribe-my-file"
        }
    }
}
```

CLI:

```bash
# Install the CloudConvert CLI: npm install -g cloudconvert-cli
$ cloudconvert ai/stt \
    -f srt \
    interview.mp3
```

cURL:

```bash
$ curl -X POST "https://api.cloudconvert.com/v2/jobs" \
    -H "Authorization: Bearer API_KEY" \
    -H "Content-type: application/json" \
    -d '{
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://example.com/interview.mp3"
        },
        "transcribe-my-file": {
            "operation": "ai/stt",
            "input": "import-my-file",
            "output_format": "srt"
        },
        "export-the-transcript": {
            "operation": "export/url",
            "input": "transcribe-my-file"
        }
    }
}' 
```

PHP:

```php
use \CloudConvert\CloudConvert;
use \CloudConvert\Models\Job;
use \CloudConvert\Models\Task;

$cloudconvert = new CloudConvert(['api_key' => 'API_KEY']);

$job = (new Job())
   ->addTask(
       (new Task('import/url', 'import-my-file'))
         ->set('url', 'https://example.com/interview.mp3')
     )
   ->addTask(
       (new Task('ai/stt', 'transcribe-my-file'))
         ->set('input', 'import-my-file')
         ->set('output_format', 'srt')
     )
   ->addTask(
       (new Task('export/url', 'export-the-transcript'))
         ->set('input', 'transcribe-my-file')
     ); 

$cloudconvert->jobs()->create($job);
```

Node.js:

```js
import CloudConvert from 'cloudconvert';

const cloudConvert = new CloudConvert('api_key');

let job = await cloudConvert.jobs.create({
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://example.com/interview.mp3"
        },
        "transcribe-my-file": {
            "operation": "ai/stt",
            "input": "import-my-file",
            "output_format": "srt"
        },
        "export-the-transcript": {
            "operation": "export/url",
            "input": "transcribe-my-file"
        }
    }
});
```

Python:

```python
import cloudconvert

cloudconvert.configure(api_key='API_KEY')

cloudconvert.Job.create(payload={
    'tasks': {
        'import-my-file': {
            'operation': 'import/url',
            'url': 'https://example.com/interview.mp3'
        },
        'transcribe-my-file': {
            'operation': 'ai/stt',
            'input': 'import-my-file',
            'output_format': 'srt'
        },
        'export-the-transcript': {
            'operation': 'export/url',
            'input': 'transcribe-my-file'
        }
    }
})
```

<tip to="https://cloudconvert.com/job-builder?operation=ai/stt">

Use the **Job Builder** to generate and try out ai/stt jobs.

</tip>

## Text to Speech <badge color="primary" label="Beta" size="lg"></badge>

An `ai/tts` task speaks a text to `mp3`, `wav`, `flac` or `ogg` (Opus). The `engine` is `qwen3-tts`, its `engine_version` the model (`1.7b-customvoice`).

The text is either the `text` of the task (up to 10,000 characters, no import task needed) or a UTF-8 text file of an `input` task (up to 30,000 characters), never both. A text file is spoken as it is: remove markup such as Markdown syntax first.

Each `voice` speaks Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish and Italian, and sounds best in its native language. With `instruct` you describe how the text should be spoken, for example `Calm and slow, like a bedtime story.`

<table>
<thead>
  <tr>
    <th>
      <code>
        voice
      </code>
    </th>
    
    <th>
      Voice
    </th>
    
    <th>
      Native language
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        ryan
      </code>
    </td>
    
    <td>
      Male, energetic with a strong rhythm
    </td>
    
    <td>
      English
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        aiden
      </code>
    </td>
    
    <td>
      Male, sunny American voice with a clear midrange
    </td>
    
    <td>
      English
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        vivian
      </code>
    </td>
    
    <td>
      Female, bright and young with a slight edge
    </td>
    
    <td>
      Chinese
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        serena
      </code>
    </td>
    
    <td>
      Female, warm and gentle
    </td>
    
    <td>
      Chinese
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        uncle_fu
      </code>
    </td>
    
    <td>
      Male, mature with a low, mellow tone
    </td>
    
    <td>
      Chinese
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        dylan
      </code>
    </td>
    
    <td>
      Male, youthful with a Beijing accent
    </td>
    
    <td>
      Chinese (Beijing dialect)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        eric
      </code>
    </td>
    
    <td>
      Male, lively and slightly husky
    </td>
    
    <td>
      Chinese (Sichuan dialect)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        ono_anna
      </code>
    </td>
    
    <td>
      Female, playful and light
    </td>
    
    <td>
      Japanese
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sohee
      </code>
    </td>
    
    <td>
      Female, warm with rich emotion
    </td>
    
    <td>
      Korean
    </td>
  </tr>
</tbody>
</table>

#### Result

Besides the `files`, the `result` contains the `duration` in seconds, the number of spoken `characters`, the `voice` and the `language`.

An input file without text fails with the code `TEXT_MISSING`, one which is too long with `TEXT_TOO_LONG`, and one which is not UTF-8 text with `OPEN_FAILED`.

#### Task Parameters

### ai/tts task parameters

- `operation` _string_ required: Value is `ai/tts`.
- `text` _string_: The text to speak, up to 10,000 characters. Either this or an input file is required.
- `input` _string or array of task names_: A text file (UTF-8, up to 100,000 characters) to speak, instead of text.
- `engine` _string_: Use a specific engine. The default is qwen3-tts.
- `engine_version` _string_: The model of the engine. The default is 1.7b-customvoice.
- `filename` _string_: Choose a filename (including extension) for the audio file. By default it is named after the input file, or speech.
- `timeout` _integer_: Timeout in seconds after the task will be cancelled. By default, tasks time out after 5 hours.

Additional operation-specific parameters can be available depending on the input format and output format. Use the [operations API](https://cloudconvert.com/docs/raw/api-reference/operations.md#list-operations) to identify these dynamic parameters, for example by filtering for `ai/tts` and including `options`: `GET https://api.cloudconvert.com/v2/operations?filter[operation]=ai/tts&include=options`.

### Example job

Raw request:

```json
{
    "tasks": {
        "speak-my-text": {
            "operation": "ai/tts",
            "text": "Welcome to CloudConvert. Your file is ready for download.",
            "voice": "ryan",
            "output_format": "mp3"
        },
        "export-the-audio": {
            "operation": "export/url",
            "input": "speak-my-text"
        }
    }
}
```

CLI:

```bash
# Install the CloudConvert CLI: npm install -g cloudconvert-cli
$ cloudconvert ai/tts \
    -f mp3 \
    --text='Welcome to CloudConvert. Your file is ready for download.' \
    --voice=ryan
```

cURL:

```bash
$ curl -X POST "https://api.cloudconvert.com/v2/jobs" \
    -H "Authorization: Bearer API_KEY" \
    -H "Content-type: application/json" \
    -d '{
    "tasks": {
        "speak-my-text": {
            "operation": "ai/tts",
            "text": "Welcome to CloudConvert. Your file is ready for download.",
            "voice": "ryan",
            "output_format": "mp3"
        },
        "export-the-audio": {
            "operation": "export/url",
            "input": "speak-my-text"
        }
    }
}' 
```

PHP:

```php
use \CloudConvert\CloudConvert;
use \CloudConvert\Models\Job;
use \CloudConvert\Models\Task;

$cloudconvert = new CloudConvert(['api_key' => 'API_KEY']);

$job = (new Job())
   ->addTask(
       (new Task('ai/tts', 'speak-my-text'))
         ->set('text', 'Welcome to CloudConvert. Your file is ready for download.')
         ->set('voice', 'ryan')
         ->set('output_format', 'mp3')
     )
   ->addTask(
       (new Task('export/url', 'export-the-audio'))
         ->set('input', 'speak-my-text')
     ); 

$cloudconvert->jobs()->create($job);
```

Node.js:

```js
import CloudConvert from 'cloudconvert';

const cloudConvert = new CloudConvert('api_key');

let job = await cloudConvert.jobs.create({
    "tasks": {
        "speak-my-text": {
            "operation": "ai/tts",
            "text": "Welcome to CloudConvert. Your file is ready for download.",
            "voice": "ryan",
            "output_format": "mp3"
        },
        "export-the-audio": {
            "operation": "export/url",
            "input": "speak-my-text"
        }
    }
});
```

Python:

```python
import cloudconvert

cloudconvert.configure(api_key='API_KEY')

cloudconvert.Job.create(payload={
    'tasks': {
        'speak-my-text': {
            'operation': 'ai/tts',
            'text': 'Welcome to CloudConvert. Your file is ready for download.',
            'voice': 'ryan',
            'output_format': 'mp3'
        },
        'export-the-audio': {
            'operation': 'export/url',
            'input': 'speak-my-text'
        }
    }
})
```

<tip to="https://cloudconvert.com/job-builder?operation=ai/tts">

Use the **Job Builder** to generate and try out ai/tts jobs.

</tip>

## Redact Personal Data <badge color="primary" label="Beta" size="lg"></badge>

An `ai/redact` task removes personal data (PII) from a PDF, TXT or MD file. The output file has the format of the input file. `pdf/redact` is the same operation under a second name. The `engine` is `gliner2-pii`, its `engine_version` the model (`privacy-filter-multi`), which knows English, German, French, Spanish, Italian, Portuguese and Dutch.

The `preset` decides what is removed:

- `standard` (default): names, contact data, dates of birth, ID and tax numbers, bank and card data, credentials and IP addresses.
- `strict`: also locations, other dates, account IDs and URLs, with lower confidence thresholds.
- `names`, `contact`, `financial`, `identity`, `credentials`: one of these groups only.

Instead of a preset, `entities` lists the types to remove, for example `["person", "email"]`, and `threshold` sets the minimum confidence (by default 0.5, 0.6 for names). In TXT and MD files, the removed text is replaced by its type (`[EMAIL]`), or with `replacement` by █ characters (`mask`) or nothing (`remove`).

<warning>

AI models make mistakes: some personal data may be missed, and some text which is no personal data may be removed. Check the result where it matters.

</warning>

In PDFs:

- The text is removed from the document itself, not only covered, and a black box marks its place. Form fields, annotations, comments, bookmarks and links are checked too.
- The metadata of the document is removed unless `scrub_metadata` is `false`.
- Attached files are not checked. They stay unless `remove_attachments` is set.
- Digital signatures and PDF/A conformance do not survive the redaction.
- Scanned pages have no text to check. With `ocr`, a [PDF OCR](https://cloudconvert.com/docs/raw/operations/pdf-operations.md#pdf-ocr) task runs first (in the same job, billed as such, languages from `ocr_language`) and the text it reads is redacted together with the scan under it. Without `ocr`, such pages stay as they are and are listed in `pages_without_text`.

#### Result

Besides the `files`, the `result` contains:

- `redactions`: the number of redactions per type, for example `{"person": 4, "email": 2}`.
- `total`: the number of all redactions.
- `pages`: for a PDF, its number of pages.
- `pages_without_text`: for a PDF, the pages which had no text (scans) and were not checked.

<table>
<thead>
  <tr>
    <th>
      Code
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        UNSUPPORTED_INPUT_FORMAT
      </code>
    </td>
    
    <td>
      The file is no PDF, TXT or MD file.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PASSWORD_REQUIRED
      </code>
    </td>
    
    <td>
      The PDF is encrypted: <a href="https://cloudconvert.com/docs/operations/pdf-operations#decrypt-pdf">
        decrypt
      </a>
      
       it first.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        NO_TEXT_LAYER
      </code>
    </td>
    
    <td>
      Scanned pages, with <code>
        allow_pages_without_text
      </code>
      
       set to <code>
        false
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        TEXT_UNREADABLE
      </code>
    </td>
    
    <td>
      The fonts of the PDF do not say which characters they show.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        OPEN_FAILED
      </code>
    </td>
    
    <td>
      The file cannot be read, for example a text file which is not UTF-8.
    </td>
  </tr>
</tbody>
</table>

#### Task Parameters

### ai/redact task parameters

- `operation` _string_ required: Value is `ai/redact`.
- `input` _string or array of task names_ required: The PDF, TXT or MD file to remove the personal data from.
- `engine` _string_: Use a specific engine for the redaction. The default is gliner2-pii.
- `engine_version` _string_: The model of the engine. The default is privacy-filter-multi.
- `filename` _string_: Choose a filename (including extension) for the redacted file. By default it has the name and format of the input file.
- `timeout` _integer_: Timeout in seconds after the task will be cancelled. By default, tasks time out after 5 hours.

Additional operation-specific parameters can be available depending on the input format and output format. Use the [operations API](https://cloudconvert.com/docs/raw/api-reference/operations.md#list-operations) to identify these dynamic parameters, for example by filtering for `ai/redact` and including `options`: `GET https://api.cloudconvert.com/v2/operations?filter[operation]=ai/redact&include=options`.

### Example job

Raw request:

```json
{
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://example.com/contract.pdf"
        },
        "redact-my-file": {
            "operation": "ai/redact",
            "input": "import-my-file",
            "preset": "standard",
            "ocr": true,
            "ocr_language": [
                "eng",
                "deu"
            ]
        },
        "export-the-redacted-file": {
            "operation": "export/url",
            "input": "redact-my-file"
        }
    }
}
```

CLI:

```bash
# Install the CloudConvert CLI: npm install -g cloudconvert-cli
$ cloudconvert ai/redact \
    --preset=standard \
    --ocr=true \
    --ocr_language.0=eng \
    --ocr_language.1=deu \
    contract.pdf
```

cURL:

```bash
$ curl -X POST "https://api.cloudconvert.com/v2/jobs" \
    -H "Authorization: Bearer API_KEY" \
    -H "Content-type: application/json" \
    -d '{
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://example.com/contract.pdf"
        },
        "redact-my-file": {
            "operation": "ai/redact",
            "input": "import-my-file",
            "preset": "standard",
            "ocr": true,
            "ocr_language": [
                "eng",
                "deu"
            ]
        },
        "export-the-redacted-file": {
            "operation": "export/url",
            "input": "redact-my-file"
        }
    }
}' 
```

PHP:

```php
use \CloudConvert\CloudConvert;
use \CloudConvert\Models\Job;
use \CloudConvert\Models\Task;

$cloudconvert = new CloudConvert(['api_key' => 'API_KEY']);

$job = (new Job())
   ->addTask(
       (new Task('import/url', 'import-my-file'))
         ->set('url', 'https://example.com/contract.pdf')
     )
   ->addTask(
       (new Task('ai/redact', 'redact-my-file'))
         ->set('input', 'import-my-file')
         ->set('preset', 'standard')
         ->set('ocr', true)
         ->set('ocr_language', ["eng","deu"])
     )
   ->addTask(
       (new Task('export/url', 'export-the-redacted-file'))
         ->set('input', 'redact-my-file')
     ); 

$cloudconvert->jobs()->create($job);
```

Node.js:

```js
import CloudConvert from 'cloudconvert';

const cloudConvert = new CloudConvert('api_key');

let job = await cloudConvert.jobs.create({
    "tasks": {
        "import-my-file": {
            "operation": "import/url",
            "url": "https://example.com/contract.pdf"
        },
        "redact-my-file": {
            "operation": "ai/redact",
            "input": "import-my-file",
            "preset": "standard",
            "ocr": true,
            "ocr_language": [
                "eng",
                "deu"
            ]
        },
        "export-the-redacted-file": {
            "operation": "export/url",
            "input": "redact-my-file"
        }
    }
});
```

Python:

```python
import cloudconvert

cloudconvert.configure(api_key='API_KEY')

cloudconvert.Job.create(payload={
    'tasks': {
        'import-my-file': {
            'operation': 'import/url',
            'url': 'https://example.com/contract.pdf'
        },
        'redact-my-file': {
            'operation': 'ai/redact',
            'input': 'import-my-file',
            'preset': 'standard',
            'ocr': True,
            'ocr_language': [
                'eng',
                'deu'
            ]
        },
        'export-the-redacted-file': {
            'operation': 'export/url',
            'input': 'redact-my-file'
        }
    }
})
```

<tip to="https://cloudconvert.com/job-builder?operation=ai/redact">

Use the **Job Builder** to generate and try out ai/redact jobs.

</tip>


## Sitemap

See the full [sitemap](https://cloudconvert.com/docs/sitemap.md) for all pages.
