PydanticAI Integration

Create transcription (PydanticAI - OpenAI Whisper)

Transcribes audio into text using OpenAI Whisper via PydanticAI.

POST
/pydanticai/v1/audio/transcriptions
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

modelstring

Model identifier (e.g., whisper-1)

filefile

Audio file to transcribe

Formatbinary
language?string

Language of the audio (ISO 639-1)

prompt?string

Prompt to guide transcription

response_format?string
Value in"json" | "text" | "srt" | "verbose_json" | "vtt"
temperature?number
Range0 <= value <= 1
timestamp_granularities?array<string>
stream?boolean
fallbacks?array<string>

Response Body

curl -X POST "https://loading/{AI_GATEWAY_URL}/pydanticai/v1/audio/transcriptions" \  -F model="whisper-1" \  -F file="string"
{
  "duration": 0,
  "language": "string",
  "logprobs": [
    {
      "token": "string",
      "logprob": 0,
      "bytes": [
        0
      ]
    }
  ],
  "segments": [
    {
      "id": 0,
      "seek": 0,
      "start": 0,
      "end": 0,
      "text": "string",
      "tokens": [
        0
      ],
      "temperature": 0,
      "avg_logprob": 0,
      "compression_ratio": 0,
      "no_speech_prob": 0
    }
  ],
  "task": "string",
  "text": "string",
  "usage": {
    "type": "tokens",
    "input_tokens": 0,
    "input_token_details": {
      "text_tokens": 0,
      "audio_tokens": 0
    },
    "output_tokens": 0,
    "total_tokens": 0,
    "seconds": 0
  },
  "words": [
    {
      "word": "string",
      "start": 0,
      "end": 0
    }
  ],
  "extra_fields": {
    "request_type": "string",
    "provider": "openai",
    "model_requested": "string",
    "model_deployment": "string",
    "latency": 0,
    "chunk_index": 0,
    "raw_request": {},
    "raw_response": {},
    "cache_debug": {
      "cache_hit": true,
      "cache_id": "string",
      "hit_type": "string",
      "requested_provider": "string",
      "requested_model": "string",
      "provider_used": "string",
      "model_used": "string",
      "input_tokens": 0,
      "threshold": 0,
      "similarity": 0
    }
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
{
  "event_id": "string",
  "type": "string",
  "is_bifrost_error": true,
  "status_code": 0,
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "event_id": "string"
  },
  "extra_fields": {
    "provider": "openai",
    "model_requested": "string",
    "request_type": "string"
  }
}
On this page

On this page

No Headings