Provider Slug. x-ai

Integrate

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

Sample Request

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

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

Python
from obiguard import Obiguard

client = Obiguard(
  obiguard_api_key="vk-obg***",  # Your Obiguard virtual key
)

response = client.chat.completions.create(
  model="grok-beta",
  messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message)

Integration Overview

xAI Endpoints & Capabilities

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

FAQs