OpenAI SDK clients
OpenAI SDK clients
Soynade exposes a separate OpenAI-compatible surface for developers who want
familiar SDK clients and chat.completions response shapes while keeping
Soynade authentication, billing, quota enforcement, project attribution, and
observability.
Oolel Speech V1 is designed for text translation, speech recognition, speech translation, and streaming translation. Use the dedicated Soynade task endpoints when you want multipart file upload, async jobs, batch processing, or capability-shaped responses.
Shared Setup
Configure OpenAI SDK clients with Soynade's OpenAI-compatible base URL:
Code
Use your Soynade API key as the SDK API key:
Code
The surface publishes these endpoints:
| Endpoint | Purpose |
|---|---|
GET /openai/v1/models | List Soynade models available through the OpenAI-compatible surface. |
POST /openai/v1/chat/completions | Run a task-focused completion with JSON or SSE streaming responses. |
Current model:
Code
The supported wire protocol is chat.completions. This does not add native
OpenAI audio endpoints.
Python Setup
Install the OpenAI Python SDK:
Code
Create one shared client:
Code
Choose The Right Surface
| Use case | Recommended API |
|---|---|
| Capability-shaped text translation | POST /v1/translations |
| Multipart audio transcription | POST /v1/audio/transcriptions |
| Multipart speech translation | POST /v1/audio/translations |
| OpenAI SDK text translation | POST /openai/v1/chat/completions |
| OpenAI SDK hosted-audio recognition or translation | POST /openai/v1/chat/completions |
| Streaming translation | POST /openai/v1/chat/completions |
The dedicated task routes are capability-first and do not accept a model selector. The OpenAI-compatible surface is separate and requires the public model id.
Text Translation
For a translation-shaped response and capability-specific metering, use the
separate POST /v1/translations endpoint.
Speech Recognition
For speech recognition, use temperature: 0 so transcription is deterministic.
Start with a local audio file by encoding it as base64 and sending it through
an input_audio content part.
You can also send hosted audio through an audio_url content part.
For local multipart uploads or asynchronous jobs, use the separate audio transcription endpoints.
Speech Translation
For local multipart uploads or asynchronous jobs, use the separate speech translation endpoints.
Streaming Translation
Set stream=True with the Python client to receive incremental translation
chunks:
Audio Input Notes
The OpenAI-compatible surface accepts hosted audio URLs or small local files
encoded as data: URLs. It does not accept multipart file uploads. For larger
local files or production file-upload workflows, use:
Code
The OpenAI-compatible JSON request is limited to 70,000,000 decimal bytes.
All hosted, data-URL, and inline audio sources in one request share a
50,000,000-byte decoded-audio limit. See
Errors and limits for the complete table.
Usage And Billing
OpenAI-compatible requests are attributed to the API key and project that made the request. Usage appears in the Soynade dashboard as Oolel Speech V1 usage.
Billing is split into three meters:
| Meter | Unit |
|---|---|
| Oolel Speech V1 input | Input tokens |
| Oolel Speech V1 output | Output tokens |
| Oolel Speech V1 audio | Audio prompt seconds |
Dedicated product routes keep their capability-specific pricing:
| Product route | Meter |
|---|---|
| Text translation | Text translation characters |
| Audio transcription | ASR audio seconds |
| Speech translation | Speech translation audio seconds |
| Text to speech | TTS characters |
Compatibility Notes
- Use
oolel-speech-v1as the model id. - Continue using
client.chat.completions.create(...)for every example on this page. - Use
modalities: ["text"]in these task requests. stream: truereturnstext/event-stream.- Unsupported model ids return
model_not_found. - Missing credits return a billing error before inference starts.