Skip to main content
The Cerebras API uses API keys for authentication. Create and manage API keys from our Inference Cloud Console.
Keep your API key secure. Never share it publicly or include it in client-side code (such as browsers or mobile apps). Instead, load it safely from an environment variable or a server-side key management service.
API keys are passed using HTTP Bearer authentication:

Example Request

Using Official SDKs

You can also authenticate automatically when using the official SDKs for Python and Node.js by passing your API key during client initialization:

Set Your API Key

For security reasons, and to avoid configuring your API key each time, we recommend setting your API key as an environment variable. You can do this by running the following command in your terminal: