OpenAI compatibility
OpenAI SDK Setup
Use the official OpenAI SDKs, or any tool with an OpenAI-compatible speech setting, with Pascal models.
Set the base URL to https://api.pascalai.co/v1 and the API key to your Pascal key. Requests and responses use OpenAI's shapes. Each call runs as a normal Pascal job, so it costs the same as the native route and appears in your usage. The job id is in the X-Pascal-Job-Id response header.
Endpoints
POST /v1/audio/speech: text to speech with any Pascal text-to-speech model.POST /v1/audio/transcriptions: speech to text with any Pascal file speech-to-text model.POST /v1/audio/translations: speech in any language to English text, withwhisper-large-v3.GET /v1/audio/modelsandGET /v1/audio/voices?model=...: text-to-speech models and their voices. Open WebUI reads these for a custom endpoint.
Model and voice names
model is a Pascal model id, such as kokoro or whisper-large-v3-turbo. OpenAI model names such as tts-1 and whisper-1 return 400 model_not_found, because Pascal does not run those models and a response should name the model that made it.
voice is one of that model's own voices, from GET /v1/audio/voices?model=.... OpenAI voice names such as alloy work only on a model that has a voice with that name. Any other voice returns 400 invalid_voice with the model's list. A model with no voice choice ignores voice.
A setting the model does not have (for example speed or prompt) is ignored. A value outside the model's range returns 400.
Not supported
- Streaming:
stream_format: "sse"on speech andstream=trueon transcriptions return 400. For live audio, use the realtime sockets. - A request that takes more than 4 minutes returns 504
result_not_readywith the job id. Fetch the result withGET /v1/jobs/{id}. - Chat, embeddings, and image endpoints. Pascal is audio only.
Quickstart in Python
curl https://api.pascalai.co/v1/models \
-H "Authorization: Bearer $PASCAL_API_KEY"