Python SDK
Official emini-ai client — one class per category, same field names as the API.
Installation
bash
pip install emini-aiUsage
python
from emini_ai import EminiAI
client = EminiAI(api_key="emk_live_...")
result = client.chat.completions.create(
messages=[{"role": "user", "content": "Bonjour"}],
model="claude-opus-5",
)
print(result.content)Streaming
python
for chunk in client.chat.completions.stream(
messages=[{"role": "user", "content": "Compte jusqu'a 10"}],
):
print(chunk.delta, end="")Async jobs (video)
python
generation = client.video.generate(prompt="un chat qui code")
job = generation.wait() # sonde /v1/jobs/{id} jusqu'a completion
print(job.result_url)Typed errors
python
from emini_ai import InsufficientCreditsError
try:
client.chat.completions.create(messages=[...])
except InsufficientCreditsError:
... # credits insuffisants sur le compte (402)See Error reference for the full list.
Context manager
python
with EminiAI(api_key="emk_live_...") as client:
...Synchronous client only for this first version (
httpx.Client) — an async variant may be added if a real need arises.Covered resources
chat, images, vision, embeddings, translation, audio, video, jobs, uploads, agents — one class per Gateway category.
Source code
sdks/python in the monorepo.