Set up your API key
Visit the Cloud Console and sign up or log in. Navigate to API Keys in the left nav bar to create a key. See API Keys for details.Set your API key as an environment variable so you don’t have to pass it with every request:Confirm the variable is set:
export and $env: set the variable for the current shell only. setx on Windows persists the variable, but you must open a new terminal window for it to take effect. To persist on macOS or Linux, add the export line to your ~/.zshrc, ~/.bashrc, or equivalent shell profile.Install the SDK
Install the Cerebras SDK for your language of choice. You can also call the API directly with cURL (see Step 3).
Common Errors
401 Unauthorized—CEREBRAS_API_KEYisn’t set in the shell running your code. Re-run theechocommand above in the same terminal to confirm. On Windows aftersetx, open a new terminal.404 model not found— ThemodelID is misspelled, deprecated, or not available on your account. See the full list of public models on the Models page.429 Too Many Requests— You’ve hit a rate limit. Free accounts have lower per-minute limits than paid accounts. See Rate limits for current quotas and how to request an increase.
Next Steps
- Choose a model — Find the right model for your use case in our model selection guide.
- Explore capabilities — Add streaming, tool calling, structured outputs, or reasoning to your application.
- Design for Cerebras — Learn architectural patterns that take full advantage of wafer-scale inference.
- Browse the API — See all available endpoints and parameters in the API reference.

