# Mia21 SDKs

> Official clients — or keep the OpenAI SDK.

## OpenAI drop-in (any language)

Change the base URL. Keep your existing OpenAI client.

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_MIA21_KEY",
    base_url="https://api.mia21.com/v1",
)
```

```bash
curl https://api.mia21.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_MIA21_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}],"user":"user_123"}'
```

## Python (`mia21`)

```bash
pip install mia21
```

```python
from mia21 import Mia21Client

with Mia21Client(api_key="YOUR_MIA21_KEY") as client:
    client.initialize(space_id="support")
    response = client.chat("How do I reset my password?")
    print(response.message)
```

- PyPI: https://pypi.org/project/mia21/
- Features: streaming, context-manager sessions, spaces/bots helpers

## JavaScript / TypeScript (`mia21`)

```bash
npm install mia21
```

```typescript
import { Mia21Client } from "mia21";

const client = new Mia21Client({ apiKey: "YOUR_MIA21_KEY" });
await client.initialize({ spaceId: "support" });
const response = await client.chat("How do I reset my password?");
console.log(response.message);
await client.close();
```

- npm: https://www.npmjs.com/package/mia21
- Features: typed client, streaming callbacks, Node + browser

## Auth

- Header: `Authorization: Bearer <key>` or `X-API-Key: <key>`
- Keys are created in the console: https://app.mia21.com

## Docs

- https://docs.mia21.com
- https://github.com/mia21com/mia21
