> ## 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 Integrations: Connect to Your Existing Stack

> Swytcho works with the tools you already use — from the OpenAI SDK to LangChain, LlamaIndex, and custom webhook integrations — with no code rewrites.

Swytcho is designed to fit into your existing workflow without friction. Whether you're building with the OpenAI SDK, orchestrating AI pipelines with LangChain or LlamaIndex, or reacting to model events in real time with webhooks, Swytcho provides a consistent, OpenAI-compatible interface that plugs in wherever you need it.

<CardGroup cols={2}>
  <Card title="OpenAI Compatibility" icon="plug" href="/integrations/openai-compatibility">
    Use Swytcho as a drop-in replacement for the OpenAI SDK by changing one line of configuration.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/integrations/webhooks">
    Receive real-time event notifications from Swytcho — including completions, failures, and usage alerts.
  </Card>

  <Card title="LangChain" icon="link">
    Connect Swytcho to LangChain chains, agents, and memory modules using the familiar `ChatOpenAI` interface.
  </Card>

  <Card title="LlamaIndex" icon="database">
    Use Swytcho as the LLM backend for LlamaIndex queries, indexes, and retrieval-augmented generation pipelines.
  </Card>
</CardGroup>

## LangChain

LangChain's `ChatOpenAI` class accepts a `base_url` parameter, so you can route all LangChain calls through Swytcho without changing any other part of your chain.

```python Python theme={null}
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="swytcho-1",
    openai_api_key="YOUR_SWYTCHO_API_KEY",
    openai_api_base="https://api.swytcho.com/v1",
)

response = llm.invoke("Explain retrieval-augmented generation in one paragraph.")
print(response.content)
```

Install the required package with `pip install langchain-openai` if you haven't already.

## LlamaIndex

LlamaIndex uses OpenAI-compatible LLMs through its `OpenAI` class. Point it at Swytcho's base URL to use any Swytcho model inside your LlamaIndex pipelines.

```python Python theme={null}
from llama_index.llms.openai import OpenAI
from llama_index.core import Settings

Settings.llm = OpenAI(
    model="swytcho-1",
    api_key="YOUR_SWYTCHO_API_KEY",
    api_base="https://api.swytcho.com/v1",
)

# Now use LlamaIndex as normal — all LLM calls route through Swytcho
```

<Tip>
  Swytcho is compatible with any library or tool that supports a custom OpenAI base URL. If a framework has a `base_url`, `api_base`, or `baseURL` parameter, you can point it at `https://api.swytcho.com/v1` and it will work out of the box.
</Tip>
