Migrating from Gemini: Overview
Migrating from Gemini: Overview
This page covers the setup changes that stay the same no matter which of your existing Gemini integrations you’re moving over: base URL, auth header, and SDK client. Each product-specific migration guide already includes these same changes inline, so you don’t need to read this page first; it’s here as a standalone reference if you want the setup changes on their own.
Quick start
Swap the client, then keep the rest of your code as-is:
Both SDKs are also available for TypeScript/JavaScript; see SDKs & Libraries for install instructions and language coverage.
For requests made directly over HTTP rather than through an SDK, the only change is the header and base URL:
If your Gemini integration goes through the openai Python package pointed at Gemini’s OpenAI-compatible endpoint rather than the native google-genai SDK, see the base URL and auth swap for that specific path in the Chat Completion guide: Sarvam’s Chat Completions endpoint is OpenAI-compatible too, so that migration can be a two-line change.
Base URL and auth
Errors and rate limits
Sarvam returns 403 (not 401) on authentication failures, and rate limits are enforced per API rather than account-wide. See Errors & Troubleshooting and Credits & Rate Limits for status codes and retry behavior. These apply the same way across every migration guide in this section.