xAI

Use your own xAI credits through 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

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://docs.respan.ai/mcp"
5 }
6 }
7}

xAI models compatibility

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

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)