Skip to content

FAQ

What is the difference between xmAI and calling OpenAI/Anthropic/Google directly?

xmAI provides a unified API that lets you access models from multiple providers (OpenAI, Anthropic, Google, and more) through a single endpoint and API key. Benefits include:

  • One API, many models — No need to manage separate accounts and keys for each provider
  • Cost savings — Pay-as-you-go pricing with competitive rates
  • High availability — Automatic failover across multiple channels
  • OpenAI-compatible — Use the standard OpenAI SDK with zero code changes

How do I migrate from OpenAI to xmAI?

It's a one-line change. Just update the base_url in your OpenAI SDK configuration:

python
# Before (OpenAI direct)
client = OpenAI(api_key="sk-openai-key")

# After (xmAI)
client = OpenAI(
    api_key="sk-your-xmai-key",
    base_url="https://api.xmai.sg/v1",
)
javascript
// Before (OpenAI direct)
const client = new OpenAI({ apiKey: 'sk-openai-key' })

// After (xmAI)
const client = new OpenAI({
  apiKey: 'sk-your-xmai-key',
  baseURL: 'https://api.xmai.sg/v1',
})

All your existing code — model parameters, message formats, streaming — works exactly the same.

Using a CLI like Claude Code / OpenCode / Codex? See Integrations for step-by-step guides.

What models are supported?

xmAI supports models from OpenAI, Anthropic, Google, and more. Visit the Models page for the full list with real-time pricing.

How do I check my balance and usage?

Log in to the Dashboard to view:

  • Balance — Your current account balance
  • Usage — Request history and cost breakdown
  • Top-up — Add funds via credit card (powered by Airwallex)

What if I lose my API key?

API keys are only shown once when created. If you lose your key:

  1. Log in to the Dashboard
  2. Revoke the lost key (to prevent unauthorized use)
  3. Create a new key
  4. Update your application with the new key

How do I troubleshoot failed requests?

  1. Check the error response — The type field tells you what went wrong. See Error Codes for details.
  2. Verify your API key — Make sure the key is valid and included in the Authorization: Bearer header.
  3. Check your balance — A 402 error means you need to top up.
  4. Check rate limits — A 429 error means you're sending too many requests. Implement backoff and retry.
  5. Try a different model — A 503 error means the model is temporarily unavailable. Try an alternative model.
  6. Check the request format — Ensure your request body matches the API reference.

The Unified API for LLMs