DEV Community

半年游
半年游

Posted on

Keep Your OpenAI SDK: Use a Compatible API Gateway and Just Change the Base URL

#ai

Many teams start with OpenAI's SDK and later need other model providers. Instead of rewriting integration code, an OpenAI-compatible API gateway lets you keep your SDK and change only the base URL.

KeyoAPI provides a single prepaid key for GPT-class, Claude-class, Gemini-class, DeepSeek and open-source models, covering text, image, voice and video APIs. You can review the KeyoAPI OpenAI rates on its pricing page before you switch, then point your existing SDK at the new endpoint.

from openai import OpenAI
client = OpenAI(base_url="https://www.keyoapi.xyz/v1", api_key="YOUR_KEY")
Enter fullscreen mode Exit fullscreen mode

Transparent per-model rates start at $0.01 per million tokens, with no subscription or minimum commitment, so teams can prototype with many models and keep costs predictable.

Top comments (0)