# Transcription vocale

**API:** Model API

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

**Tags:** Audio

Envoyez `model` et `file` en `multipart/form-data` : WAV PCM mono complet, au plus 25,000,000 octets, avec les limites de fréquence et de durée du canal. Champs facultatifs : `language` (deux lettres minuscules, par exemple `fr`) et `response_format=json` (seul format, également par défaut). Laissez curl générer la boundary. URL, ID de fichier, `prompt`, horodatages et `stream` ne sont pas pris en charge.

STT utilise `input_audio_second` ou des tokens ; TTS utilise `input_character`. Dans `speech_billing_unit`, `utf16_code_unit` et `unicode_code_point` comptent différemment les emoji. La réservation n'est pas un plafond ; le règlement peut être asynchrone. Un manque de preuves ne signifie pas gratuité. Les deux API acceptent `X-Felo-Channel` et envoient une seule fois au canal choisi. Désactivez les tentatives automatiques, SDK compris, après délai dépassé ou coupure. Conservez `X-Request-Id` et, si disponible, `X-Generation-Id`. Console Playground ne prend pas encore en charge l'audio. `configured_rates` utilise les tarifs figés et l’usage vérifié ; `upstream_cost` utilise le coût fournisseur vérifié avec la majoration et la remise publiées.

## Base URL

- `https://openapi.felo.ai` — Production

## Authentication

- `FeloBearerAuth` (http bearer) — Clé API Felo envoyée dans l'en-tête `Authorization: Bearer <key>`.
- `FeloApiKey` (apiKey in header `X-API-Key`) — Clé API Felo envoyée dans l'en-tête `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 — Le JSON synchrone contient `text` et éventuellement `usage` en secondes ou tokens. `usage.cost` est le coût fournisseur, pas le débit final Felo. Aucune tâche à interroger.

**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"
          ]
        }
      }
    }
  }
}
```
