Developer quick connection
For Xuo Code, see the client setup guide. For other clients, see Codex or CC Switch. Start here to build your own application.
1. Prepare a key and credit
Sign in to the Xuo console, create an API key and check your wallet or subscription credit. Choose an automatic or specific group and check the model's supported endpoints in Model Square.
| Setting | Value |
|---|---|
| Service URL | https://api.xuo.cc |
| OpenAI-compatible SDK Base URL | https://api.xuo.cc/v1 |
| API Key | Your full Xuo API key |
| Model ID | A full model ID available to your key and supporting your endpoint |
Use a Base URL ending in /v1. Do not append /chat/completions or duplicate /v1/v1.
Production address
These are the production addresses. Until the production server is deployed, an accessible documentation preview does not mean the API is ready for calls.
2. Set environment variables
Keep your key in server-side environment variables. Replace both placeholders with your key and an available model ID. The Python, Node.js and streaming examples use these same variables.
macOS / Linux:
export XUO_API_KEY='YOUR_XUO_API_KEY'
export XUO_MODEL='YOUR_AVAILABLE_MODEL_ID'Windows PowerShell:
$env:XUO_API_KEY = 'YOUR_XUO_API_KEY'
$env:XUO_MODEL = 'YOUR_AVAILABLE_MODEL_ID'These commands apply only to the current terminal. Set them again in a new terminal. Never put real keys in browser code, public repositories or screenshots.
3. List available models
macOS / Linux:
curl --fail-with-body https://api.xuo.cc/v1/models \
-H "Authorization: Bearer $XUO_API_KEY"Windows PowerShell:
Invoke-RestMethod -Uri 'https://api.xuo.cc/v1/models' `
-Headers @{ Authorization = "Bearer $env:XUO_API_KEY" }The data[].id values are model IDs. Permissions and groups affect availability. A listed model does not necessarily support every endpoint.
4. Send your first request
This example uses Chat Completions. Confirm that your model supports it first.
macOS / Linux:
curl --fail-with-body https://api.xuo.cc/v1/chat/completions \
-H "Authorization: Bearer $XUO_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"model\":\"$XUO_MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}"Windows PowerShell:
$body = @{
model = $env:XUO_MODEL
messages = @(@{ role = 'user'; content = 'Hello' })
} | ConvertTo-Json -Depth 5
Invoke-RestMethod -Method Post `
-Uri 'https://api.xuo.cc/v1/chat/completions' `
-Headers @{ Authorization = "Bearer $env:XUO_API_KEY" } `
-ContentType 'application/json' -Body $bodyThe result is usually in choices[0].message.content. Check the model, actual group and cost in Usage Logs. Successful calls consume credit under the current billing rules.
Next steps
- Python SDK: installation, model listing and a request.
- Node.js SDK: connect with JavaScript.
- Streaming & troubleshooting: display incremental output and handle errors.
- Existing API examples: authentication, Chat Completions and Responses.
