CrewAI is a Python framework for teams of agents. Its docs show a custom OpenAI-compatible endpoint pattern: an LLM with custom_openai=True and a base_url. BroadNet Inference serves standard chat completions at https://inference.broadnet.ai/v1, so it plugs in there. BroadRouter is BroadNet’s own site; this follows CrewAI’s docs and source as of version 1.15.41.
Install
pip install crewai
export BROADNET_API_KEY='your-broadnet-key'
Connect
import os
from crewai import LLM, Agent
llm = LLM(
model="broadnet/glm-5.3",
custom_openai=True,
base_url="https://inference.broadnet.ai/v1",
api_key=os.environ["BROADNET_API_KEY"],
max_tokens=4000, # reasoning counts toward this limit
)
# Quick test: one call straight to the model
print(llm.call("Say hello in five words."))
analyst = Agent(
role="Analyst",
goal="Summarize incidents",
backstory="You write short incident summaries.",
llm=llm,
)
print(analyst.kickoff("Summarize: the API returned 503 for four minutes after a deploy."))
If llm.call prints an answer, the key, URL and model ID are right.
How CrewAI routes the request
CrewAI’s source sets an order: custom_openai=True comes first and forces the native OpenAI provider, overriding anything the model name suggests. It also raises an error unless a custom endpoint is set through base_url, api_base, OPENAI_BASE_URL or OPENAI_API_BASE. The model string is sent as written, so broadnet/glm-5.3 reaches BroadNet unchanged.
Without custom_openai, a name such as broadnet/glm-5.3 would be read as provider broadnet, which CrewAI doesn’t know, and would fall back to LiteLLM. The documented alternative is model="openai/broadnet/glm-5.3" with a base_url: CrewAI strips the openai/ prefix and sends the rest.
Two more things from CrewAI’s code and docs:
- Token limit field. When you pass
max_tokens, the native client sendsmax_tokenson chat completions, the field BroadNet’s API reference describes. If you passmax_completion_tokens, that is sent instead. - Stay on chat completions. CrewAI’s docs show
api="responses"to switch to the Responses API. Don’t set it; BroadNet doesn’t list that API.
Which model for which agent
| Agent | Model | Why |
|---|---|---|
| Agents with tools | broadnet/glm-5.3 |
BroadNet lists tools and structured output; 1M context |
| Image or Arabic input, with tools | broadnet/qwen3.8-27b |
Tools plus images; 262K context |
| Long reading tasks, flat-rate plan | broadnet/deepseek-v4.1-flash |
Unlimited plans; tools not listed by BroadNet |
A crew can mix them: give each Agent its own LLM.
Troubleshooting
- 401. The key is wrong, expired or out of allowance. If you left out
api_key, CrewAI readOPENAI_API_KEY, which may hold an OpenAI key. - “custom_openai=True requires base_url”. Pass
base_url, or setOPENAI_BASE_URL. - Model not found. Check the ID matches BroadNet’s exactly. Paid models need a top-up; the $5 credit covers only
broadnet/gemma-4-26b-a4band the two Transcribe models. EmptyLLMResponseError. CrewAI retries an empty answer once, then raises this. Raisemax_tokens. Why answers come back empty.- 429 with several agents. A pay-as-you-go key allows 30 requests a minute and 4 in flight, and a plan session runs one request at a time. See errors and retries.
