# xAI (Grok) (/docs/providers/xai)


Overview [#overview]

[xAI](https://x.ai) is an AI company founded by Elon Musk, offering Grok models with real-time knowledge access and strong reasoning capabilities.

**Official Website:** [https://x.ai](https://x.ai)
&#x2A;*API Documentation:** [https://docs.x.ai](https://docs.x.ai)

Key Features [#key-features]

* **Real-Time Knowledge** — Access to current information
* **Deep Thinking** — Extended reasoning for complex problems
* **Long Context** — Large context windows
* **Structured Output** — JSON and structured responses
* **Function Calling** — Tool use support

Usage Example [#usage-example]

```python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://api.yuhuanstudio.com/v1"
)

response = client.chat.completions.create(
    model="model-id",
    messages=[{"role": "user", "content": "What's the latest news?"}]
)

print(response.choices[0].message.content)
```

Available Models [#available-models]

Use the [Models API](/docs/models-api) to query available models:

```bash
curl https://api.yuhuanstudio.com/v1/models?provider=xai \
  -H "Authorization: Bearer YOUR_API_KEY"
```

<Callout type="info">
  Models and pricing are synced automatically from xAI. Check the dashboard for current availability and rates.
</Callout>

Official Resources [#official-resources]

* [xAI Website](https://x.ai)
* [API Documentation](https://docs.x.ai)
