DEV Community

APIKO AI API
APIKO AI API

Posted on

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 the standard OpenAI SDK; only the base URL and the key change.

1. Get a key

Create an API key at apiko.app. Billing is pay as you go in USD: credit packs start at $5, the balance works on every model and does not expire, and there is no subscription.

export APIKO_API_KEY=sk-...
Enter fullscreen mode Exit fullscreen mode

2. Point the OpenAI SDK at APIKO

Python:

# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.apiko.app/v1", api_key=os.environ["APIKO_API_KEY"])

reply = client.chat.completions.create(
    model="gpt-6-astra",
    messages=[{"role": "user", "content": "In one sentence, what is an API gateway?"}],
)
print(reply.choices[0].message.content)
Enter fullscreen mode Exit fullscreen mode

Node.js:

// npm install openai
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.apiko.app/v1", apiKey: process.env.APIKO_API_KEY });

const reply = await client.chat.completions.create({
  model: "gpt-6-astra",
  messages: [{ role: "user", content: "In one sentence, what is an API gateway?" }],
});
console.log(reply.choices[0].message.content);
Enter fullscreen mode Exit fullscreen mode

Plain HTTP works too:

curl https://api.apiko.app/v1/chat/completions \
  -H "Authorization: Bearer $APIKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek-v4-flash", "messages": [{"role": "user", "content": "Hello!"}]}'
Enter fullscreen mode Exit fullscreen mode

3. Switch models by changing one string

Because every model sits behind the same endpoint, comparing models is a loop:

for model in ["gpt-6-astra", "claude-sonnet-5-5", "gemini-3.5-flash", "deepseek-v4-flash"]:
    reply = client.chat.completions.create(
        model=model,
        messages=[{"role": "user", "content": "Explain rate limiting in one sentence."}],
    )
    print(f"{model}: {reply.choices[0].message.content}")
Enter fullscreen mode Exit fullscreen mode

The model ids come from the model marketplace, which shows live prices and availability for every model, measured from real calls and scheduled probes. That makes it easy to check what a model costs before you put it in production.

4. What you get on top of a plain proxy

  • One key, one balance, one bill instead of separate provider accounts.
  • Automatic routing and failover when an upstream provider has trouble.
  • Automatic refunds on failed calls: when an upstream call fails, the amount held for it goes back to your balance.
  • Works with existing tools: the official OpenAI SDKs, LangChain, LlamaIndex, or anything else that speaks the OpenAI API.

Wrap-up

If your app already uses the OpenAI SDK, trying other models is a two-line change: set base_url to https://api.apiko.app/v1 and swap in an APIKO key. The full set of runnable examples is in this gist, and the docs are at apiko.app/docs.

Top comments (0)