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

# atoti_ai_openai.ConnectionConfig

### *final class* atoti\_ai\_openai.ConnectionConfig

Configuration for connecting to OpenAI.

<Warning>
  This feature is [`experimental`](./atoti.experimental#atoti.experimental), its key is `"ai"`.
</Warning>

### Example

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> import os
>>> from atoti_ai_openai import ConnectionConfig, ChatConfig
```

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> with tt.experimental({"ai"}):
...     connection_config = ConnectionConfig(
...         api_key=os.environ["AZURE_OPENAI_API_KEY"],
...         base_url="https://aiwopenai.openai.azure.com/openai/v1",
...     )
...     chat_config = ChatConfig(
...         completions_path="/chat/completions",
...         model="gpt-4.1",
...         temperature=0.0,
...         max_tokens=5000,
...         top_p=0.8,
...     )
...     ai_config = tt.AiConfig(connection=connection_config, chat=chat_config)
```

<Callout icon="link">
  **See also**:
  The other [`ConnectionConfig`](./atoti.config.ai.connection_config#atoti.config.ai.connection_config.ConnectionConfig) implementations.
</Callout>

#### api\_key *: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None)* *= None*

OpenAI API key for authentication.

#### base\_url *: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None)* *= None*

Base URL for the OpenAI API.

Useful for OpenAI-compatible providers.

#### organization\_id *: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None)* *= None*

OpenAI organization ID.

#### project\_id *: [str](https://docs.python.org/3/library/stdtypes.html#str) | [None](https://docs.python.org/3/library/constants.html#None)* *= None*

OpenAI project ID.
