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

# Quickstart

> Step-by-step quickstart for LLM.kiwi: sign up for a free API key, store it safely in an environment variable, and send your first chat completion request.

<style>
  {`
      .chat-assistant-floating-input,
      chat-assistant-floating-input {
      display: none !important;
      }

      #assistant-entry,
      #assistant-entry-mobile {
      position: fixed !important;
      right: max(1rem, env(safe-area-inset-right)) !important;
      bottom: max(1rem, env(safe-area-inset-bottom)) !important;
      z-index: 60 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      width: 3rem !important;
      min-width: 3rem !important;
      height: 3rem !important;
      padding: 0 !important;
      overflow: hidden !important;
      color: #fff !important;
      background: #16a34a !important;
      border: 1px solid rgb(255 255 255 / 20%) !important;
      border-radius: 9999px !important;
      box-shadow: 0 10px 25px rgb(15 23 42 / 18%), 0 2px 8px rgb(15 23 42 / 12%) !important;
      }

      #assistant-entry:hover,
      #assistant-entry-mobile:hover {
      background: #15803d !important;
      }

      #assistant-entry:focus-visible,
      #assistant-entry-mobile:focus-visible {
      outline: 3px solid rgb(22 163 74 / 35%) !important;
      outline-offset: 3px !important;
      }

      #assistant-entry svg,
      #assistant-entry-mobile svg {
      width: 1.25rem !important;
      height: 1.25rem !important;
      color: currentcolor !important;
      }

      @media (min-width: 768px) {
      #assistant-entry-mobile { display: none !important; }
      }

      @media (max-width: 767px) {
      #assistant-entry { display: none !important; }
      }

      @media print {
      #assistant-entry,
      #assistant-entry-mobile { display: none !important; }
      }
      `}
</style>

This guide takes you from a new account to a working API call in a few minutes. No previous API experience is required.

<Info>
  Brand new to programming? Start with the cURL example — it works from any terminal with zero setup.
</Info>

## Before you start

You need:

* A free LLM.kiwi account
* An internet connection
* One of these options: a terminal, Python 3, or Node.js

No credit card, Docker, local AI model, or server is required.

## Step 1: Create an API key

<Steps>
  <Step title="Sign in">
    Open [llm.kiwi/login](https://llm.kiwi/login) and sign in with Google or GitHub.
  </Step>

  <Step title="Open your dashboard">
    Go to [llm.kiwi/dashboard](https://llm.kiwi/dashboard), where you can create and manage API keys.
  </Step>

  <Step title="Create and copy the key">
    Select **Create key**, give it a recognizable name such as `first-test`, and copy the value beginning with `sk_kiwi_`.

    <Warning>
      Treat an API key like a password. Save it in a password manager or environment variable, never publish it in GitHub, and revoke it immediately if it leaks.
    </Warning>
  </Step>
</Steps>

## Step 2: Make your first request

Choose one option below. Replace `sk_kiwi_...` with your real key only for this first local test.

<Tabs>
  <Tab title="cURL">
    Open Terminal on macOS or Linux, or PowerShell on Windows, and run:

    ```bash theme={null}
    curl "https://api.llm.kiwi/v1/chat/completions" \
      -H "Authorization: Bearer sk_kiwi_..." \
      -H "Content-Type: application/json" \
      -d '{
        "model": "auto",
        "messages": [
          {"role": "user", "content": "Reply with exactly: Hello from LLM.kiwi!"}
        ]
      }'
    ```

    <Info>
      Recent versions of Windows, macOS, and most Linux distributions include cURL. If `curl` is not recognized, use the Python or JavaScript tab.
    </Info>
  </Tab>

  <Tab title="Python">
    Install the OpenAI package:

    ```bash theme={null}
    python -m pip install openai
    ```

    Create `test.py`:

    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(
        base_url="https://api.llm.kiwi/v1",
        api_key="sk_kiwi_...",
    )

    response = client.chat.completions.create(
        model="auto",
        messages=[
            {"role": "user", "content": "Reply with exactly: Hello from LLM.kiwi!"}
        ],
    )

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

    Run it:

    ```bash theme={null}
    python test.py
    ```
  </Tab>

  <Tab title="JavaScript">
    Install Node.js 18 or newer, create a new folder, and run:

    ```bash theme={null}
    npm init -y
    npm install openai
    ```

    Create `test.mjs`:

    ```javascript theme={null}
    import OpenAI from "openai";

    const client = new OpenAI({
      baseURL: "https://api.llm.kiwi/v1",
      apiKey: "sk_kiwi_...",
    });

    const response = await client.chat.completions.create({
      model: "auto",
      messages: [
        { role: "user", content: "Reply with exactly: Hello from LLM.kiwi!" },
      ],
    });

    console.log(response.choices[0].message.content);
    ```

    Run it:

    ```bash theme={null}
    node test.mjs
    ```
  </Tab>
</Tabs>

<Check>
  A successful request prints `Hello from LLM.kiwi!`. The raw API response also contains a `choices` array, with the answer at `choices[0].message.content`.
</Check>

## Step 3: Move your key out of the code

Hardcoding a key is acceptable only for a quick local test. Before you build an app, store it in an environment variable.

<Tabs>
  <Tab title="macOS and Linux">
    ```bash theme={null}
    export LLM_KIWI_API_KEY="sk_kiwi_..."
    ```
  </Tab>

  <Tab title="Windows PowerShell">
    ```powershell theme={null}
    $env:LLM_KIWI_API_KEY="sk_kiwi_..."
    ```
  </Tab>
</Tabs>

Then read it in your code:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    import os
    from openai import OpenAI

    client = OpenAI(
        base_url="https://api.llm.kiwi/v1",
        api_key=os.environ["LLM_KIWI_API_KEY"],
    )
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    import OpenAI from "openai";

    const client = new OpenAI({
      baseURL: "https://api.llm.kiwi/v1",
      apiKey: process.env.LLM_KIWI_API_KEY,
    });
    ```
  </Tab>
</Tabs>

## What just happened?

1. Your program sent an HTTPS `POST` request to `/v1/chat/completions`.
2. The `Authorization` header identified your account using the API key.
3. `model: "auto"` asked LLM.kiwi to select an available model.
4. The `messages` array supplied the conversation.
5. The API returned the assistant's answer as JSON.

<Card title="Learn the terms without jargon" href="/concepts">
  Read the concepts guide for plain-English explanations of endpoints, headers, JSON, models, messages, and tokens.
</Card>

## If it did not work

| What you see            | Most likely cause                       | Fix                                             |
| ----------------------- | --------------------------------------- | ----------------------------------------------- |
| `401 Unauthorized`      | Missing, invalid, or revoked key        | Copy the key again and keep `Bearer ` before it |
| `400 Bad Request`       | Invalid JSON or missing field           | Check commas, quotes, `model`, and `messages`   |
| `429 Too Many Requests` | Rate limit reached                      | Wait briefly and retry with backoff             |
| Command not found       | cURL, Python, or Node.js is unavailable | Install it or choose another tab                |

For detailed fixes, open [Troubleshooting](/troubleshooting).

## Next steps

<CardGroup cols={2}>
  <Card title="Understand the API" href="/concepts">
    Learn the few concepts used in every request.
  </Card>

  <Card title="Choose a model" href="/models">
    Understand when to use `auto` or `hrllm`.
  </Card>

  <Card title="Copy a complete example" href="/examples">
    Add conversations, system instructions, and streaming.
  </Card>

  <Card title="Read the API reference" href="/api-reference">
    See every request field and response property.
  </Card>
</CardGroup>
