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

# Quickstart Guide: Send Your First Swytcho API Request

> Make your first Swytcho API call in minutes — create an account, grab your API key, and send a chat completion request using curl, Python, or Node.js.

This guide walks you through everything you need to go from zero to your first successful API response. By the end, you'll have a working request you can paste straight into your project.

## Prerequisites

Before you begin, make sure you have the following:

* A **Swytcho account** — sign up for free at [swytcho.com](https://swytcho.com) if you haven't already.
* Your **API key** — you'll generate this in Step 1 below.
* A terminal or API client (curl, Python 3.7+, or Node.js 18+).

<Steps>
  <Step title="Create your account and navigate to API Keys">
    Go to [swytcho.com](https://swytcho.com) and sign up for a free account. Once you're logged in, open the dashboard and click **API Keys** in the left sidebar. Then click **Create new key**, give it a descriptive name (for example, `my-first-key`), and confirm.
  </Step>

  <Step title="Copy your API key and store it securely">
    Your new API key is shown only once — copy it immediately and store it somewhere safe, such as a password manager or a `.env` file in your project. You'll use this key to authenticate every request you send to Swytcho.

    <Note>
      Never commit your API key to source control. Add `.env` to your `.gitignore` before you paste the key anywhere in your project directory.
    </Note>
  </Step>

  <Step title="Make your first API call">
    Send a `POST` request to the chat completions endpoint. The request body follows the same format as OpenAI's chat completions API, so any existing OpenAI-compatible code works with minimal changes.

    <CodeGroup>
      ```bash curl theme={null}
      curl https://api.swytcho.com/v1/chat/completions \
        -H "Authorization: Bearer YOUR_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "model": "swytcho-1",
          "messages": [
            { "role": "user", "content": "Hello!" }
          ]
        }'
      ```

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

      response = requests.post(
          "https://api.swytcho.com/v1/chat/completions",
          headers={
              "Authorization": f"Bearer {os.environ['SWYTCHO_API_KEY']}",
              "Content-Type": "application/json",
          },
          json={
              "model": "swytcho-1",
              "messages": [
                  {"role": "user", "content": "Hello!"}
              ],
          },
      )

      print(response.json())
      ```

      ```javascript Node.js theme={null}
      const response = await fetch("https://api.swytcho.com/v1/chat/completions", {
        method: "POST",
        headers: {
          "Authorization": `Bearer ${process.env.SWYTCHO_API_KEY}`,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          model: "swytcho-1",
          messages: [
            { role: "user", content: "Hello!" }
          ],
        }),
      });

      const data = await response.json();
      console.log(data);
      ```
    </CodeGroup>
  </Step>

  <Step title="Read the response">
    A successful request returns a JSON object that contains the model's reply inside the `choices` array. Here's what a typical response looks like:

    ```json theme={null}
    {
      "id": "chatcmpl-a1b2c3d4e5",
      "object": "chat.completion",
      "created": 1719000000,
      "model": "swytcho-1",
      "choices": [
        {
          "index": 0,
          "message": {
            "role": "assistant",
            "content": "Hello! How can I help you today?"
          },
          "finish_reason": "stop"
        }
      ],
      "usage": {
        "prompt_tokens": 10,
        "completion_tokens": 9,
        "total_tokens": 19
      }
    }
    ```

    The model's reply is in `choices[0].message.content`. The `usage` object tells you how many tokens were consumed — useful for monitoring costs.
  </Step>
</Steps>

<Tip>
  You can use the **official OpenAI SDK** with Swytcho by pointing the `base_url` (Python) or `baseURL` (Node.js) to `https://api.swytcho.com/v1` and passing your Swytcho API key. No other changes are needed, and you get full access to streaming, function calling, and embeddings through the SDK's familiar interface.

  ```python Python (OpenAI SDK) theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="YOUR_SWYTCHO_API_KEY",
      base_url="https://api.swytcho.com/v1",
  )

  completion = client.chat.completions.create(
      model="swytcho-1",
      messages=[{"role": "user", "content": "Hello!"}],
  )

  print(completion.choices[0].message.content)
  ```
</Tip>
