---
title: ElevenLabs Fala para texto | RunAPI
description: Use o endpoint de fala para texto para criar uma Task assíncrona.
url: https://runapi.ai/pt-BR/docs/api/elevenlabs/speech-to-text.md
canonical: https://runapi.ai/pt-BR/docs/api/elevenlabs/speech-to-text
locale: pt-BR
---

> Versão HTML: https://runapi.ai/pt-BR/docs/api/elevenlabs/speech-to-text
> Índice do site para agentes: https://runapi.ai/llms.txt

# ElevenLabs Fala para texto

## Visão geral

Use o endpoint de fala para texto com as entradas necessárias. Use o Task ID retornado para recuperar seu estado, ou forneça callback_url para as entregas documentadas abaixo.

### Início rápido

1. Crie uma Chave de API e defina-a como RUNAPI_API_KEY.
2. Envie uma requisição POST cujo corpo corresponda ao schema da requisição.
3. Armazene o ID da tarefa retornado e, em seguida, faça polling até atingir um estado terminal ou trate os callbacks documentados abaixo.

## Endpoint

POST /api/v1/elevenlabs/speech_to_text

URL base: https://runapi.ai

Versão da API: v1

Autenticação: Authorization: Bearer YOUR_API_TOKEN

## Modelos suportados

Abra uma página de modelo para ver preços atuais, limites de taxa e detalhes de uso comercial.

- [speech-to-text](https://runapi.ai/pt-BR/models/elevenlabs/speech-to-text)

## Esquema de solicitação

Envie apenas os campos documentados. Quando fornecido, callback_url recebe as entregas de Task documentadas abaixo.

### speech-to-text

```json
{
  "callback_url": {
    "type": "string"
  },
  "diarize": {
    "type": "boolean"
  },
  "language_code": {
    "type": "string"
  },
  "source_audio_url": {
    "required": true,
    "type": "string"
  },
  "tag_audio_events": {
    "type": "boolean"
  }
}
```

## Criar aceitação

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

### Esquema de resposta

```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
}
```

### Exemplo de resposta

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

## Consulta em processamento

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

### Esquema de resposta

```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
}
```

### Exemplo de resposta

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

## Consulta concluída

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

### Esquema de resposta

```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": [
        "completed"
      ],
      "type": "string"
    },
    "text": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "text",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

```json
{
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "completed",
  "text": "Welcome to RunAPI."
}
```

## Consulta falhou

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

### Esquema de resposta

```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
}
```

### Exemplo de resposta

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

## Callback do cliente: concluído

HTTP 200 - POST callback_url

### Esquema de resposta

```json
{
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    },
    "text": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "text"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

```json
{
  "id": "tsk_reference_demo",
  "status": "completed",
  "text": "Welcome to RunAPI."
}
```

## Callback do cliente: falhou

HTTP 200 - POST callback_url

### Esquema de resposta

```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
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "Mensagem de erro legível por humanos.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "Resumo de validação legível por humanos.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "Mensagens de validação com chaves por campo de requisição público, com um array de strings legíveis por humanos para cada campo.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Erros

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

### Esquema de resposta

```json
{
  "properties": {
    "error": {
      "description": "Mensagem de erro legível por humanos.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Exemplo de resposta

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

## Exemplos de Código Gerados

Use cURL diretamente ou instale um SDK para a sua linguagem. Cada exemplo submete a requisição validada mostrada nesta referência.

### curl

```curl
curl -X POST https://runapi.ai/api/v1/elevenlabs/speech_to_text \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"source_audio_url":"https://file.runapi.ai/source-audio.mp3","language_code":"en","diarize":true}'
```

### javascript

#### Instalar

```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.speechToText.create({
  "source_audio_url": "https://file.runapi.ai/source-audio.mp3",
  "language_code": "en",
  "diarize": true
});
```

### python

#### Instalar

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

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

client = ElevenlabsClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.speech_to_text.create(
  source_audio_url="https://file.runapi.ai/source-audio.mp3",
  language_code="en",
  diarize=True
)
```

### go

#### Instalar

```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.SpeechToText.Create(context.Background(), elevenlabs.SpeechToTextParams{
    SourceAudioURL: "https://file.runapi.ai/source-audio.mp3",
    LanguageCode: "en",
    Diarize: func(value bool) *bool { return &value }(true),
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = task
}
```

### ruby

#### Instalar

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

```ruby
require "runapi/elevenlabs"

client = RunApi::Elevenlabs::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
task = client.speech_to_text.create(
  source_audio_url: "https://file.runapi.ai/source-audio.mp3",
  language_code: "en",
  diarize: true
)
```

### java

#### Instalar

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

```java
import ai.runapi.elevenlabs.ElevenLabsClient;
import ai.runapi.elevenlabs.types.SpeechToTextParams;
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.speechToText().create(
        SpeechToTextParams.builder()
        .sourceAudioUrl("https://file.runapi.ai/source-audio.mp3")
        .languageCode("en")
        .diarize(true)
            .build()
    );
  }
}
```

### php

#### Instalar

```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->speechToText->create([
  "source_audio_url" => "https://file.runapi.ai/source-audio.mp3",
  "language_code" => "en",
  "diarize" => true
]);
```

## Guias Relacionados

- [Autenticação](https://runapi.ai/pt-BR/docs/guides/authentication.md)
- [Início rápido](https://runapi.ai/pt-BR/docs/guides/task-api/quickstart.md)

---

## Mais de RunAPI

- [Início](https://runapi.ai/pt-BR/.md)
- [Catálogo de modelos](https://runapi.ai/pt-BR/models.md)
- [Preços](https://runapi.ai/pt-BR/pricing.md)
- [Provedores](https://runapi.ai/pt-BR/models)
- [Documentação](https://runapi.ai/pt-BR/docs/guides)
- [SDKs](https://runapi.ai/pt-BR/sdk.md)
- [CLI](https://runapi.ai/pt-BR/cli.md)
- [Servidor MCP](https://runapi.ai/pt-BR/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/pt-BR/claude-code-vs-cursor.md)
- [Configuração da API do Cursor](https://runapi.ai/pt-BR/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/pt-BR/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/pt-BR/contact.md)
- [Contato](https://runapi.ai/pt-BR/contact.md)
- [Termos](https://runapi.ai/pt-BR/terms.md)
- [Privacidade](https://runapi.ai/pt-BR/privacy.md)
- [Índice do site para agentes](https://runapi.ai/llms.txt)

Contato: contact@runapi.ai

## Dados estruturados

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "pt-BR",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/pt-BR",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/pt-BR/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "pt-BR",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/pt-BR",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/pt-BRicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "pt-BR",
    "@type": "TechArticle",
    "headline": "ElevenLabs Fala para texto",
    "description": "Use o endpoint de fala para texto para criar uma Task assíncrona.",
    "url": "https://runapi.ai/pt-BR/docs/api/elevenlabs/speech-to-text",
    "mainEntityOfPage": "https://runapi.ai/pt-BR/docs/api/elevenlabs/speech-to-text"
  }
]
```
