from openai import OpenAI
client = OpenAI(
base_url="https://gateway.vlm.run/v1/openai",
api_key="<VLMRUN_API_KEY>",
)
with open("sample.mp3", "rb") as audio_file:
response = client.audio.transcriptions.create(
model="<transcription-model-id>",
file=audio_file,
)
print(response.text)
curl https://gateway.vlm.run/v1/openai/audio/transcriptions \
-X POST \
-H "Authorization: Bearer $VLMRUN_API_KEY" \
-F "model=<transcription-model-id>" \
-F "file=@sample.mp3"
import fs from "fs";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://gateway.vlm.run/v1/openai",
apiKey: process.env.VLMRUN_API_KEY,
});
const response = await client.audio.transcriptions.create({
model: "<transcription-model-id>",
file: fs.createReadStream("sample.mp3"),
});
console.log(response.text);
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}API Reference
Audio Transcriptions
OpenAI-compatible speech-to-text transcription
POST
/
v1
/
openai
/
audio
/
transcriptions
from openai import OpenAI
client = OpenAI(
base_url="https://gateway.vlm.run/v1/openai",
api_key="<VLMRUN_API_KEY>",
)
with open("sample.mp3", "rb") as audio_file:
response = client.audio.transcriptions.create(
model="<transcription-model-id>",
file=audio_file,
)
print(response.text)
curl https://gateway.vlm.run/v1/openai/audio/transcriptions \
-X POST \
-H "Authorization: Bearer $VLMRUN_API_KEY" \
-F "model=<transcription-model-id>" \
-F "file=@sample.mp3"
import fs from "fs";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://gateway.vlm.run/v1/openai",
apiKey: process.env.VLMRUN_API_KEY,
});
const response = await client.audio.transcriptions.create({
model: "<transcription-model-id>",
file: fs.createReadStream("sample.mp3"),
});
console.log(response.text);
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Send
Authorization: Bearer vlmrun for anonymous access. See
Rate Limits for per-tier quotas, which this route shares
with chat completions. For available transcription models, see Models.
Request parameters
The endpoint accepts a standard OpenAI multipart form:| Field | Type | Default | Description |
|---|---|---|---|
model | string | required | Transcription model id, e.g. nvidia/parakeet-tdt-0.6b-v3. |
file | file upload | optional | Audio bytes. Provide file or url. |
url | string | optional | Hosted audio URL, as an alternative to a multipart file upload. |
language | string | auto-detect | Language hint, e.g. en. The schema does not constrain the format; follows the OpenAI-compatible convention of an ISO-639-1 code. |
prompt | string | null | Optional context to bias transcription (e.g. spelled-out proper nouns). |
response_format | string | json | json, verbose_json, text, srt, or vtt, per the endpoint description. |
temperature | number | 0.0 | Sampling temperature for the transcription model. |
timestamp_granularities[] | array of strings | null | Accepted for OpenAI SDK compatibility; meaningful alongside response_format: "verbose_json" (segment and/or word). |
from openai import OpenAI
client = OpenAI(
base_url="https://gateway.vlm.run/v1/openai",
api_key="<VLMRUN_API_KEY>",
)
with open("sample.mp3", "rb") as audio_file:
response = client.audio.transcriptions.create(
model="<transcription-model-id>",
file=audio_file,
)
print(response.text)
curl https://gateway.vlm.run/v1/openai/audio/transcriptions \
-X POST \
-H "Authorization: Bearer $VLMRUN_API_KEY" \
-F "model=<transcription-model-id>" \
-F "file=@sample.mp3"
import fs from "fs";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://gateway.vlm.run/v1/openai",
apiKey: process.env.VLMRUN_API_KEY,
});
const response = await client.audio.transcriptions.create({
model: "<transcription-model-id>",
file: fs.createReadStream("sample.mp3"),
});
console.log(response.text);
Hosted URL instead of a file upload
Passurl instead of file when the audio is already hosted, to avoid a
multipart upload:
cURL
curl https://gateway.vlm.run/v1/openai/audio/transcriptions \
-X POST \
-H "Authorization: Bearer $VLMRUN_API_KEY" \
-F "model=<transcription-model-id>" \
-F "url=https://storage.googleapis.com/vlm-data-public-prod/hub/examples/audio.transcription-summary/two_minute_rules.mp3"
Related
Models
Available transcription models.
Error Codes
Status codes and response bodies for failed requests.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
Response
Successful Response