For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
  • Integrations
    • Overview
      • OpenAI
      • Anthropic
      • Google Gemini
      • Mistral
      • Baseten
      • Fireworks AI
      • Groq
      • Perplexity AI
      • Replicate
      • Together AI
      • xAI
      • AI21 Labs
      • Cohere
      • DeepSeek
      • Inference
      • Moonshot
      • Nebius AI
      • Nextbit
      • Novita AI
      • OpenRouter
      • Parasail
      • Reducto
      • AWS Bedrock
      • Google Vertex AI
      • Azure OpenAI
      • Custom Provider
LogoLogo
DiscordPlatform
On this page
  • xAI models compatibility
  • Add xAI API keys
  • Via UI
  • Via code
  • Full request example
IntegrationsModel Providers

xAI

Use your own xAI credits through Respan
Was this page helpful?
Previous

AI21 Labs

Use your own AI21 Labs credits through Respan
Next
Built with
Set up Respan
  1. Sign up — Create an account at platform.respan.ai
  2. Create an API key — Generate one on the API keys page
  3. Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page
Use AI

Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.

1{
2 "mcpServers": {
3 "respan-docs": {
4 "url": "https://mcp.respan.ai/mcp/docs"
5 }
6 }
7}
Get xAI API key

Get your xAI API key from the xAI Console to start using xAI models through Respan.

xAI models compatibility

✅ Supported Frameworks
  • OpenAI SDK
  • LangChain SDK
  • Vercel/OpenAI
  • Vercel/Google
  • LlamaIndex SDK
  • Google GenAI
  • Respan native (Otel)
❌ Unsupported Frameworks
  • Anthropic SDK
  • Vercel/Anthropic

Add xAI API keys

There are 2 ways to add your xAI credentials to your requests:

Via UI

1

Go to the Providers page

Go to Providers page

Providers Page
2

Add your xAI credentials.

Follow the on-screen instructions to add your xAI API key.

Via code

  • Add customer_credentials parameter in your request body to use your own xAI credits.
1{
2 // Rest of the request body
3 "customer_credentials": {
4 "xai": {
5 "api_key": "YOUR_XAI_API_KEY"
6 }
7 }
8}

Full request example

Example
1from openai import OpenAI
2
3client = OpenAI(
4 base_url="https://api.respan.ai/api/",
5 api_key="YOUR_RESPAN_API_KEY",
6)
7
8response = client.chat.completions.create(
9 model="gpt-4o",
10 messages=[{"role":"user", "content":"Tell me a long story"}],
11 extra_body={"customer_credentials": {
12 "xai": {
13 "api_key": "YOUR_XAI_API_KEY",
14 }
15 }
16 }
17)