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

# Integrations

> Manage LLM and agent integrations programmatically. Create, list, retrieve, update, and delete provider and customer-hosted agent integrations.

<Note>
  The `integrations` functions are currently in **ALPHA**. The API may change without notice. A one-time warning is emitted on first use.
</Note>

Integrations are polymorphic: an **LLM** integration configures a model provider (e.g. OpenAI, Anthropic), while an **AGENT** integration connects a customer-hosted agent exposed at an HTTPS endpoint. The `type` field (`"LLM"` or `"AGENT"`) selects the config shape. Integration names are unique per `(account, type)`, so when resolving an integration by name you must also pass its `type`.

## List Integrations

When `type` is omitted, integrations of every type are returned, each carrying its `type` discriminator.

```typescript theme={null}
import { listIntegrations } from "@arizeai/ax-client";

// Only agent integrations
const { data: agents, pagination } = await listIntegrations({
  type: "AGENT",       // optional; omit for all types
  space: "my-space",   // space name or ID (optional)
  name: "support",     // substring filter on integration name (optional)
  limit: 10,
});

// Every type, discriminated by `integration.type`
const { data: all } = await listIntegrations({});
```

## Create an Integration

The `type` field selects the config shape: `"LLM"` for a model-provider integration, `"AGENT"` for a customer-hosted HTTPS endpoint plus a request JSON Schema.

```typescript theme={null}
import { createIntegration } from "@arizeai/ax-client";

// LLM integration
const llm = await createIntegration({
  type: "LLM",
  name: "Production OpenAI",
  config: { provider: "OPEN_AI", apiKey: "sk-..." },
});

// Agent integration
const agent = await createIntegration({
  type: "AGENT",
  name: "My Support Agent",
  config: {
    endpoint: "https://agent.example.com/replay",
    inputSchema: { type: "object", properties: { input: { type: "string" } } },
    requestPresets: [{ name: "default", config: { input: "hello" } }],
  },
});
```

## Get an Integration

Resolve by ID, or by name with the required `type`.

```typescript theme={null}
import { getIntegration } from "@arizeai/ax-client";

// By ID
const integration = await getIntegration({ integration: "your_integration_id" });

// By name (requires type)
const integration = await getIntegration({
  integration: "Production OpenAI",
  type: "LLM",
  space: "my-space",  // optional filter when using a name
});
```

## Update an Integration

`type` is required (it selects the update shape) and is immutable server-side. Provide at least one updatable field. Collection fields (`scopings`, agent `requestPresets`) replace on provide.

```typescript theme={null}
import { updateIntegration } from "@arizeai/ax-client";

// Rotate an LLM integration's API key by name (provider selects the config
// variant; it is immutable and must match the stored value)
const updated = await updateIntegration({
  integration: "Production OpenAI",
  type: "LLM",
  config: { provider: "OPEN_AI", apiKey: "sk-new-key" },
});
```

## Delete an Integration

Resolve by ID, or by name with the required `type`. This operation is irreversible.

```typescript theme={null}
import { deleteIntegration } from "@arizeai/ax-client";

// By ID
await deleteIntegration({ integration: "your_integration_id" });

// By name (requires type)
await deleteIntegration({ integration: "Production OpenAI", type: "LLM" });
```
