Developer integration
SDK integration
Yomi API is fully compatible with the OpenAI API standard. Use the official OpenAI SDK and change only base_url and api_key to access all platform models.
Installation
Python
pip install openai
Node.js
npm install openai
Python call
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.yomiapi.com/v1"
)
response = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Explain the purpose of an API gateway in one sentence"}]
)
print(response.choices[0].message.content)
Node.js call
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "YOUR_API_KEY",
baseURL: "https://api.yomiapi.com/v1"
});
const completion = await client.chat.completions.create({
model: "deepseek-v4-flash",
messages: [{ role: "user", content: "Explain the purpose of an API gateway in one sentence" }]
});
console.log(completion.choices[0].message.content);
Streaming output
Set stream=True to receive content incrementally, suitable for chat interfaces and other uses requiring immediate feedback:
stream = client.chat.completions.create(
model="deepseek-v4-flash",
messages=[{"role": "user", "content": "Write a 100-character product introduction"}],
stream=True
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
Supported capabilities
- Function Calling: Define tools with the standard
toolsparameter; the model returns structured tool-call requests. - Multimodal input: Provide images through
image_urlcontent blocks with multimodal models such asclaude-sonnet-5. - Embeddings:
client.embeddings.creategenerates vectors using an available embedding model from the Model Catalog. - Audio: Transcription, translation and synthesis endpoints in the
/v1/audiofamily are all accessible through the SDK. - Responses API:
client.responsesis directly available; see OpenAI Responses API.
Both SDKs support environment variables. Set
OPENAI_API_KEY and OPENAI_BASE_URL to avoid hardcoding the key and address and to simplify switching environments.