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

# Integrations

> External models, LangChain, and notifications

Connect external models or use Adaptive with LangChain.

## External models

Connect proprietary models (OpenAI, Azure, Google, Anthropic, NVIDIA NIM) to use them through the Adaptive API with interaction and metrics logging.

### OpenAI (direct)

```python theme={null}
external_model = adaptive.models.add_external(
    provider="open_ai",
    external_model_id="GPT4O",
    name="GPT-4o",
    api_key="OPENAI_API_KEY"
)
```

Supported model IDs: `GPT4O`, `GPT4O_MINI`, `GPT4`, `GPT4_TURBO`, `GPT3_5_TURBO`

### Azure OpenAI

```python theme={null}
external_model = adaptive.models.add_external(
    provider="azure",
    external_model_id="DEPLOYMENT_NAME",
    name="Azure GPT-4o",
    api_key="AZURE_API_KEY",
    endpoint="https://aoairesource.openai.azure.com"
)
```

The `external_model_id` is your deployment name, and `endpoint` is your Azure OpenAI subscription endpoint.

### Google

```python theme={null}
external_model = adaptive.models.add_external(
    provider="google",
    external_model_id="gemini-1.5-pro",
    name="Gemini 1.5 Pro",
    api_key="GOOGLE_API_KEY"
)
```

Supported models: [Gemini model variations](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) (excluding embeddings).

### Anthropic

```python theme={null}
external_model = adaptive.models.add_external(
    provider="anthropic",
    external_model_id="claude-sonnet-4-5-20250929",
    name="Claude Sonnet 4.5",
    api_key="ANTHROPIC_API_KEY"
)
```

Use the model ID from [Anthropic's API documentation](https://platform.claude.com/docs/en/about-claude/models/overview) as the `external_model_id`.

Once connected, attach the model to a project and make inference requests like any other model.

## LangChain

Adaptive is compatible with LangChain chat model classes.

### ChatOpenAI

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

os.environ["OPENAI_API_KEY"] = "ADAPTIVE_API_KEY"

llm = ChatOpenAI(
    model="project_key/model_key",  # model_key is optional
    base_url="ADAPTIVE_URL/api/v1",
)

messages = [
    ("system", "You are a helpful assistant that translates English to French."),
    ("human", "I love programming."),
]
response = llm.invoke(messages)
```

### ChatGoogleGenerativeAI

```python theme={null}
from langchain_google_genai import ChatGoogleGenerativeAI
import os

os.environ["GOOGLE_API_KEY"] = "ADAPTIVE_API_KEY"

llm = ChatGoogleGenerativeAI(
    model="project_key",
    client_options={"api_endpoint": "ADAPTIVE_URL/api/v1/google"},
    transport="rest",
)

messages = [
    ("system", "You are a helpful assistant that translates English to French."),
    ("human", "I love programming."),
]
response = llm.invoke(messages)
```

## Platform notifications

Subscribe to platform events (job completion, failures, model status changes) and receive alerts through Slack, email, or webhook.

### Topic patterns

Notifications use a topic-based system with pattern matching. Subscribe to specific events or use wildcards:

| Pattern                             | Matches                                  |
| ----------------------------------- | ---------------------------------------- |
| `project:*:job:**:completed`        | Any job completion in any project        |
| `project:my-project:job:**:failed`  | Failed jobs in a specific project        |
| `project:*:model:**:status_changed` | Model status changes across all projects |

Use `*` to match a single segment and `**` to match multiple segments.

### Integration types

Configure notifications in **Settings → Integrations**. Three delivery methods are available:

| Type        | Setup                             | Details                                 |
| ----------- | --------------------------------- | --------------------------------------- |
| **Slack**   | Webhook URL, optional bot token   | Posts to a channel via incoming webhook |
| **Email**   | SMTP server configuration         | Sends to specified recipients           |
| **Webhook** | HTTP endpoint URL, custom headers | POST request with event payload         |

Each integration can subscribe to different topic patterns. You can create multiple integrations of the same type for different channels or recipients.

### Permissions

Creating and managing integrations requires `integration:create`, `integration:read`, `integration:update`, or `integration:delete` permissions. See [Permissions](/v0.14/advanced/permissions) for role configuration.

<Accordion title="Programmatic setup via GraphQL">
  No SDK resource exists for notifications yet. To configure integrations programmatically, use the GraphQL API directly. Contact your administrator for the schema details.
</Accordion>
