Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use the official OpenAI SDK with XMAI’s OpenAI-compatible endpoint.
from openai import OpenAI client = OpenAI( api_key="your-XMAI-api-key", base_url="https://xmapi.site/v1", ) response = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Explain what a race condition is."}], ) print(response.choices[0].message.content)
import OpenAI from "openai"; const client = new OpenAI({ apiKey: "your-XMAI-api-key", baseURL: "https://xmapi.site/v1", }); const response = await client.chat.completions.create({ model: "claude-opus-4-8", messages: [{ role: "user", content: "Explain what a race condition is." }], }); console.log(response.choices[0].message.content);