Cloudeflare AI gateway intregation like openrouter
Feature Type
Nice to have
Feature Description
livekit have openai extended plugin like openai.with_openrouter so like this way it will be openai.with_cloudflare
Workarounds / Alternatives
No response
Additional Context
No response
Opened #6131 to add this.
It adds openai.LLM.with_cloudflare(...), routing through the Cloudflare AI Gateway's unified OpenAI-compatible (/compat) endpoint:
from livekit.plugins import openai
llm = openai.LLM.with_cloudflare(model="openai/gpt-4o") # account_id + token from env
- Builds the gateway URL from
account_id(envCLOUDFLARE_ACCOUNT_ID) +gateway_id(default"default"), with abase_urloverride. - Dual auth:
cf_aig_token→cf-aig-authorization,api_key→Authorization(BYOK). - Optional
gateway_optionsfor per-request caching / retries / timeout / metadata / custom cost, mapped to thecf-aig-*headers.
Feedback welcome.
If you're looking for an OpenRouter-like integration for LiveKit Agents, Vynex API provides one OpenAI-compatible endpoint for 34+ models (GPT-4o, Claude, DeepSeek, Qwen, GLM). HK company, USDT payment, bulk pricing.
LiveKit Agents already supports OpenAI-compatible providers via base_url, so it would be a drop-in: set base_url=https://llm-api.vynexcloud.com/v1 and call any model by name. This gives you multi-model routing without adding a separate gateway layer.