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

# Use aisuite with Eden AI

> Call 500+ models through aisuite's built-in Eden AI provider with one key. Install aisuite 0.2.0 or later, then pick a model with edenai:provider/model.

**Use aisuite with Eden AI**

Call 500+ models through aisuite's built-in Eden AI provider with one key. Install aisuite 0.2.0 or later, then pick a model with edenai:provider/model.

aisuite 0.2.0 and later includes an `edenai` provider, so one Eden AI key gives `client.chat.completions.create` access to the whole catalog.

## Overview

[aisuite](https://github.com/andrewyng/aisuite) is a lightweight Python library (from Andrew Ng's team) that gives you a single, OpenAI-style Chat Completions interface across many providers: swap providers by changing one string. **Eden AI is a built-in aisuite provider**, so you reach models from OpenAI, Anthropic, Google, Mistral and more behind one key.

You select a model with the `provider:model_id` syntax. For Eden AI, the provider is `edenai` and the model id follows Eden AI's `provider/model` scheme, for example `edenai:vertex/gemini-flash-latest`.

## Installation

The Eden AI provider ships in aisuite 0.2.0 and later. It talks to Eden AI through the `openai` SDK, which aisuite does not install for you, so install both:

```bash pip theme={null}
pip install "aisuite>=0.2.0" openai
```

```bash poetry theme={null}
poetry add "aisuite>=0.2.0" openai
```

## Quick Start

Set your key, then point aisuite at Eden AI by prefixing any model with `edenai:`:

```bash .env theme={null}
EDENAI_API_KEY=YOUR_API_KEY
```

```python Python theme={null}
import aisuite as ai

client = ai.Client()

response = client.chat.completions.create(
    model="edenai:vertex/gemini-flash-latest",  # edenai:<provider>/<model>
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello! How are you?"},
    ],
)

print(response.choices[0].message.content)
```

The `edenai` provider uses the Eden AI base URL (`https://api.edenai.run/v3`) and reads your key from the `EDENAI_API_KEY` environment variable. The base URL is fixed in the provider: a `base_url` you put in the client config is ignored.

> [!NOTE]
>
> In aisuite 0.2.0, the `edenai` provider does not support streaming. Calling it with `stream=True` raises an `LLMError`.

## Model naming

Use `edenai:<provider>/<model>`. Everything after the first colon is passed to Eden AI unchanged, for example `edenai:anthropic/claude-sonnet-latest` or `edenai:mistral/mistral-small-latest`. To browse every id, see [List LLM Models](https://www.edenai.co/docs/v3/llms/listing-models.md).

## Switching models

aisuite's core benefit: change providers by changing one string. Every Eden AI model is reachable the same way, with no per-provider SDKs and no code changes:

```python Python theme={null}
import aisuite as ai

client = ai.Client()
messages = [{"role": "user", "content": "Write a haiku about the sea."}]

for model in [
    "edenai:openai/gpt-latest",
    "edenai:anthropic/claude-sonnet-latest",
    "edenai:mistral/mistral-large-latest",
]:
    response = client.chat.completions.create(model=model, messages=messages)
    print(model, "->", response.choices[0].message.content)
```

## Passing configuration explicitly

Prefer not to use environment variables? Pass the key through the aisuite client config instead:

```python Python theme={null}
import aisuite as ai

client = ai.Client({"edenai": {"api_key": "YOUR_API_KEY"}})

response = client.chat.completions.create(
    model="edenai:mistral/mistral-large-latest",
    messages=[{"role": "user", "content": "Say hello in French."}],
)
print(response.choices[0].message.content)
```

## Environment Variables

The `edenai` provider reads `EDENAI_API_KEY`. There is no variable for the base URL.

```bash .env theme={null}
EDENAI_API_KEY=YOUR_API_KEY
```

## Next Steps

* [Chat Completions](https://www.edenai.co/docs/v3/llms/chat-completions.md) - Core LLM endpoint
* [List LLM Models](https://www.edenai.co/docs/v3/llms/listing-models.md) - Browse available providers and models
* [OpenAI SDK (Python)](https://www.edenai.co/docs/v3/integrations/openai-sdk-python.md) - Direct SDK usage


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