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

# Transcribe audio with a local runtime.

OpenAI-compatible speech-to-text. The local API takes the clip as inline base64 JSON (not multipart form data). Keep the encoded body small; the host agent caps the transcription body size. Pass a `model` id from `GET /v1/models`. 

` POST /v1/audio/transcriptions `

Transcribe audio with a local runtime.

OpenAI-compatible speech-to-text. The local API takes the clip as inline
base64 JSON (not multipart form data). Keep the encoded body small; the
host agent caps the transcription body size. Pass a `model` id from
`GET /v1/models`.


## Servers

- ` http://127.0.0.1:8831 ` — Default local host-agent listener.

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` LocalBearer `: ` http `

  - HTTP scheme: ` bearer ` (b3iq_local)

  - Local API key with local chat scope.

### Alternative 2

- ` LocalAPIKeyHeader `: ` apiKey `

  - Credential: ` X-B3IQ-API-Key ` in ` header `

  - Alternate header for local API keys.

### Alternative 3

- ` SetupBearer `: ` http `

  - HTTP scheme: ` bearer `

  - Setup token before operator configuration, or an authenticated operator session outside this spec.

### Alternative 4

- ` RouterSignedHeaders `: ` apiKey `

  - Credential: ` X-B3IQ-Router-Signature ` in ` header `

  - Router HMAC signature headers are used only by B3IQ router dispatch.

## Request body (required)

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` model `, ` audio `

  - ` model `: type ` string `

  - ` audio `: type ` string ` — Base64-encoded audio clip.

  - ` file_name `: type ` string `

  - ` language `: type ` string `

  - ` response_format `: type ` string `

  - ` duration_seconds `: type ` number ` — Client-reported clip duration, used for metering only.

  - ` runtime_id `: type ` string `

## Responses

### ` 200 ` — Transcription result.

Content type: ` application/json `

- ` value `: type ` object `

  - ` text `: type ` string `

### ` default ` — B3IQ-native problem response.

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` error `

  - ` error `: type ` object `

    - Required fields: ` status `, ` title `, ` detail `

    - ` status `: type ` integer `

    - ` title `: type ` string `

    - ` detail `: type ` string `

    - ` code `: type ` string ` — Stable B3IQ code when present. See docs/error-codes.md.

## Request examples

### cURL

```curl
curl -X POST 'http://127.0.0.1:8831/v1/audio/transcriptions' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "string",
  "audio": "string",
  "file_name": "string",
  "language": "string",
  "response_format": "string",
  "duration_seconds": 0,
  "runtime_id": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('http://127.0.0.1:8831/v1/audio/transcriptions', {
  method: 'POST',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "string",
    "audio": "string",
    "file_name": "string",
    "language": "string",
    "response_format": "string",
    "duration_seconds": 0,
    "runtime_id": "string"
  })
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.post('http://127.0.0.1:8831/v1/audio/transcriptions', headers=headers, json={
  "model": "string",
  "audio": "string",
  "file_name": "string",
  "language": "string",
  "response_format": "string",
  "duration_seconds": 0,
  "runtime_id": "string"
})
print(response.json())
```