Back to Blog
EnglishTutorial

One API Key for GPT, Claude and Gemini: A Practical Setup for Central Asia Developers

A practical tutorial for developers in Central Asia who want to call GPT, Claude and Gemini from one OpenAI-compatible API gateway.

C
Crazyrouter Team
May 22, 2026 / 1051 views
Share:
One API Key for GPT, Claude and Gemini: A Practical Setup for Central Asia Developers

One API Key for GPT, Claude and Gemini: A Practical Setup for Central Asia Developers#

Developers across Central Asia are building AI features for education, fintech, ecommerce, customer support, internal automation and developer tools. In many projects, the first version starts with one model provider. Very soon, the team wants to test another provider for cost, quality, language coverage or latency.

That is where integration complexity appears: separate API keys, SDKs, request formats and operational dashboards.

A practical alternative is to use one AI API gateway. Crazyrouter gives you one OpenAI-compatible endpoint and one API key, while still letting you call GPT, Claude and Gemini by changing the model name.

This guide walks through a minimal setup you can adapt for production.

When this setup helps#

Using one gateway is useful when you want to:

  • Prototype quickly without building separate provider integrations.
  • Compare GPT, Claude and Gemini with the same prompts.
  • Keep your backend code compatible with OpenAI-style SDKs.
  • Centralize secrets and usage tracking.
  • Add fallback models for important workflows.

It is especially helpful for small teams that need flexibility but do not want extra infrastructure work.

1. Create and store your key#

Start from the docs intro, then follow the quickstart to create your API key:

Set the key locally:

bash
export CRAZYROUTER_API_KEY="cr_..."

In production, store it in your deployment platform's secret manager instead of committing it to source control.

2. Make your first request in JavaScript#

Install the OpenAI SDK:

bash
npm install openai

Create a client with the Crazyrouter endpoint:

js
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.CRAZYROUTER_API_KEY,
  baseURL: "https://crazyrouter.com/v1",
});

const response = await client.chat.completions.create({
  model: "openai/gpt-4o-mini",
  messages: [
    { role: "system", content: "You are a helpful assistant for software developers." },
    { role: "user", content: "Give me a checklist for launching an AI feature." },
  ],
});

console.log(response.choices[0].message.content);

If your application already uses an OpenAI-compatible client, the main change is usually the API key and baseURL.

3. Switch models without changing the app flow#

Now try the same prompt with different providers:

js
const messages = [
  { role: "user", content: "Summarize this customer complaint in one sentence: The app keeps timing out during checkout." },
];

const models = [
  "openai/gpt-4o-mini",
  "anthropic/claude-3-5-haiku",
  "google/gemini-1.5-flash",
];

for (const model of models) {
  const completion = await client.chat.completions.create({ model, messages });
  console.log(`\n${model}:`);
  console.log(completion.choices[0].message.content);
}

This approach works well for prompt evaluation. Keep a small set of real examples from your product and compare outputs side by side.

4. Python version#

Python backend services can use the same OpenAI-compatible pattern:

python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["CRAZYROUTER_API_KEY"],
    base_url="https://crazyrouter.com/v1",
)

completion = client.chat.completions.create(
    model="anthropic/claude-3-5-haiku",
    messages=[
        {"role": "system", "content": "You are a technical writing assistant."},
        {"role": "user", "content": "Draft a short API changelog entry."},
    ],
)

print(completion.choices[0].message.content)

5. A simple production pattern#

For production, avoid sending every request directly from route handlers with no controls. Add a small wrapper around model calls:

js
export async function runAiTask({ model, messages, taskName }) {
  const startedAt = Date.now();

  try {
    const result = await client.chat.completions.create({ model, messages });

    console.log({
      taskName,
      model,
      latencyMs: Date.now() - startedAt,
      status: "ok",
    });

    return result.choices[0].message.content;
  } catch (error) {
    console.error({
      taskName,
      model,
      latencyMs: Date.now() - startedAt,
      status: "error",
      message: error.message,
    });

    throw error;
  }
}

This makes it easier to compare models and debug issues later.

Practical next step#

Choose one workflow where model quality is easy to inspect: summarization, support classification, translation, search query rewriting or internal report generation. Run a small evaluation across GPT, Claude and Gemini, then choose a default model based on your own data.

For the full setup path, use the Crazyrouter quickstart.

Implementation Guides

Podcast

AI Dev Tools: The Crazyrouter Podcast

Short episodes for developers on AI APIs, gateways, cost control and coding tools.

Latest episodes

  • EP196 · Oct 29, 2026 · 6:53

    AI API Security Posture — Turn Controls Into Continuous Evidence

    A practical guide to AI API security posture: inventory exposure, verify controls continuously, protect keys and data, constrain tools, and turn security assumptions into evidence that operators can act on.

  • EP195 · Oct 28, 2026 · 7:21

    AI API Policy Drift — Detect When Production Rules Stop Matching Intent

    A practical guide to policy drift in AI APIs: version routing and safety rules, detect stale enforcement, compare intended and observed behavior, and restore control before small gaps become incidents.

Episodes with written show notes →

Related Articles

OpenAI-Compatible API Base URL Explained: How to Configure Any AI ToolTutorial

OpenAI-Compatible API Base URL Explained: How to Configure Any AI Tool

The OpenAI API base URL is https://api.openai.com/v1. Learn what a base URL is, how to point Python, Node.js, curl, Cursor, Claude Code, Codex and other tools at an OpenAI-compatible gateway, and how to avoid the missing-/v1 mistake.

Jun 4
How to Get a Claude API Key in 2026 for Teams, CI, and RotationTutorial

How to Get a Claude API Key in 2026 for Teams, CI, and Rotation

Learn how to get a Claude API key in 2026, secure it for team environments, rotate credentials, and use a multi-provider fallback with Crazyrouter.

Mar 21
Character AI API Guide: Build Conversational AI Characters ProgrammaticallyTutorial

Character AI API Guide: Build Conversational AI Characters Programmatically

Complete guide to building conversational AI characters using APIs. Covers Character.AI alternatives, custom character creation with GPT and Claude

Feb 22
"How to Get a Claude API Key in 2026: Setup, Security, and First Request"Tutorial

"How to Get a Claude API Key in 2026: Setup, Security, and First Request"

"Learn how to get a Claude API key, configure authentication, send your first request, handle billing, and use a compatible gateway without exposing secrets."

Sep 20
AI API Gateway: Architecture, Features, and Vendor Selection GuideTutorial

AI API Gateway: Architecture, Features, and Vendor Selection Guide

Your GenAI feature can hit a wall fast: a free API tier may allow only 60 requests per minute, then return 429 errors during normal team testing. Moving to paid access may raise that to 600 request...

Mar 18
AI Video Generation APIs Guide 2026 - Sora 2, Veo3, Kling, Luma, and Runway ComparedTutorial

AI Video Generation APIs Guide 2026 - Sora 2, Veo3, Kling, Luma, and Runway Compared

Complete guide to AI video generation APIs including OpenAI Sora 2, Google Veo3, Kling 2.5, Luma Dream Machine, and Runway Gen-4. Code examples and pricing included.

Jan 22