# Gradium

> Generate and transcribe speech, design voices, and manage pronunciation dictionaries.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/gradium

## Actions

### Clone a voice from an audio sample

Clone a voice from an audio sample.

**Inputs**

- Audio file (`audio_file`, text, required): Audio file.
- Name (`name`, text, required): Name.
- Input format (`input_format`, text): Audio format. If omitted, inferred from the audio_file extension.
- Description (`description`, text): Description.
- Language (`language`, text, required): Language spoken in the audio sample. One of: `en`, `fr`, `es`, `pt`, `de`.
- Start s (`start_s`, number): Start s.
- Enhance (`enhance`, true/false): Enhance the new voice clone. Set to false to opt out of enhancement.
- Timeout s (`timeout_s`, number): Timeout s.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "error": "example",
    "uid": "example",
    "was_updated": true
  }
}
```

### Convert text to speech

Convert text to speech.

**Inputs**

- Text (`text`, text, required): Text.
- Voice (`voice_id`, text, required): Voice id.
- Output format (`output_format`, text, required): Output format. One of: `wav`, `opus`, `pcm`, `ulaw_8000` (Ulaw 8000), `mulaw_8000` (Mulaw 8000), `alaw_8000` (Alaw 8000), `pcm_8000` (Pcm 8000), `pcm_16000` (Pcm 16000), `pcm_22050` (Pcm 22050), `pcm_24000` (Pcm 24000), `pcm_44100` (Pcm 44100), `pcm_48000` (Pcm 48000).

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "content_base64": "example",
    "content_type": "example"
  }
}
```

### Create a pronunciation dictionary

Create a pronunciation dictionary.

**Inputs**

- Name (`name`, text, required): Name.
- Description (`description`, text): Description.
- Language (`language`, text, required): Language. One of: `en`, `fr`, `es`, `pt`, `de`.
- Rules (`rules`, list): Rules.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "language": "example",
    "name": "example",
    "org_uid": "example",
    "rules": [
      {
        "case_sensitive": true,
        "id": 1,
        "original": "example",
        "rewrite": "example"
      }
    ],
    "uid": "example"
  }
}
```

### Create a voice from a candidate

Create a voice from a candidate.

**Inputs**

- Voxium embedding ID (`voxium_embedding_id`, text, required): Id of the candidate to keep, as returned by `POST /voice-generator/generate`.
- Name (`name`, text, required): A name for the voice.
- Description (`description`, text): An optional description of the voice.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "description": "example",
    "language": "example",
    "name": "example",
    "uid": "example"
  }
}
```

### Delete a custom voice

Delete a custom voice.

**Inputs**

- Voice uid (`voice_uid`, text, required): Voice uid.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {}
}
```

### Delete a pronunciation dictionary

Delete a pronunciation dictionary.

**Inputs**

- Dictionary (`dictionary_id`, text, required): Dictionary id.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {}
}
```

### Delete a voice candidate

Delete a voice candidate.

**Inputs**

- Embedding ID (`embedding_id`, text, required): Embedding id.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {}
}
```

### Enhance a voice

Enhance a voice.

**Inputs**

- Src voice (`src_voice`, text, required): The voice to enhance: a voice id (your clone, a converted candidate or a flagship voice) or a `vox_emb_` candidate id. It keeps its language and is not modified.
- N samples (`n_samples`, number): Number of candidates to produce. All candidates in one request are variations of the same speaker. From 1 to 5.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "embeddings": [
      {
        "embedding_id": "example",
        "expires_at": "example",
        "ready": true
      }
    ]
  }
}
```

### Generate voice candidates

Generate voice candidates.

**Inputs**

- Prompt (`prompt`, text, required): The voice description, up to 500 characters. Must contain actual text, not only spaces.
- Language (`language`, text, required): Language the voice will speak. Shapes the accent and the delivery. One of: `en`, `fr`, `es`, `pt`, `de`.
- N samples (`n_samples`, number): Number of candidate voices to sample from the description. All candidates in one request are variations on the same character. From 1 to 5.
- JSON config (`json_config`, object): Advanced sampling options.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "embeddings": [
      {
        "embedding_id": "example",
        "expires_at": "example",
        "ready": true
      }
    ]
  }
}
```

### Get a pronunciation dictionary

Get a pronunciation dictionary.

**Inputs**

- Dictionary (`dictionary_id`, text, required): Dictionary id.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "language": "example",
    "name": "example",
    "org_uid": "example",
    "rules": [
      {
        "case_sensitive": true,
        "id": 1,
        "original": "example",
        "rewrite": "example"
      }
    ],
    "uid": "example"
  }
}
```

### Get a voice

Get a voice.

**Inputs**

- Voice uid (`voice_uid`, text, required): Voice uid.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "description": "example",
    "filename": "example",
    "is_catalog": true,
    "is_pro_clone": true,
    "language": "example",
    "name": "example",
    "rank": 1,
    "start_s": 1,
    "tags": [
      {
        "category": "example",
        "value": "example"
      }
    ],
    "uid": "example"
  }
}
```

### Get credit balance

Get credit balance.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "allocated_credits": 1,
    "billing_period": "example",
    "next_rollover_date": "example",
    "plan_name": "example",
    "remaining_credits": 1
  }
}
```

### List available accents

List available accents.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "languages": {}
  }
}
```

### List pronunciation dictionaries

List pronunciation dictionaries.

**Inputs**

- Limit (`limit`, number): Limit. From 0 to 1000.
- Offset (`offset`, number): Offset. At least 0.
- Language (`language`, text): Language.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "dictionaries": [
      {
        "created_at": "example",
        "description": "example",
        "language": "example",
        "name": "example",
        "org_uid": "example",
        "rules": [
          {}
        ],
        "uid": "example"
      }
    ],
    "total": 1
  }
}
```

### List voice candidates

List voice candidates.

**Inputs**

- Embedding ID (`embedding_id`, text): Look up a single candidate by id. Omit to list all candidates.
- Skip (`skip`, number): Skip. At least 0.
- Limit (`limit`, number): Limit. From 1 to 1000.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "embeddings": [
      {
        "created_at": "example",
        "edit_language_config": {
          "accent": "example",
          "gender": "male",
          "src_language": "example",
          "src_voice": "example",
          "target_language": "example"
        },
        "embedding_id": "example",
        "enhance_config": {
          "src_language": "example",
          "src_voice": "example"
        },
        "expires_at": "example",
        "generate_config": {
          "language": "example",
          "prompt": "example"
        },
        "kind": "generate",
        "language": "example",
        "prompt": "example",
        "ready": true
      }
    ]
  }
}
```

### List voices

List voices.

**Inputs**

- Skip (`skip`, number): Skip. At least 0.
- Limit (`limit`, number): Limit. At least 0.
- Include catalog (`include_catalog`, true/false): Also return Gradium catalog voices. Your organization's own voices come first, then catalog voices by `rank`, lowest first, unranked last.
- Locale (`locale`, text): Only voices of this locale, e.g. `en-nz` or `fr-fr`.
- Gender (`gender`, text): Only voices of this gender: `male`, `female` or `neutral`.
- Use case (`use_case`, text): Only voices tagged with this use case, e.g. `Customer Service`, `Conversational`, `Narration` or `Ads & Social Media`. URL-encode it (`Ads%20%26%20Social%20Media`).

**Outputs**

- `data` (list): The response from Gradium.

**Example output**

```json
{
  "data": [
    {
      "description": "example",
      "filename": "example",
      "is_catalog": true,
      "is_pro_clone": true,
      "language": "example",
      "name": "example",
      "rank": 1,
      "start_s": 1,
      "tags": [
        {
          "category": "example",
          "value": "example"
        }
      ],
      "uid": "example"
    }
  ]
}
```

### Localize a voice

Localize a voice.

**Inputs**

- Src voice (`src_voice`, text, required): The voice to localize: a voice id (your clone, a converted candidate or a flagship voice) or a `vox_emb_` candidate id. The source is not modified.
- Target language (`target_language`, text, required): Language the candidates will speak. May equal the source language: that is an accent change. One of: `en`, `fr`, `es`, `pt`, `de`.
- Accent (`accent`, text): One of the accents `GET /voice-generator/available-accents` lists for `target_language`, matched case-insensitively. Omitted: the first accent listed for that language.
- Gender (`gender`, text): Opens the edit caption. Omitted: the source voice's gender tag, or the gender of the source candidate's own localization, or no gender. Clones and converted voices carry no tag, so send it for them. One of: `male`, `female`.
- N samples (`n_samples`, number): Number of candidates to produce. All candidates in one request are variations of the same localized speaker. From 1 to 5.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "embeddings": [
      {
        "embedding_id": "example",
        "expires_at": "example",
        "ready": true
      }
    ]
  }
}
```

### Transcribe an audio file

Transcribe an audio file.

**Inputs**

- Audio (`audio`, text, required): Audio.
- Language (`language`, text): Language. One of: `en`, `fr`, `es`, `pt`, `de`.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "events": [
      {}
    ],
    "transcript": "example"
  }
}
```

### Update a custom voice

Update a custom voice.

**Inputs**

- Voice uid (`voice_uid`, text, required): Voice uid.
- Name (`name`, text): Name.
- Description (`description`, text): Description.
- Language (`language`, text): Language.
- Start s (`start_s`, number): Start s.
- Tags (`tags`, list): Tags.
- Rank (`rank`, number): Rank.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "description": "example",
    "filename": "example",
    "has_audio": true,
    "is_pending": true,
    "is_pro_clone": true,
    "language": "example",
    "name": "example",
    "org_uid": "example",
    "start_s": 1,
    "stop_s": 1,
    "uid": "example"
  }
}
```

### Update a pronunciation dictionary

Update a pronunciation dictionary.

**Inputs**

- Dictionary (`dictionary_id`, text, required): Dictionary id.
- Name (`name`, text): Name.
- Description (`description`, text): Description.
- Language (`language`, text): Language. One of: `en`, `fr`, `es`, `pt`, `de`.
- Rules (`rules`, list): Rules.

**Outputs**

- `data` (object): The response from Gradium.

**Example output**

```json
{
  "data": {
    "created_at": "example",
    "description": "example",
    "language": "example",
    "name": "example",
    "org_uid": "example",
    "rules": [
      {
        "case_sensitive": true,
        "id": 1,
        "original": "example",
        "rewrite": "example"
      }
    ],
    "uid": "example"
  }
}
```
