Quick start
This guide shows how to call the Xiaoku API, which endpoints are available, and how to send your first request.
Endpoints
| Type | Path | Notes |
|---|---|---|
| Chat completions | /v1/chat/completions | OpenAI compatible |
| Chat completions | /v1/responses | OpenAI compatible |
| Gemini chat | /v1beta/models/{model}:generateContent | Gemini native |
| Claude chat | /v1/messages | Anthropic compatible |
Setup
Base URL
The Xiaoku API base URL is:
https://api-ai.xiaoku.ai/v1Point base_url at this host and keep the rest of your client the same.
1. Get an API key
Sign in to the Xiaoku console, open API key management, and create a key.
2. Install a client
curl or an HTTP client such as Postman or Apifox is enough to try the API.
3. Authenticate
Send the API key on every request:
bash
-H "Authorization: Bearer YOUR_API_KEY"Examples
Chat completions (OpenAI compatible)
/v1/chat/completions:
bash
curl -X POST https://api-ai.xiaoku.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v3.2-exp",
"messages": [
{ "role": "user", "content": "Hello" }
]
}'/v1/responses:
bash
curl -X POST https://api-ai.xiaoku.ai/v1/responses \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5",
"input": [
{
"role": "user",
"content": "Introduce Python"
}
]
}'Claude chat (Anthropic compatible)
bash
curl -X POST https://api-ai.xiaoku.ai/v1/messages \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"model": "claude-opus-4-5-20251101",
"messages": [
{ "role": "user", "content": "Hello" }
]
}'Gemini chat (Gemini native)
bash
curl -X POST https://api-ai.xiaoku.ai/v1beta/models/gemini-3.1-pro-preview:generateContent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"parts": [
{ "text": "Hello" }
]
}
]
}'Next
- LLM module for endpoint details
- Integration tools for IDE setup
- Image generation for the image API
