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

# Quickstart

> Get an API key and make your first request in under a minute.

<Steps>
  <Step title="Get your API key">
    Create a key at [Developers → Connections → Apps](https://www.ninjachat.ai/developers/connections?tab=apps). Keys look like `nj_sk_...` and are shown once — copy immediately.
  </Step>

  <Step title="Put it in your environment">
    ```bash theme={null}
    export NINJACHAT_API_KEY='nj_sk_your-api-key-here'
    ```
  </Step>

  <Step title="Make your first request">
    Set `model` to `auto` and NinjaChat picks the best model for you.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://www.ninjachat.ai/api/v1/chat \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer $NINJACHAT_API_KEY" \
        -d '{
          "model": "auto",
          "messages": [{"role": "user", "content": "What is the capital of France?"}]
        }'
      ```

      ```python Python theme={null}
      import os, requests

      r = requests.post("https://www.ninjachat.ai/api/v1/chat",
          headers={"Authorization": f"Bearer {os.environ['NINJACHAT_API_KEY']}"},
          json={
              "model": "auto",
              "messages": [{"role": "user", "content": "What is the capital of France?"}]
          }
      )
      print(r.json()["choices"][0]["message"]["content"])
      ```

      ```javascript Node.js theme={null}
      const r = await fetch("https://www.ninjachat.ai/api/v1/chat", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer ${process.env.NINJACHAT_API_KEY}`,
        },
        body: JSON.stringify({
          model: "auto",
          messages: [{ role: "user", content: "What is the capital of France?" }],
        }),
      });
      const data = await r.json();
      console.log(data.choices[0].message.content);
      ```
    </CodeGroup>
  </Step>

  <Step title="Read the response">
    Every response tells you which model ran, what it cost, and your remaining balance:

    ```json theme={null}
    {
      "model": "gemini-3-flash",
      "choices": [{
        "message": { "role": "assistant", "content": "The capital of France is Paris." },
        "finish_reason": "stop"
      }],
      "cost": { "this_request": "$0.0003" },
      "balance": "$4.99",
      "metadata": { "latency_ms": 312 }
    }
    ```

    `auto` routed this to `gemini-3-flash` — the fastest option for a short factual question.
  </Step>
</Steps>

<Tip>
  Already using the OpenAI SDK? Point it at NinjaChat — [two lines change](/openai-compatibility).
</Tip>

## Next steps

<CardGroup cols={3}>
  <Card title="Smart Routing" icon="route" href="/smart-routing">
    `auto` explained — and its fast/cheap/quality variants
  </Card>

  <Card title="Images" icon="image" href="/image-generation">
    14 models from \$0.03
  </Card>

  <Card title="Video" icon="video" href="/video-generation">
    Veo, Kling, Seedance from \$3
  </Card>

  <Card title="Compare" icon="scale-balanced" href="/compare">
    Race models, get ranked results
  </Card>

  <Card title="Sessions" icon="messages" href="/sessions">
    Server-side conversation memory
  </Card>

  <Card title="Pricing" icon="receipt" href="/pricing">
    Flat rates, no token math
  </Card>
</CardGroup>
