# Spracherkennung

**API:** Model API

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

**Tags:** Audio

Senden Sie `model` und `file` als `multipart/form-data`: vollständiges Mono-PCM-WAV, höchstens 25,000,000 Bytes, unter Beachtung der Abtastraten- und Dauergrenzen des Kanals. Optional: `language` (zwei Kleinbuchstaben, etwa `de`) und `response_format=json` (einziges Format und Standard). curl erzeugt die boundary. URLs, Datei-IDs, `prompt`, Zeitstempel und `stream` werden nicht unterstützt.

STT nutzt `input_audio_second` oder Tokens, TTS `input_character`. Bei `speech_billing_unit` zählen `utf16_code_unit` und `unicode_code_point` Emojis unterschiedlich. Reservierungen sind keine Kostenobergrenze; die Abrechnung kann asynchron erfolgen. Fehlende Belege bedeuten nicht kostenlos. Beide APIs akzeptieren `X-Felo-Channel` und senden einmal an den ausgewählten Kanal. Automatische Wiederholungen nach Timeout oder Abbruch auch im SDK deaktivieren. `X-Request-Id` und verfügbare `X-Generation-Id` aufbewahren. Console Playground unterstützt Audio noch nicht. `configured_rates` nutzt eingefrorene Tarife und bestätigte Nutzung; `upstream_cost` nutzt bestätigte Anbieterkosten mit veröffentlichtem Aufschlag und Rabatt.

## Base URL

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

## Authentication

- `FeloBearerAuth` (http bearer) — Felo-API-Schlüssel, gesendet als `Authorization: Bearer <key>`.
- `FeloApiKey` (apiKey in header `X-API-Key`) — Felo-API-Schlüssel, gesendet als `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 — Die synchrone JSON-Antwort enthält `text` und optional `usage` in Sekunden oder Tokens. `usage.cost` sind Anbieter-Kosten, nicht die endgültige Felo-Abbuchung. Kein Task-Polling nötig.

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