Skip to main content
The Camb AI Python SDK is designed to provide a flexible and powerful interface to the Camb AI API. It supports both Synchronous and Asynchronous programming models.

Python SDK:

Github Link: Camb AI Python SDK Installation Command:
pip install camb-sdk
Link to Examples: Camb AI Python SDK Examples

Node SDK:

Github Link: Camb AI Node SDK

Core Components

1. AsyncCambAI (Asynchronous Client)

The non-blocking client built on httpx.AsyncClient and asyncio. Ideal for web servers (FastAPI, Sanic), real-time applications, and high-concurrency scenarios.
from camb.client import AsyncCambAI
client = AsyncCambAI(api_key="...")

2. CambAI (Synchronous Client)

The standard blocking client. Use this for scripts, data processing pipelines, or applications where concurrency is managed via threads or isnโ€™t a priority.
from camb.client import CambAI
client = CambAI(api_key="...")

Supported Models & Architecture

MARS Pro (48kHz)

The flagship model. It consists of two main stages:
  1. Prosody Model: Generates the rhythm, stress, and intonation of speech.
  2. Decoder: Converts these features into high-fidelity 48kHz audio.

MARS Flash (22.05kHz)

A distilled, faster version of MARS.
  • Lower Latency: optimized for near-real-time responses.
  • Sample Rate: 22.05kHz.

MARS Instruct (22.05kHz)

Designed for fine-grained control over the output.
  • Instruction Following: Can take specific style or tone instructions.

Handling Streaming Responses

Both clients support streaming to handle large audio files efficiently or play audio as it generates.
  • Sync: Returns a standard Iterator[bytes].
  • Async: Returns an AsyncIterator[bytes].