Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosfreeCodeCamp.org: TimescaleDB Course – PostgreSQL for Time-Series Data(23.09.2026 um 12:30 Uhr)
Windows Tipps & SecurityAndroid 17: Rollout auf Samsung-Galaxy-Smartphones verzögert sich(23.09.2026 um 11:42 Uhr)
Unix & Linux ServerUSN-8733-2: Gzip vulnerabilities(22.09.2026 um 18:04 Uhr)
Sichere ProgrammierungHow to Build Custom PowerPoint Add-Ins for Enterprise Teams(23.09.2026 um 11:25 Uhr)
Sichere ProgrammierungSearch Google Jobs in Real-Time with Go and SerpApi 🚀(23.09.2026 um 12:13 Uhr)
Sichere ProgrammierungA Psychological State is a Coefficient Vector(23.09.2026 um 12:16 Uhr)
YouTube Security VideosfreeCodeCamp.org: TimescaleDB Course – PostgreSQL for Time-Series Data(23.09.2026 um 12:30 Uhr)
Windows Tipps & SecurityAndroid 17: Rollout auf Samsung-Galaxy-Smartphones verzögert sich(23.09.2026 um 11:42 Uhr)
Unix & Linux ServerUSN-8733-2: Gzip vulnerabilities(22.09.2026 um 18:04 Uhr)
Sichere ProgrammierungHow to Build Custom PowerPoint Add-Ins for Enterprise Teams(23.09.2026 um 11:25 Uhr)
Sichere ProgrammierungSearch Google Jobs in Real-Time with Go and SerpApi 🚀(23.09.2026 um 12:13 Uhr)
Sichere ProgrammierungA Psychological State is a Coefficient Vector(23.09.2026 um 12:16 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

I pointed the OpenAI SDK at one base URL and got Claude, GPT and Gemini

Here's the whole trick, up front. You keep the official OpenAI SDK, change the base URL, and the same client now talks to Claude, GPT and Gemini — you only swap the model string: Python from openai import OpenAI client = OpenAI( b…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Here's the whole trick, up front. You keep the official OpenAI SDK, change the base URL, and the same client now talks to Claude, GPT and Gemini — you only swap the model string:



Python




from openai import OpenAI

client = OpenAI(
base_url="https://api.airforce/v1",
api_key="YOUR_KEY",
)

for model in ["claude-sonnet-4.6", "gpt-5.1", "gemini-3-pro"]:
resp = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Say hi in one short sentence."}],
)
print(model, "->", resp.choices[0].message.content)






Same client, three providers, no if provider == ... branching. That's the part worth a blog post.



The reason this works is that api.airforce is an OpenAI-compatible gateway: one base URL (https://api.airforce/v1), one API key, and a single catalog of models you address by name. The pain it removes is the usual one — a separate account for each vendor, a separate SDK, a separate billing dashboard, and glue code to keep them apart. Here it's one of each.






1. The only change is the base URL



You don't learn a new SDK. You reuse the OpenAI one and change two lines.



TypeScript / JavaScript




import OpenAI from "openai";

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

const resp = await client.chat.completions.create({
model: "gpt-5.1", // or claude-sonnet-4.6, gemini-3-pro, ...
messages: [{ role: "user", content: "Give me a haiku about caching." }],
});
console.log(resp.choices[0].message.content);






curl




curl https://api.airforce/v1/chat/completions \
-H "Authorization: Bearer $AIRFORCE_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4.6",
"messages": [{"role": "user", "content": "Hello!"}]
}'







Want a different model? Change the model string — no new client, no new account, no new key. Model names follow each provider's own convention, and versions move, so treat the strings above as examples: the current list is GET https://api.airforce/v1/models (and the docs).






2. Not just chat — image, audio and video too



The same key reaches more than text models:





  • Text: Claude, GPT, Gemini, Llama, DeepSeek, Qwen and more


  • Image: Flux and other image-generation models


  • Audio: text-to-speech and transcription (there's a dubbing playground built on it)


  • Video: text-to-video generation



So a multi-modal app talks to one endpoint instead of stitching several vendors together. As always, check /v1/models for which ids are live before you wire one in.






3. Routing and failover



This is the part I actually care about more than the convenience. For a given model, the gateway routes across multiple upstream providers, so when one upstream returns a 429 or a 5xx, the call is retried on another provider transparently — you get one response back and don't see the failure. From your code it's still just one model name; the failover lives behind the base URL. That's the real difference from calling a single vendor directly, where a rate-limit on their side is your outage too.






4. Pricing: pay-as-you-go from $0



It's pay-as-you-go with a genuine free tier, so you're not forced into a monthly seat to try it — prototype on the free tier, then keep the exact same code in production. There are optional paid plans on top if you want them, but nothing stops you from starting at $0.






"Isn't this just OpenRouter?"



Same category — a multi-provider, OpenAI-compatible gateway — and if you've used OpenRouter the mental model is identical: point your client at one URL, address many models by name. I'm not going to pretend OpenRouter isn't good; it does at-cost passthrough pricing with a small credit fee and has a solid set of free models, and plenty of people are happy on it.



What api.airforce leans on are a large free tier with light limits, text + image + audio + video under one key, the cross-provider failover above, and official client libraries in several languages if you'd rather not use the raw OpenAI client (TypeScript, Python, Go, Java, C#, Rust, Dart, PHP — see the docs for the current set). I'm deliberately not making a blanket "it's cheaper" claim: prices move per model on every gateway, so if cost is your deciding factor, compare the specific model you'll actually use, on the day you choose, against whatever you run now. The honest takeaway is narrower: the unified-gateway pattern itself saves you a lot of glue code, whichever provider you land on.






Try it





If you're already on a gateway or wiring providers up by hand, swapping the base URL is a five-minute experiment. How are you handling cross-provider failover today — retries in app code, a gateway, or just eating the occasional 429? Curious how others do it.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten I pointed the OpenAI SDK at one base URL and got Claude, GPT and Gemini

Thematisch verwandte Begriffe: pointed, OpenAI, base, Claude · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-19438 | Improper Limitation of a Pathname to a Restricted Directory ('Path Trave…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick