Migration Guides

Migrate from Google AI Studio / Vertex AI to Railwail

Switch from Google AI Studio or Vertex AI to Railwail. Drop the GCP SDK and call Gemini 2.5 Pro through the OpenAI SDK. 200+ models.

Railwail3 Min. Lesezeit

Mit KI-Unterstützung erstellt.

Migrate from Google AI Studio / Vertex AI to Railwail
01 · Das Wichtigste

TL;DR — Switch in Under 10 Minutes

  • Drop @google/generative-ai and google-cloud-aiplatform — use the OpenAI SDK instead
  • No GCP project, no service account JSON, no IAM roles — just an API key
  • Gemini 2.5 Pro and Gemini 3 Flash available through Chat Completions
  • 1M context window preserved; multimodal (image) inputs supported
  • Plus 200+ other models behind one API key

Auf Railwail ausprobieren

Gemini 2.5 Pro ausführen

Google DeepMind$ 1.50/1 Mio. InAbrechnung nach Verbrauch

Google's latest thinking model. Excels at reasoning, coding, math, and science with massive context window.

02

Why Move Off Google AI Studio / Vertex AI?

Google's Gemini is one of the most capable multimodal models on the market — but accessing it via Vertex AI requires a GCP project, service account credentials, IAM bindings, and a billing account. AI Studio is friendlier but rate-limited and not production-ready. Railwail exposes the same Gemini models through the standard OpenAI Chat Completions API with no GCP setup whatsoever.

Common migration triggers: avoiding GCP project sprawl, escaping AI Studio's free-tier RPM caps, and unifying Gemini calls with GPT-4o or Claude under one SDK.

03

Step 1 — Get a Railwail API Key

Create an account at railwail.com and generate a key in Dashboard → API Keys. No GCP project required.

04

Step 2 — Replace the Google SDK

TypeScript / JavaScript

Before (Google AI Studio):
JavaScript
import { GoogleGenerativeAI } from "@google/generative-ai";

const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY);
const model = genAI.getGenerativeModel({ model: "gemini-2.5-pro" });

const result = await model.generateContent("Hello Gemini");
console.log(result.response.text());
After (Railwail via OpenAI SDK):
JavaScript
import OpenAI from "openai";

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

const res = await client.chat.completions.create({
  model: "gemini-2.5-pro",
  messages: [{ role: "user", content: "Hello Gemini" }],
});
console.log(res.choices[0].message.content);
The mental model shift is small: instead of generateContent on a model object, you call chat.completions.create with a messages array. This is the same shape you would use for GPT-4o or Claude — one SDK, all models.
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["RAILWAIL_API_KEY"],
    base_url="https://railwail.com/api/v1",
)

resp = client.chat.completions.create(
    model="gemini-2.5-pro",
    messages=[{"role": "user", "content": "Hello Gemini"}],
)
print(resp.choices[0].message.content)
05

Step 3 — Multimodal Inputs (Images, Audio, Video)

Gemini's killer feature is native multimodality. On Railwail, multimodal inputs use the standard OpenAI vision schema (content array with image_url or input_audio blocks). Railwail translates to Gemini's native parts format internally.

JavaScript
const res = await client.chat.completions.create({
  model: "gemini-2.5-pro",
  messages: [{
    role: "user",
    content: [
      { type: "text", text: "What is in this image?" },
      { type: "image_url", image_url: { url: "https://example.com/img.jpg" } }
    ]
  }],
});
06

Step 4 — Function Calling / Tool Use

Gemini's function calling translates to the OpenAI tools schema. Define your tools as JSON Schema, set tool_choice, and read tool_calls off the response — Railwail handles the conversion to Gemini's tools.functionDeclarations format and back.

07

API Endpoint Mapping

Google AI endpoint → Railwail equivalent
Google directRailwail equivalentNotes
POST /v1beta/models/{model}:generateContentPOST /api/v1/chat/completionsSame call, OpenAI schema
POST /v1beta/models/{model}:streamGenerateContentPOST /api/v1/chat/completions (stream=true)SSE chunks
POST /v1beta/models/{model}:countTokensToken count via usage.* on responseReturned automatically
POST /v1beta/models/{model}:embedContentPOST /api/v1/embeddings—
GET /v1beta/modelsGET /api/v1/modelsFilter by provider=google
Vertex AI projects/{p}/locations/{l}/publishers/google/models/{m}:generateContentPOST /api/v1/chat/completionsNo GCP project needed
08

Gemini Model Mapping

Google model → Railwail model ID
Google AI / VertexLive auf RailwailRailwailNotes
gemini-2.5-pro$ 1.50/1 Mio. Ingemini-2-5-progemini-2.5-proFrontier, 1M context, multimodal
gemini-2.5-flash$ 0.60/1 Mio. Ingemini-3-flashgemini-3-flashFast, cost-efficient
09

Why Railwail Over Google AI Studio / Vertex

  • No GCP project — just an API key
  • OpenAI-compatible SDK — unify Gemini calls with GPT-4o and Claude in one client
  • Higher default rate limits than AI Studio's free-tier
  • 1M context, multimodal, function calling — all preserved
  • Built-in playground to A/B Gemini vs other models on the same prompt
10

FAQ

Do I lose Gemini's 1M context window?

No. The full 1M-token context is available on gemini-2.5-pro through Railwail. Tiered pricing above 200k tokens is also passed through.

What about Gemini's grounding with Google Search?

Search grounding is a Vertex-specific feature that requires GCP-side configuration. Railwail does not currently expose it directly.

Is Gemini Live / real-time streaming supported?

Standard token streaming via SSE is supported.

Where is the data processed?

Railwail does not offer EU data residency; the models run at the providers, mostly in the US.

11

Next Steps

  • Create your Railwail account at railwail.com
  • Generate an API key in Dashboard → API Keys
  • Replace @google/generative-ai with the OpenAI SDK in your code
  • Update baseURL to https://railwail.com/api/v1
  • Read the full API reference at railwail.com/docs
  • Browse Gemini models at railwail.com/models?provider=google
  • Compare per-token pricing at railwail.com/pricing
Live

Modelle in diesem Artikel

Aktuelle Preise nach den Railwail-Preisregeln, Stand 5. Dezember 2026.

  • Gemini 2.5 ProGoogle DeepMind
    $ 1.50 / 1 Mio. Input-Token$ 12.00/1 Mio. Out
    1K Eingabe + 500 Ausgabe-Tokens: ≈ $ 0.0075
    Ausprobieren
  • Gemini 3 FlashGoogle DeepMind
    $ 0.60 / 1 Mio. Input-Token$ 3.60/1 Mio. Out
    1K Eingabe + 500 Ausgabe-Tokens: ≈ $ 0.0024
    Ausprobieren
  • GPT-4oOpenAI
    $ 3.00 / 1 Mio. Input-Token$ 12.00/1 Mio. Out
    1K Eingabe + 500 Ausgabe-Tokens: ≈ $ 0.0090
    Ausprobieren

≈ abgerechnet nach tatsächlichen Tokens bzw. GPU-Zeit

Nächster Schritt

Gemini 2.5 Pro auf Railwail ausprobieren

Mit Google anmelden und 10 Gratis-Credits erhalten (nutzbar 24 Stunden nach der Anmeldung, Läufe bis 2 Credits) oder ab $ 5.00 aufladen. Nicht genutztes Guthaben verfällt nicht.

ThemenGoogleGeminiVertex AIMigrationAPIAI Studio