> ## Documentation Index
> Fetch the complete documentation index at: https://docs.menuia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Áudio para Texto

## Descricao

Este endpoint permite transcrever arquivos de audio para texto. O arquivo pode ser enviado como URL ou como base64, e a API retornara o texto transcrito.

### Parametros

<ParamField body="authkey" type="string" required>
  Chave de autenticacao da API.
</ParamField>

<ParamField body="audio" type="string" required>
  O arquivo de audio a ser processado, que pode ser enviado como URL ou em formato base64.
</ParamField>

<ParamField body="format" type="string" required>
  O formato do audio, como "mp3", "wav", "ogg", etc.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://textscan.menuia.com/api/voice \
    -H "Content-Type: application/json" \
    -d '{
      "authkey": "SUA_AUTHKEY_AQUI",
      "audio": "https://exemplo.com/audio.mp3",
      "format": "mp3"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://textscan.menuia.com/api/voice', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      authkey: 'SUA_AUTHKEY_AQUI',
      audio: 'https://exemplo.com/audio.mp3',
      format: 'mp3'
    })
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://textscan.menuia.com/api/voice',
      json={
          'authkey': 'SUA_AUTHKEY_AQUI',
          'audio': 'https://exemplo.com/audio.mp3',
          'format': 'mp3'
      }
  )
  ```

  ```php PHP theme={null}
  $response = Http::post('https://textscan.menuia.com/api/voice', [
      'authkey' => 'SUA_AUTHKEY_AQUI',
      'audio' => 'https://exemplo.com/audio.mp3',
      'format' => 'mp3'
  ]);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Sucesso theme={null}
  {
    "status": 200,
    "message": "Audio transcrito com sucesso.",
    "text": "Transcricao do audio aparece aqui..."
  }
  ```

  ```json 401 - Erro de autenticacao theme={null}
  {
    "status": 401,
    "message": "Authkey invalida ou expirada."
  }
  ```

  ```json 400 - Erro de validacao theme={null}
  {
    "status": 400,
    "message": "Formato de audio nao suportado."
  }
  ```

  ```json 422 - Erro de processamento theme={null}
  {
    "status": 422,
    "message": "Nao foi possivel transcrever o audio."
  }
  ```
</ResponseExample>
