> ## 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.

# Swytcho API Reference: Endpoints, SDKs & Conventions

> Explore Swytcho's unified REST API for chat, completions, embeddings, and models — one base URL, one auth scheme, and full OpenAI SDK compatibility.

Swytcho exposes a unified REST API that gives you access to a growing catalog of AI models through a single, OpenAI-compatible interface. Whether you're building chat applications, text generation pipelines, or semantic search systems, every interaction follows the same predictable conventions — one base URL, one authentication scheme, and one response format.

## Base URL

All API requests target the following base URL:

```text theme={null}
https://api.swytcho.com/v1
```

## Request Format

Send all requests with the `Content-Type: application/json` header and a JSON-encoded body. Authenticate every request using a Bearer token in the `Authorization` header (see [Authentication](/api-reference/authentication) for details).

```http theme={null}
POST /v1/chat/completions HTTP/1.1
Host: api.swytcho.com
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

## Response Format

All responses are JSON-encoded. Successful responses return a `200 OK` status code along with a structured JSON body. Errors return an appropriate HTTP status code and a JSON object containing `error.type`, `error.message`, and `error.code` fields.

## Available Endpoints

| Method | Path                    | Description                                     |
| ------ | ----------------------- | ----------------------------------------------- |
| `POST` | `/v1/chat/completions`  | Generate chat responses from a list of messages |
| `POST` | `/v1/completions`       | Generate text completions from a raw prompt     |
| `POST` | `/v1/embeddings`        | Convert text into vector embeddings             |
| `GET`  | `/v1/models`            | List all models available to your account       |
| `GET`  | `/v1/models/{model_id}` | Retrieve details for a specific model           |

## SDKs

You can interact with the Swytcho API directly over HTTP or through an official SDK. The following SDKs are available:

<CodeGroup>
  ```bash Python theme={null}
  pip install swytcho
  ```

  ```bash Node.js theme={null}
  npm install swytcho
  ```
</CodeGroup>

After installation, initialize the client with your API key:

<CodeGroup>
  ```python Python theme={null}
  from swytcho import Swytcho

  client = Swytcho(api_key="YOUR_API_KEY")
  ```

  ```javascript Node.js theme={null}
  import Swytcho from "swytcho";

  const client = new Swytcho({ apiKey: "YOUR_API_KEY" });
  ```
</CodeGroup>

<Note>
  The Swytcho API is fully compatible with the OpenAI SDK. Point the OpenAI client at `https://api.swytcho.com/v1` by setting the `base_url` (Python) or `baseURL` (Node.js) option, and use your Swytcho API key. No other code changes are required.
</Note>
