Introduction
Developer docsIntroduction
DEVELOPER DOCUMENTATION

One endpoint for every AI model

XAPI provides one OpenAI-compatible interface. Keep the SDK you know and change only the base URL and API key to switch across models and providers.

All API systems operationalLast updated September 2026
Unified base URLhttps://api.xapi.love/v1
01

Make your first call in 5 minutes

Create a key, install the SDK, and send your first request. Every model shares the same authentication and balance.

Get an API key

Create a key in the console. It is shown in full only once—store it safely and never commit it to client code or a public repository.

Open console

Install the OpenAI SDK

XAPI works with the OpenAI SDK. Existing projects usually only need a client configuration change.

bash
pip install openai

Send a chat request

Model IDs are case-sensitive. Copy a currently available model ID from the model marketplace.

View model list
python
from openai import OpenAI

client = OpenAI(
    api_key="$XAPI_API_KEY",
    base_url="https://api.xapi.love/v1",
)

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

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

Response shape

Successful requests follow the OpenAI Chat Completions format. Log the request_id in production to make troubleshooting easier.

json
{
  "id": "chatcmpl_xapi_01",
  "object": "chat.completion",
  "model": "gpt-5.4",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "Hello!" },
    "finish_reason": "stop"
  }],
  "usage": { "prompt_tokens": 12, "completion_tokens": 4, "total_tokens": 16 }
}
03

Core endpoints

Every request uses Bearer Token authentication and sends JSON over HTTPS.

MethodPathPurpose
POST/v1/chat/completionsCreate a chat completion
GET/v1/modelsList available models
POST/v1/responsesCreate a Responses task
GET/v1/dashboard/billingGet account balance and usage
04

Error handling

XAPI uses standard HTTP status codes and returns a readable error message. Retry 429 and 5xx responses with exponential backoff.

StatusMeaningRecommended action
400Invalid request parametersCheck fields, types, and model ID
401Authentication failedCheck the API key and Authorization header
429Too many requestsReduce concurrency and retry with backoff
500Temporary service failureContact support with the request_id
Next steps

Keep exploring

When you are ready, read the complete API reference or choose a model for your workload.