> ## 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.

# CrewAI

> Learn how to use CrewAI with ScitiX Model Inference to build and run role-based AI agent workflows through an OpenAI-compatible API.

[CrewAI](https://github.com/crewAIInc/crewAI) is a popular framework for orchestrating role-playing, autonomous AI agents. Its `LLM` class is LiteLLM-backed and accepts a custom `base_url`, so crews 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>"
```

Build a CrewAI `LLM` pointed at the ScitiX endpoint and hand it to your agents:

```python theme={null}
import os
from crewai import LLM, Agent, Task, Crew

llm = LLM(
    model="openai/glm-5.2",
    base_url="https://api.scitix.ai/model-api/v1",
    api_key=os.environ["SCITIX_API_KEY"],
)

agent = Agent(role="Assistant", goal="Answer briefly",
              backstory="You are concise.", llm=llm)
```

| Field      | Description                                                                                           |
| ---------- | ----------------------------------------------------------------------------------------------------- |
| `model`    | `openai/<id>` — the `openai/` prefix routes via the OpenAI-compatible provider, e.g. `openai/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                                                        |

The `openai/` prefix is required for this custom OpenAI-compatible endpoint. CrewAI routes through LiteLLM, which uses the provider prefix to pick the OpenAI-compatible client for a custom `base_url` like ScitiX.

Choose a model with native tool calling for multi-agent tools/delegation. `glm-5.2` works.

## Verify

Run a one-agent crew — a normal completion confirms the connection (verified on **crewai 1.15.16**):

```python theme={null}
task = Task(description="In one short sentence, which model are you?",
            expected_output="One sentence.", agent=agent)
print(Crew(agents=[agent], tasks=[task]).kickoff())
```

You can also make a direct call through the configured `LLM`:

```python theme={null}
print(llm.call("In one short sentence, which model are you?"))
# → I am GLM, a large language model developed by Z.ai.
```
