Client options
apiKey → api_key, baseURL → base_url, maxRetries → max_retries.
Environment variables
The SDK uses
CROSMOS_BASE_URL. The MCP server uses CROSMOS_API_BASE_URL.Per-request options
Most SDK methods accept per-request overrides.AbortController (TypeScript) or client.with_options() (Python) when you need to cancel a request or create a scoped client copy:
Retries and timeouts
The SDK retries transient failures twice by default with exponential backoff and jitter. Retries apply to connection errors, request timeouts,408, 409, 429, and 5xx responses.
Disable retries globally:
Handling errors
Raw responses
Every resource method returns a typed response. Use helper methods when you need the underlying HTTP response..asResponse() (TypeScript) or .with_streaming_response (Python) when you only need the raw response without parsing:
Pydantic responses
Python response objects are Pydantic models. Use.to_dict() and .to_json() to serialize them.
Custom HTTP client
fetchOptions (TypeScript) for runtime-specific transport settings:
Runtime support
TypeScript: Uses the runtime’s globalfetch implementation by default. Supports modern browsers, Node.js 20 LTS or later, Bun 1.0 or later, Deno 1.28 or later, Cloudflare Workers, Vercel Edge Runtime, Jest with the node environment, and Nitro 2.6 or later. React Native is not supported.
Python: Supports Python 3.8 and later. Uses httpx for HTTP transport and pydantic for response validation. The AsyncCrosmos client uses anyio and is compatible with asyncio and trio. An optional aiohttp backend is available for projects already using aiohttp: