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:
- Log in to the Dashboard
- Revoke the lost key (to prevent unauthorized use)
- Create a new key
- Update your application with the new key
How do I troubleshoot failed requests?
- Check the error response — The
typefield tells you what went wrong. See Error Codes for details. - Verify your API key — Make sure the key is valid and included in the
Authorization: Bearerheader. - Check your balance — A
402error means you need to top up. - Check rate limits — A
429error means you're sending too many requests. Implement backoff and retry. - Try a different model — A
503error means the model is temporarily unavailable. Try an alternative model. - Check the request format — Ensure your request body matches the API reference.