Official Python SDK for the Cerebras Cloud inference API. Provides access to ultra-fast LLM inference on Cerebras Wafer-Scale Engine hardware. OpenAI-compatible API surface. Generated with Stainless. Current version: 1.67.0 (Mar 2026). Requires Python 3.9+. Note: separate from cerebras-sdk (PyPI) which is a hardware kernel development tool — completely different product.
pip install cerebras-cloud-sdkVerified import paths — ran on the pinned version, not inferred.
Minimal Cerebras inference call using cerebras-cloud-sdk 1.x.
pip install cerebras-cloud-sdk for cloud inference. cerebras-sdk is for hardware kernel development.
client = Cerebras(api_key=..., warm_tcp_connection=False) — and reuse a single client instance rather than reconstructing.
Create a module-level singleton client. Do not instantiate Cerebras() inside request handlers or loops.
Use Python 3.9 or higher.
Use cerebras-cloud-sdk directly, not openai with base_url='https://api.cerebras.ai'.
Initialize the Cerebras client with client = Cerebras(api_key='YOUR_API_KEY') or set the CEREBRAS_API_KEY environment variable before running the application.
Set the CEREBRAS_API_KEY environment variable (e.g., `export CEREBRAS_API_KEY='your_api_key'`) or pass `api_key='your_api_key'` when instantiating the Cerebras client (e.g., `client = Cerebras(api_key='your_api_key')`).