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

# LangChain Integration

> Use Neosantara with LangChain Python and LangChain.js.

Connect Neosantara to [LangChain](https://www.langchain.com/?utm_source=neosantara-docs\&utm_medium=referral) via `ChatOpenAI`.

## Setup

```bash Bash / zsh icon="terminal" theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
export NEOSANTARA_API_KEY="nsk_your_api_key_here"
```

```env .env icon="file-code" theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
NEOSANTARA_API_KEY=nsk_your_api_key_here
```

```powershell PowerShell icon="terminal" theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
$env:NEOSANTARA_API_KEY="nsk_your_api_key_here"
```

## Python Example

```python theme={"theme":{"light":"catppuccin-latte","dark":"ayu-dark"}}
from langchain_openai import ChatOpenAI
import os

llm = ChatOpenAI(
    model="gemini-3.8-flash",
    openai_api_base="https://api.neosantara.xyz/v1",
    openai_api_key=os.environ["NEOSANTARA_API_KEY"]
)

response = llm.invoke("What are the advantages of Indonesia's AI Gateway?")
print(response.content)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.