OpenAIChatCompletionClient(base_url=…)
Native OpenAI-compatible supportAutoGen with a custom OpenAI-compatible model
AutoGen builds its agents on an OpenAI-compatible client config. Swap the base URL and every conversation, group chat and code executor works as before.
Base URL
https://uncensoredai.dev/v1
- 01
Create the client
AutoGen v0.4 takes a model client. Point it at the gateway and declare the model info the agent needs.
pythonfrom autogen_ext.models.openai import OpenAIChatCompletionClient client = OpenAIChatCompletionClient( model="deepseek-v4.1-flash", base_url="https://uncensoredai.dev/v1", api_key="sk-ua-XXXX-XXXX-XXXX-XXXX", model_info={ "vision": False, "function_calling": True, "json_output": True, "family": "unknown", }, ) - 02
Run an assistant
The assistant agent is model-agnostic once the client is configured.
agentfrom autogen_agentchat.agents import AssistantAgent assistant = AssistantAgent(name="assistant", model_client=client)
Commands and configuration below are shown exactly as the tool expects them, so they stay in English.
FAQ
Do group chats work?+
Yes. Selector and round-robin group chats operate on the agent objects, not on the provider.
Why declare model_info manually?+
AutoGen looks up capabilities by model name. Custom ids are unknown to it, so declare the capabilities you need.
