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

# SDKs and frameworks

> Configure common OpenAI-compatible clients for Mibyan

Mibyan uses the standard OpenAI-compatible HTTP shape. Any client that lets you set a custom base URL and Bearer key can connect without a Mibyan-specific package.

## Python

```python theme={null}
from openai import OpenAI

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

result = client.chat.completions.create(
    model="mibyan-4.1",
    messages=[{"role": "user", "content": "لخّص هذا النص في خمس نقاط."}],
)
print(result.choices[0].message.content)
```

## JavaScript and TypeScript

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

const client = new OpenAI({
  baseURL: "https://api.mibyanai.com/v1",
  apiKey: process.env.MIBYAN_API_KEY,
});

const result = await client.chat.completions.create({
  model: "mibyan-4.1",
  messages: [{ role: "user", content: "اكتب عنواناً واضحاً لهذا التقرير." }],
});
console.log(result.choices[0]?.message?.content);
```

## Framework notes

* **LangChain:** configure the OpenAI-compatible chat model with the Mibyan base URL and key.
* **n8n:** use an OpenAI-compatible credential and set the base URL to `https://api.mibyanai.com/v1`.
* **Vercel AI SDK:** call the API from your backend; never expose the key in a browser bundle.
* **curl:** use the examples in [API quickstart](/api-reference/quickstart).

Keep the key in an environment variable or server secret manager. The documentation examples intentionally use placeholders only.
