Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,83 @@
"await model_client.close()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## FuturMix (OpenAI-compatible)\n",
"\n",
"[FuturMix](https://futurmix.ai) is a unified AI gateway that provides access to 22+ models from OpenAI, Anthropic, and Google through a single OpenAI-compatible API endpoint.\n",
"\n",
"Since FuturMix is fully OpenAI-compatible, you can use the {py:class}`~autogen_ext.models.openai.OpenAIChatCompletionClient` with the FuturMix API.\n",
"\n",
"To get started, obtain an API key from [FuturMix](https://futurmix.ai)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from autogen_core.models import UserMessage\n",
"from autogen_ext.models.openai import OpenAIChatCompletionClient\n",
"\n",
"model_client = OpenAIChatCompletionClient(\n",
" model=\"gpt-4o\",\n",
" base_url=\"https://futurmix.ai/v1\",\n",
" api_key=\"sk-your-futurmix-key\",\n",
")\n",
"\n",
"response = await model_client.create([UserMessage(content=\"What is the capital of France?\", source=\"user\")])\n",
"print(response)\n",
"await model_client.close()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also use models from other providers through FuturMix, such as Anthropic's Claude or Google's Gemini:\n",
"\n",
"```python\n",
"from autogen_ext.models.openai import OpenAIChatCompletionClient\n",
"from autogen_core.models import ModelInfo\n",
"\n",
"# Use Claude through FuturMix\n",
"claude_client = OpenAIChatCompletionClient(\n",
" model=\"claude-sonnet-4-20250514\",\n",
" base_url=\"https://futurmix.ai/v1\",\n",
" api_key=\"sk-your-futurmix-key\",\n",
" model_info=ModelInfo(\n",
" vision=True,\n",
" function_calling=True,\n",
" json_output=True,\n",
" family=\"unknown\",\n",
" structured_output=True,\n",
" ),\n",
")\n",
"\n",
"# Use Gemini through FuturMix\n",
"gemini_client = OpenAIChatCompletionClient(\n",
" model=\"gemini-2.5-flash\",\n",
" base_url=\"https://futurmix.ai/v1\",\n",
" api_key=\"sk-your-futurmix-key\",\n",
" model_info=ModelInfo(\n",
" vision=True,\n",
" function_calling=True,\n",
" json_output=True,\n",
" family=\"unknown\",\n",
" structured_output=True,\n",
" ),\n",
")\n",
"```\n",
"\n",
"```{note}\n",
"When using non-OpenAI models through FuturMix, you may need to specify `model_info` to define the model's capabilities, as the client may not automatically recognize them.\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -599,4 +676,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}