Skip to main content

Switch from OpenAI's transcription API

Loquela Remote takes the same requests as OpenAI's /v1/audio/transcriptions and answers in the same shapes. Code written for OpenAI's SDKs, including code that uses whisper-1 or gpt-4o-transcribe, works after two changes: the base URL and the API key.

The two changes​

  1. Base URL: https://api.getloquela.com/v1
  2. API key: a key from your account page, starting lqr_

The model name can stay. whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe and gpt-transcribe are accepted and use Loquela Remote's model; gpt-4o-transcribe-diarize also turns on speaker labels. New code can use loquela-remote-beta or leave the model out.

Python:

from openai import OpenAI

# Before: client = OpenAI()
client = OpenAI(base_url="https://api.getloquela.com/v1", api_key="lqr_...")

with open("call.mp3", "rb") as f:
result = client.audio.transcriptions.create(model="whisper-1", file=f)
print(result.text)

JavaScript:

import fs from "node:fs";
import OpenAI from "openai";

// Before: const client = new OpenAI();
const client = new OpenAI({ baseURL: "https://api.getloquela.com/v1", apiKey: "lqr_..." });

const result = await client.audio.transcriptions.create({
model: "whisper-1",
file: fs.createReadStream("call.mp3"),
});
console.log(result.text);

With environment variables, set OPENAI_BASE_URL=https://api.getloquela.com/v1 and OPENAI_API_KEY=lqr_...; OpenAI's SDKs read both.

What stays the same​

  • The multipart form: file, model, response_format, timestamp_granularities[], language (Transcribe).
  • The response formats: json, text, verbose_json (with word and segment timings), srt, vtt and diarized_json (Response formats).
  • The error shape, so the SDKs show our messages and raise their usual exception for each status. Each error also has a doc_url (Errors).
  • GET /v1/models answers for a valid key and returns 401 for a wrong one, so apps that check a key that way work.

What differs​

Loquela Remote
LanguagesEnglish, plus 24 European languages when they are on for your account. One language per request (language).
Who can sign upCustomers in the United States.
Upload sizeUp to 100 MB and 3 hours of audio per request (Limits).
Speaker labelsAt no extra cost: diarize=true, response_format=diarized_json or model=gpt-4o-transcribe-diarize (Speaker labels).
prompt, temperature, streamAccepted and ignored. The whole result comes back as one response.
TranslationNo /v1/audio/translations endpoint.
Live transcriptionNo realtime connection. Send a recording once it is finished.
NumbersWritten as digits ("8.3%", "$2.5 billion"). To keep the model's own wording, send written_numbers=false (in Python, extra_body={"written_numbers": False}). See Numbers.
Your audioHeld in memory while it is transcribed, then erased with the text. Neither is stored, so neither is used for training (how your audio is handled).
BillingBy the second, from plan or prepaid minutes (Account and minutes); prices on the pricing page.

Check the switch​

curl https://api.getloquela.com/v1/models -H "Authorization: Bearer lqr_..."

A valid key lists loquela-remote-beta. Then send a short recording and compare the text with what you got before. If something fails, the error message says what to do; Troubleshooting has fixes by symptom.

Apps with a settings screen for an OpenAI-compatible server (instead of code) are covered in Use in apps.