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

# AutoGen

> Learn how to use AutoGen with ScitiX Model Inference to build multi-agent applications through an OpenAI-compatible endpoint.

[AutoGen](https://github.com/microsoft/autogen) is Microsoft's framework for building multi-agent AI applications. Its `OpenAIChatCompletionClient` accepts a custom `base_url`, so agents can run on the ScitiX Model Inference API.

Default model here is `glm-5.2`; see the [Models](https://console.scitix.ai/model-inference/models) page for the full list and pricing.

## Configure

Create an API key on the ScitiX [API Keys](https://console.scitix.ai/model-inference/api_keys) page and export it:

```bash theme={null}
export SCITIX_API_KEY="<Your API Key>"
```

Install `autogen-agentchat` and `autogen-ext[openai]`, then build a client pointed at ScitiX. Use `OpenAIChatCompletionClient` from `autogen-ext[openai]`; pass this client to an `AssistantAgent` to drive multi-agent teams on ScitiX.

```python theme={null}
import os
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_core.models import ModelInfo

client = OpenAIChatCompletionClient(
    model="glm-5.2",
    base_url="https://api.scitix.ai/model-api/v1",
    api_key=os.environ["SCITIX_API_KEY"],
    model_info=ModelInfo(
        vision=False, function_calling=True, json_output=True,
        family="unknown", structured_output=True,
    ),
)
```

| Field        | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| `model`      | ScitiX model ID, e.g. `glm-5.2`                                                    |
| `base_url`   | ScitiX OpenAI-compatible endpoint: `https://api.scitix.ai/model-api/v1`            |
| `api_key`    | Your ScitiX API key, read from the environment                                     |
| `model_info` | Required for a custom model. Declare its capabilities, such as `function_calling`. |

For a custom model, `model_info` is required. Without it, the client raises `model_info is required`. For a tool-calling model such as `glm-5.2`, set `function_calling=True`.

## Verify

Send a message — a normal reply confirms the connection (verified on **autogen-agentchat 0.7.5**):

```python theme={null}
import asyncio
from autogen_core.models import UserMessage

async def main():
    r = await client.create(
        [UserMessage(content="In one short sentence, which model are you?", source="user")]
    )
    print(r.content)

asyncio.run(main())
# → I'm GLM, a large language model developed by Z.ai.
```
