> ## Documentation Index
> Fetch the complete documentation index at: https://inference-docs.cerebras.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Make your first Cerebras API call in under 5 minutes.

Make your first API call and see what inference at thousands of tokens per second feels like. Already familiar with LLM APIs? Skip straight to the [API reference](/api-reference/chat-completions) or try the [playground](https://cloud.cerebras.ai?utm_source=3pi_quickstart\&utm_campaign=docs).

## Prerequisites

To complete this guide, you will need:

* A Cerebras account ([sign up free](https://cloud.cerebras.ai?utm_source=3pi_quickstart\&utm_campaign=docs))
* A Cerebras Inference API key
* Python 3.10+ or TypeScript 4.5+

<Steps>
  <Step title="Set up your API key">
    Visit the [Cloud Console](https://cloud.cerebras.ai?utm_source=3pi_quickstart\&utm_campaign=docs) and navigate to **API Keys** in the left nav bar to create a key.

    Set your API key as an environment variable so you don't have to pass it with every request:

    <CodeGroup>
      ```bash macOS / Linux theme={null}
      export CEREBRAS_API_KEY="your-api-key-here"
      ```

      ```powershell Windows (PowerShell) theme={null}
      $env:CEREBRAS_API_KEY = "your-api-key-here"
      ```

      ```bash Windows (CMD) theme={null}
      setx CEREBRAS_API_KEY "your-api-key-here"
      ```
    </CodeGroup>

    Confirm the variable is set:

    <CodeGroup>
      ```bash macOS / Linux theme={null}
      echo $CEREBRAS_API_KEY
      ```

      ```powershell Windows (PowerShell) theme={null}
      echo $env:CEREBRAS_API_KEY
      ```

      ```bash Windows (CMD) theme={null}
      echo %CEREBRAS_API_KEY%
      ```
    </CodeGroup>
  </Step>

  <Step title="Install the SDK">
    Install the Cerebras SDK for your language of choice. You can also call the API directly with cURL (see Step 3).

    <CodeGroup>
      ```bash Python theme={null}
      pip install --upgrade cerebras_cloud_sdk
      ```

      ```bash Node.js theme={null}
      npm install @cerebras/cerebras_cloud_sdk@latest
      ```
    </CodeGroup>
  </Step>

  <Step title="Make your first API request">
    Run the following code to send a chat completion request:

    <CodeGroup>
      ```python Python theme={null}
      import os
      from cerebras.cloud.sdk import Cerebras

      client = Cerebras(
          api_key=os.environ.get("CEREBRAS_API_KEY"),
      )

      chat_completion = client.chat.completions.create(
          messages=[
              {
                  "role": "user",
                  "content": "Why is fast inference important?",
              }
          ],
          model="llama3.1-8b",
      )

      print(chat_completion.choices[0].message.content)
      ```

      ```javascript Node.js theme={null}
      import Cerebras from '@cerebras/cerebras_cloud_sdk';

      const client = new Cerebras({
        apiKey: process.env['CEREBRAS_API_KEY'],
      });

      async function main() {
        const completion = await client.chat.completions.create({
          messages: [{ role: 'user', content: 'Why is fast inference important?' }],
          model: 'llama3.1-8b',
        });

        console.log(completion.choices[0].message.content);
      }

      main();
      ```

      ```cli cURL theme={null}
      curl https://api.cerebras.ai/v1/chat/completions \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer ${CEREBRAS_API_KEY}" \
        -d '{
          "model": "llama3.1-8b",
          "messages": [
            {"role": "user", "content": "Why is fast inference important?"}
          ]
        }'
      ```
    </CodeGroup>

    You should see a response like:

    ```
    Fast inference is important because it enables real-time interactions,
    reduces latency in production applications, and allows for more complex
    reasoning workflows within acceptable response times...
    ```

    <Tip>
      If you get a `401 Unauthorized` error, double-check that your `CEREBRAS_API_KEY` environment variable is set correctly.
    </Tip>
  </Step>
</Steps>

## Next Steps

* **Choose a model** — Find the right model for your use case in our [model selection guide](/models/choose-a-model).
* **Explore capabilities** — Add [streaming](/capabilities/streaming), [tool calling](/capabilities/tool-use), [structured outputs](/capabilities/structured-outputs), or [reasoning](/capabilities/reasoning) to your application.
* **Design for Cerebras** — Learn [architectural patterns](/resources/designing-for-cerebras) that take full advantage of wafer-scale inference.
* **Browse the API** — See all available endpoints and parameters in the [API reference](/api-reference/chat-completions).
