LiveKit Agents supports pluggable LLM backends. Because OpenDunes is OpenAI-compatible, you can use the openai plugin and point it at the OpenDunes base URL — giving your LiveKit voice or video agent access to the full model catalog, billed in Algerian Dinars.
pip install livekit-agents livekit-plugins-openai
import os
from livekit.plugins import openai as lk_openai
llm = lk_openai.LLM(
model="anthropic/claude-sonnet-5",
api_key=os.environ["OPENDUNES_API_KEY"],
base_url="https://opendunes.com/api/v1",
)
import os
import asyncio
from livekit.agents import (
Agent,
AgentSession,
JobContext,
WorkerOptions,
cli,
)
from livekit.plugins import openai as lk_openai, silero
def make_agent() -> Agent:
llm = lk_openai.LLM(
model="anthropic/claude-sonnet-5",
api_key=os.environ["OPENDUNES_API_KEY"],
base_url="https://opendunes.com/api/v1",
)
return Agent(
instructions="You are a friendly voice assistant. Answer clearly and briefly.",
llm=llm,
)
async def entrypoint(ctx: JobContext):
await ctx.connect()
agent = make_agent()
session = AgentSession(
vad=silero.VAD.load(),
)
await session.start(ctx.room, agent=agent)
await asyncio.sleep(600)
if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
For real-time voice applications, prefer lower-latency models. Check the catalog at /models and filter by latency or price. The meta-llama/llama-4-maverick family tends to have faster time-to-first-token than very large models.
llm = lk_openai.LLM(
model="meta-llama/llama-4-maverick",
api_key=os.environ["OPENDUNES_API_KEY"],
base_url="https://opendunes.com/api/v1",
)
For agents that process both audio and vision inputs, pick a model with the vision capability. Filter the catalog with GET /api/models?capability=vision.
llm = lk_openai.LLM(
model="google/gemini-2.5-pro",
api_key=os.environ["OPENDUNES_API_KEY"],
base_url="https://opendunes.com/api/v1",
)
- OpenDunes streams responses via SSE. LiveKit's OpenAI plugin handles streaming natively.
- Balance is deducted per token. Monitor remaining credits via the
X-Balance-Available response header or from your dashboard.
- If a request returns
402 insufficient_credits, top up your balance in DA from the billing page.