Provider Slug
x-ai

Integrate

Just paste your xAI API Key to Portkey to create your Virtual Key.

Sample Request

Portkey is a drop-in replacement for xAI. You can make request using the official Portkey SDK.

Popular libraries & agent frameworks like LangChain, CrewAI, AutoGen, etc. are also supported.

Local Setup

If you do not want to use Portkey’s hosted API, you can also run Portkey locally:


Integration Overview

xAI Endpoints & Capabilities

Portkey works with all of xAI’s endpoints and supports all xAI capabilities like function calling and image understanding. Find examples for each below:

Portkey Features


Appendix

FAQs