---
title: ElevenLabs Texte en dialogue | RunAPI
description: Utilisez le point de terminaison texte vers dialogue pour créer une tâche
  asynchrone.
url: https://runapi.ai/fr/docs/api/elevenlabs/text-to-dialogue.md
canonical: https://runapi.ai/fr/docs/api/elevenlabs/text-to-dialogue
locale: fr
---

> Version HTML: https://runapi.ai/fr/docs/api/elevenlabs/text-to-dialogue
> Index du site pour les agents: https://runapi.ai/llms.txt

# ElevenLabs Texte en dialogue

## Vue d'ensemble

Utilisez le point de terminaison texte vers dialogue avec les entrées requises. Utilisez l'ID de tâche retourné pour récupérer son état, ou fournissez callback_url pour les livraisons documentées ci-dessous.

### Démarrage rapide

1. Créez une clé API et définissez-la comme RUNAPI_API_KEY.
2. Envoyer une requête POST dont le corps correspond au schéma de requête.
3. Enregistrez l'identifiant de tâche retourné, puis interrogez l'état jusqu'à atteindre un état terminal ou gérez les callbacks documentés ci-dessous.

## Point de terminaison

POST /api/v1/elevenlabs/text_to_dialogue

URL de base: https://runapi.ai

Version de l'API: v1

Authentification: Authorization: Bearer YOUR_API_TOKEN

## Modèles pris en charge

Ouvrez une page de modèle pour consulter la tarification actuelle, les limites de débit et les conditions d'utilisation commerciale.

- [text-to-dialogue-v3](https://runapi.ai/fr/models/elevenlabs/text-to-dialogue-v3)

## Schéma de requête

Envoyez uniquement les champs documentés. Lorsqu'il est fourni, callback_url reçoit les livraisons de Task documentées ci-dessous.

### text-to-dialogue-v3

```json
{
  "callback_url": {
    "type": "string"
  },
  "dialogue": {
    "required": true,
    "type": "array"
  },
  "language_code": {
    "type": "string"
  },
  "stability": {
    "enum": [
      0.0,
      0.5,
      1.0
    ],
    "type": "number"
  }
}
```

## Créer une acceptation

HTTP 202 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    },
    "task_replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## Interrogation en cours

HTTP 200 - GET /api/v1/elevenlabs/text_to_dialogue/:id

### Schéma de réponse

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "processing"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "processing"
}
```

## Interrogation terminée

HTTP 200 - GET /api/v1/elevenlabs/text_to_dialogue/:id

### Schéma de réponse

```json
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "audios",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "audios": [
    {
      "url": "https://file.runapi.ai/reference-audio.mp3"
    }
  ],
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "completed"
}
```

## Échec de l'interrogation

HTTP 200 - GET /api/v1/elevenlabs/text_to_dialogue/:id

### Schéma de réponse

```json
{
  "properties": {
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "error": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "error": "Task processing failed.",
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## Rappel client : terminé

HTTP 200 - POST callback_url

### Schéma de réponse

```json
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "audios"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "audios": [
    {
      "url": "https://file.runapi.ai/reference-audio.mp3"
    }
  ],
  "id": "tsk_reference_demo",
  "status": "completed"
}
```

## Rappel client : échoué

HTTP 200 - POST callback_url

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "properties": {
            "code": {
              "type": "string"
            },
            "limit_cents": {
              "type": "integer"
            },
            "message": {
              "type": "string"
            },
            "reset_at": {
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "used_cents": {
              "type": "integer"
            },
            "window": {
              "enum": [
                "1h",
                "1d",
                "7d",
                "daily",
                "weekly",
                "monthly",
                "lifetime"
              ],
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object",
          "unevaluatedProperties": false
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "failed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": {
    "code": "generation_failed",
    "message": "Task processing failed."
  },
  "id": "tsk_reference_demo",
  "status": "failed"
}
```

## Erreurs

HTTP 401 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "Authentication required"
}
```

## Erreurs

HTTP 401 - GET /api/v1/elevenlabs/text_to_dialogue/:id

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "Authentication required"
}
```

## Erreurs

HTTP 400 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Message d'erreur lisible par l'humain.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Résumé de validation lisible par l'humain.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Messages de validation indexés par champ de requête public, avec un tableau de chaînes lisibles par l'humain pour chaque champ.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### Exemple de réponse

```json
{
  "error": "Validation failed",
  "errors": {
    "dialogue": [
      "is required"
    ]
  }
}
```

## Erreurs

HTTP 402 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "Insufficient balance"
}
```

## Erreurs

HTTP 429 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "API key credit limit exceeded"
}
```

## Erreurs

HTTP 409 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "The request uses features that are not supported for the selected model"
}
```

## Erreurs

HTTP 429 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "Rate limit reached. Please retry later."
}
```

## Erreurs

HTTP 503 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "Service under maintenance, please try again later"
}
```

## Erreurs

HTTP 504 - POST /api/v1/elevenlabs/text_to_dialogue

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "The request timed out"
}
```

## Erreurs

HTTP 404 - GET /api/v1/elevenlabs/text_to_dialogue/:id

### Schéma de réponse

```json
{
  "properties": {
    "error": {
      "description": "Message d'erreur lisible par l'humain.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemple de réponse

```json
{
  "error": "Task with id 'tsk_reference_demo' not found"
}
```

## Exemples de code générés

Utilisez directement cURL, ou installez un SDK pour votre langage. Chaque exemple soumet la requête validée indiquée dans cette référence.

### curl

```curl
curl -X POST https://runapi.ai/api/v1/elevenlabs/text_to_dialogue \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"dialogue":[{"text":"Welcome to the show.","voice":"Adam"},{"text":"Thanks for having me.","voice":"Brian"}],"stability":0.5,"language_code":"en"}'
```

### javascript

#### Installer

```bash
npm install @runapi.ai/elevenlabs
```

```javascript
import { ElevenlabsClient } from "@runapi.ai/elevenlabs";

const client = new ElevenlabsClient({ apiKey: process.env.RUNAPI_API_KEY });
const task = await client.textToDialogue.create({
  "dialogue": [
    {
      "text": "Welcome to the show.",
      "voice": "Adam"
    },
    {
      "text": "Thanks for having me.",
      "voice": "Brian"
    }
  ],
  "stability": 0.5,
  "language_code": "en"
});
```

### python

#### Installer

```bash
pip install runapi-elevenlabs
```

```python
import os
from runapi.elevenlabs import ElevenlabsClient

client = ElevenlabsClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.text_to_dialogue.create(
  dialogue=[{"text": "Welcome to the show.", "voice": "Adam"}, {"text": "Thanks for having me.", "voice": "Brian"}],
  stability=0.5,
  language_code="en"
)
```

### go

#### Installer

```bash
go get github.com/runapi-ai/elevenlabs-sdk/go@latest
```

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  elevenlabs "github.com/runapi-ai/elevenlabs-sdk/go/elevenlabs"
)

func main() {
  client, err := elevenlabs.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  task, err := client.TextToDialogue.Create(context.Background(), elevenlabs.TextToDialogueParams{
    Dialogue: []elevenlabs.DialogueLine{elevenlabs.DialogueLine{Text: "Welcome to the show.", Voice: "Adam"}, elevenlabs.DialogueLine{Text: "Thanks for having me.", Voice: "Brian"}},
    Stability: func(value float64) *float64 { return &value }(0.5),
    LanguageCode: "en",
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = task
}
```

### ruby

#### Installer

```bash
gem install runapi-elevenlabs
```

```ruby
require "runapi/elevenlabs"

client = RunApi::Elevenlabs::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
task = client.text_to_dialogue.create(
  dialogue: [{"text": "Welcome to the show.", "voice": "Adam"}, {"text": "Thanks for having me.", "voice": "Brian"}],
  stability: 0.5,
  language_code: "en"
)
```

### java

#### Installer

```kotlin
implementation("ai.runapi:runapi-elevenlabs")
```

```java
import ai.runapi.elevenlabs.ElevenLabsClient;
import ai.runapi.elevenlabs.types.TextToDialogueParams;
import ai.runapi.core.polling.TaskCreateResponse;

public final class Example {
  public static void main(String[] args) {
    ElevenLabsClient client = ElevenLabsClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TaskCreateResponse task = client.textToDialogue().create(
        TextToDialogueParams.builder()
        .dialogue(java.util.Arrays.asList(ai.runapi.elevenlabs.types.DialogueLine.builder().text("Welcome to the show.").voice("Adam").build(), ai.runapi.elevenlabs.types.DialogueLine.builder().text("Thanks for having me.").voice("Brian").build()))
        .stability(0.5)
        .languageCode("en")
            .build()
    );
  }
}
```

### php

#### Installer

```bash
composer require runapi-ai/elevenlabs
```

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\Elevenlabs\ElevenlabsClient;

$client = new ElevenlabsClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$task = $client->textToDialogue->create([
  "dialogue" => [["text" => "Welcome to the show.", "voice" => "Adam"], ["text" => "Thanks for having me.", "voice" => "Brian"]],
  "stability" => 0.5,
  "language_code" => "en"
]);
```

## Guides associés

- [Authentification](https://runapi.ai/fr/docs/guides/authentication.md)
- [Démarrage rapide](https://runapi.ai/fr/docs/guides/task-api/quickstart.md)

---

## Plus de ressources de RunAPI

- [Accueil](https://runapi.ai/fr/.md)
- [Catalogue de modèles](https://runapi.ai/fr/models.md)
- [Tarifs](https://runapi.ai/fr/pricing.md)
- [Fournisseurs](https://runapi.ai/fr/models)
- [Documentation](https://runapi.ai/fr/docs/guides)
- [SDK](https://runapi.ai/fr/sdk.md)
- [CLI](https://runapi.ai/fr/cli.md)
- [Serveur MCP](https://runapi.ai/fr/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/fr/claude-code-vs-cursor.md)
- [Configuration de l’API Cursor](https://runapi.ai/fr/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/fr/openrouter-alternative.md)
- [Entreprise](https://runapi.ai/fr/contact.md)
- [Contact](https://runapi.ai/fr/contact.md)
- [Conditions](https://runapi.ai/fr/terms.md)
- [Confidentialité](https://runapi.ai/fr/privacy.md)
- [Index du site pour les agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Données structurées

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "fr",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/fr",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/fr/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "fr",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/fr",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/fricon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "fr",
    "@type": "TechArticle",
    "headline": "ElevenLabs Texte en dialogue",
    "description": "Utilisez le point de terminaison texte vers dialogue pour créer une tâche asynchrone.",
    "url": "https://runapi.ai/fr/docs/api/elevenlabs/text-to-dialogue",
    "mainEntityOfPage": "https://runapi.ai/fr/docs/api/elevenlabs/text-to-dialogue"
  }
]
```
