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

# SDKs and libraries

> Use LLM.kiwi from the official OpenAI Python and JavaScript SDKs by pointing the base URL at LLM.kiwi, or call the API directly over plain HTTP requests.

The simplest LLM.kiwi clients are the OpenAI Python and JavaScript packages configured with the custom chat completions base URL.

<Note>
  Compatibility applies to the endpoints and fields documented by LLM.kiwi. A library may expose additional OpenAI features that LLM.kiwi does not support.
</Note>

## Python

Install:

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

Configure:

```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"],
)

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

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

## JavaScript and TypeScript

Install:

```bash theme={null}
npm install openai
```

Configure in server-side code:

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

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

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

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

<Warning>
  Do not initialize a private API client in browser-side React, Vue, Svelte, or plain JavaScript. Send browser requests to your own backend, then call LLM.kiwi from that backend.
</Warning>

## Direct HTTP

You do not need an SDK. Any server-side HTTP client can call the API.

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

A direct HTTP client is useful when:

* Your language has no maintained OpenAI-compatible SDK.
* You want minimal dependencies.
* You need precise control over timeouts, retries, or streaming.

## Other clients and frameworks

Before using a community library, confirm that it lets you configure all three items:

1. Base URL: `https://api.llm.kiwi/v1`
2. Bearer API key
3. Chat completions model name such as `auto`

Frameworks may change their configuration names between versions. Follow the framework's current documentation and verify the generated request against the [API reference](/api-reference).

## Which option should I choose?

| Your project                  | Recommended starting point                         |
| ----------------------------- | -------------------------------------------------- |
| Python backend or script      | OpenAI Python package                              |
| Node.js or TypeScript backend | OpenAI JavaScript package                          |
| Another server-side language  | Maintained OpenAI-compatible client or direct HTTP |
| Browser or mobile interface   | Your own backend proxy; never embed the key        |
| Learning the API itself       | cURL or direct HTTP                                |

<CardGroup cols={2}>
  <Card title="Copy complete examples" icon="code" href="/examples">
    Start with tested request patterns.
  </Card>

  <Card title="Review endpoint fields" icon="brackets-curly" href="/api-reference">
    Check request and response formats.
  </Card>
</CardGroup>
