Call GPT, Claude, Gemini and DeepSeek with one OpenAI-compatible API
Most AI projects end up talking to more than one model provider. One model is cheaper for drafts, another is better at code, a third handles images. Every extra provider means another account, another API key, another balance to top up and another SDK quirk to learn. This post shows how to call models from several providers through one OpenAI-compatible endpoint, using APIKO AI API . The code is…
An OpenAI-compatible API can be used to call models from multiple providers through a single endpoint, simplifying the process of working with different AI models. To do this, create an API key at apiko.app, which offers pay-as-you-go billing with credit packs starting at $5, no subscription required, and no expiration on the balance.
Install the OpenAI Python SDK, set the base URL to https://api.apiko.app/v1, and provide the API key as an environment variable. Create a chat completion request using the desired model, such as gpt-6-astra, and print the model's response. Repeat the process with other models, like claude-sonnet-5-5, gemini-3.5-flash, and deepseek-v4-flash, by changing the model ID in the request.
The code remains largely the same, with only the base URL and model ID changing. This approach consolidates multiple provider accounts into one, automates routing and failover, offers automatic refunds for failed calls, and integrates seamlessly with existing OpenAI SDK tools.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.