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 read

Created with AI assistance.

Migrate from Google AI Studio / Vertex AI to Railwail
01 ยท Key takeaways

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

Try it on Railwail

Run Gemini 2.5 Pro

Google DeepMind$1.50/1M inBilled by actual usage

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 on RailwailRailwailNotes
gemini-2.5-pro$1.50/1M ingemini-2-5-progemini-2.5-proFrontier, 1M context, multimodal
gemini-2.5-flash$0.60/1M 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

Models in this article

Live prices from Railwail's current rules, October 7, 2026.

  • Gemini 2.5 ProGoogle DeepMind
    $1.50 / 1M input tokens$12.00/1M out
    1K in + 500 out tokens: โ‰ˆ $0.0075
    Try
  • Gemini 3 FlashGoogle DeepMind
    $0.60 / 1M input tokens$3.60/1M out
    1K in + 500 out tokens: โ‰ˆ $0.0024
    Try
  • GPT-4oOpenAI
    $3.00 / 1M input tokens$12.00/1M out
    1K in + 500 out tokens: โ‰ˆ $0.0090
    Try

โ‰ˆ billed by actual tokens or GPU time

Next step

Try Gemini 2.5 Pro on Railwail

Sign in with Google for 10 free credits (usable 24 hours after sign-up, runs up to 2 credits), or top up from $5.00. Unused balance does not expire.

TopicsGoogleGeminiVertex AIMigrationAPIAI Studio