> For clean Markdown of any page, append `.md` to the page URL. > For a complete documentation index, see https://docs.sarvam.ai/llms.txt. > For full documentation content in one file, see https://docs.sarvam.ai/llms-full.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server. # Migrating from Cartesia: Overview > Common setup changes for teams moving from Cartesia to Sarvam: base URL, auth header, SDK client, and error handling, shared across every guide in this section. *Last updated: July 15, 2026* This page covers the setup changes that stay the same no matter which of your existing Cartesia 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: #### Before (Cartesia) ```python from cartesia import Cartesia client = Cartesia(api_key="YOUR_CARTESIA_API_KEY") ``` #### After (Sarvam) ```python from sarvamai import SarvamAI client = SarvamAI(api_subscription_key="YOUR_SARVAM_API_KEY") ``` Both SDKs are also available for TypeScript/JavaScript; see [SDKs & Libraries](/api/getting-started/sdks) 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: #### Before (Cartesia) ```bash curl -X POST "https://api.cartesia.ai/..." \ -H "Authorization: Bearer YOUR_CARTESIA_API_KEY" \ -H "Cartesia-Version: 2026-03-01" ``` #### After (Sarvam) ```bash curl -X POST https://api.sarvam.ai/... \ -H "api-subscription-key: YOUR_SARVAM_API_KEY" ``` ## Base URL and auth | | Cartesia | Sarvam | | ------------------- | --------------------------------- | --------------------------------- | | Base URL | `https://api.cartesia.ai` | `https://api.sarvam.ai` | | Auth header | `Authorization: Bearer ` | `api-subscription-key: ` | | Auth failure status | `401` | `403` | > **Note** > > Cartesia's raw HTTP API also expects a `Cartesia-Version` date header (e.g. `2026-03-01`) to pin a request to a specific API version. Sarvam has no equivalent header: every request runs against the current API, so there's one less header to carry over when you port a direct HTTP call. ## 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](/api/getting-started/errors-troubleshooting) and [Credits & Rate Limits](/api/getting-started/ratelimits) for status codes and retry behavior. These apply the same way across every migration guide in this section. ## See also * [Migrating Text-to-Speech](/api/migrations/from-cartesia/text-to-speech) * [Migrating Speech-to-Text](/api/migrations/from-cartesia/speech-to-text) * [SDKs & Libraries](/api/getting-started/sdks) * [Errors & Troubleshooting](/api/getting-started/errors-troubleshooting) > Common setup changes for teams moving from Cartesia to Sarvam: base URL, auth header, SDK client, and error handling, shared across every guide in this section.