Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

add X AI (Grok) integration example to supported models

dha-aab68b0cc1e78c
diff --git a/docs/customize/supported-models.mdx b/docs/customize/supported-models.mdx
index 73c561f2d..cb06692a0 100644
--- a/docs/customize/supported-models.mdx
+++ b/docs/customize/supported-models.mdx
@@ -249,6 +249,39 @@ Required environment variables:
```bash .env
NOVITA_API_KEY=
```
+### X AI
+[X AI](https://x.ai) is an LLM API provider that offers a wide range of models. Note: choose a model that supports function calling.
+
+```python
+from langchain_openai import ChatOpenAI
+from browser_use import Agent
+from pydantic import SecretStr
+from dotenv import load_dotenv
+import os
+
+load_dotenv()
+api_key = os.getenv("GROK_API_KEY")
+
+# Initialize the model
+llm = ChatOpenAI(
+ base_url='https://api.x.ai/v1',
+ model='grok-3-beta',
+ api_key=SecretStr(api_key)
+)
+
+# Create agent with the model
+agent = Agent(
+ task="Your task here",
+ llm=llm,
+ use_vision=False
+)
+```
+
+Required environment variables:
+
+```bash .env
+GROK_API_KEY=
+```
## Coming soon
(We are working on it)