# Transcripción de voz

**API:** Model API

**Endpoint:** `POST /api/v1/audio/transcriptions`

**Tags:** Audio

Envíe `model` y `file` como `multipart/form-data`: WAV PCM mono completo, máximo 25,000,000 bytes, sujeto a límites de frecuencia y duración del canal. Opcionales: `language` (dos letras minúsculas, p. ej. `es`) y `response_format=json` (único formato y predeterminado). curl debe generar boundary. No se admiten URL, ID de archivo, `prompt`, marcas de tiempo ni `stream`.

STT usa `input_audio_second` o tokens; TTS usa `input_character`. En `speech_billing_unit`, `utf16_code_unit` y `unicode_code_point` cuentan emoji de forma distinta. La reserva no es un límite de gasto; la liquidación puede ser asíncrona. La falta de pruebas no significa coste cero. Ambos aceptan `X-Felo-Channel` y envían una vez al canal elegido. Desactive reintentos automáticos, también del SDK, tras timeout o desconexión. Conserve `X-Request-Id` y el `X-Generation-Id` disponible. Console Playground aún no admite audio. `configured_rates` usa tarifas congeladas y uso verificado; `upstream_cost` usa el coste verificado del proveedor con el recargo y descuento publicados.

## Base URL

- `https://openapi.felo.ai` — Producción

## Authentication

- `FeloBearerAuth` (http bearer) — Clave de API de Felo enviada como `Authorization: Bearer <key>`.
- `FeloApiKey` (apiKey in header `X-API-Key`) — Clave de API de Felo enviada como `X-API-Key: <key>`.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `X-Felo-Channel` | header | no | string, default: "default" | Ordered comma-separated public channel codes. Omit this header to use default; default must be used alone. In wallet mode, default scans the model's effective public channel order in reverse, skips unpublished or unavailable channels, and uses the first eligible channel. Explicit codes follow the supplied order. For stateless Chat Completions, Messages and Responses, the server may try another selected channel or provider group after a confirmed upstream rejection. A single explicit channel limits routing to that channel. Legacy provider headers cannot override channel routing. |

## Request body

Required: **yes**

### multipart/form-data

Schema:

```json
{
  "type": "object",
  "required": [
    "model",
    "file"
  ],
  "additionalProperties": false,
  "properties": {
    "model": {
      "type": "string",
      "example": "grok-stt-2.0"
    },
    "file": {
      "type": "string",
      "format": "binary",
      "description": "A mono PCM WAV file, up to 25,000,000 bytes. The selected endpoint may impose additional sample rate or duration limits."
    },
    "language": {
      "type": "string",
      "pattern": "^[a-z]{2}$"
    },
    "response_format": {
      "type": "string",
      "enum": [
        "json"
      ],
      "default": "json"
    }
  }
}
```

## Responses

### 200 — El JSON síncrono contiene `text` y opcionalmente `usage` en segundos o tokens. `usage.cost` es el coste del proveedor, no el cargo final Felo. No hay que consultar una tarea.

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string"
    },
    "usage": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "seconds": {
          "type": "number",
          "minimum": 0,
          "description": "Duration reported by the selected channel."
        },
        "type": {
          "type": "string",
          "enum": [
            "duration",
            "tokens"
          ]
        },
        "input_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "output_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "total_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "input_token_details": {
          "type": "object",
          "properties": {
            "text_tokens": {
              "type": "integer",
              "minimum": 0
            },
            "audio_tokens": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "cost": {
          "type": "number",
          "minimum": 0,
          "description": "Reported upstream cost in USD."
        }
      }
    }
  }
}
```

### 400 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```

### 402 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```

### 413 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```

### 415 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```

### 429 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```

### 500 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```

### 502 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```

### 503 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```

### 504 — Upload, wallet or upstream error

**application/json**

Schema: object

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}
```
