infrastructure
API Endpoints
Reference for all LW AI API endpoints and base URLs.
All LW AI API requests are made to https://api.atrouter.cn. The API is fully OpenAI-compatible, so you can use any OpenAI SDK by changing the base URL.
Base URL
| Region | Base URL |
|---|---|
| Global (single endpoint) | https://api.atrouter.cn/v1 |
https://api.atrouter.cnuses GeoDNS to route users to the nearest region: mainland China users to the Beijing cluster. All regions share the same data and API key.
Available Endpoints
Chat & Text Generation
| Endpoint | Method | Description |
|---|---|---|
/v1/chat/completions | POST | Generate chat completions |
/v1/completions | POST | Text completions (legacy) |
Embeddings
| Endpoint | Method | Description |
|---|---|---|
/v1/embeddings | POST | Generate text embeddings |
Models
| Endpoint | Method | Description |
|---|---|---|
/v1/models | GET | List available models |
/v1/models/{model} | GET | Get model details |
Batch
| Endpoint | Method | Description |
|---|---|---|
/v1/batches | POST | Create a batch |
/v1/batches/{batch_id} | GET | Get batch status |
/v1/batches/{batch_id}/cancel | POST | Cancel a batch |
Files
| Endpoint | Method | Description |
|---|---|---|
/v1/files | GET | List files |
/v1/files | POST | Upload a file |
/v1/files/{file_id} | GET | Get file info |
/v1/files/{file_id}/content | GET | Download file content |
/v1/files/{file_id} | DELETE | Delete a file |
Responses
| Endpoint | Method | Description |
|---|---|---|
/v1/responses | POST | Create a response (agentic) |
Listing Models
curl https://api.atrouter.cn/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"Response:
{
"object": "list",
"data": [
{"id": "deepseek/deepseek-v4-pro", "object": "model", "created": 1719000000, "owned_by": "linkwo"},
{"id": "deepseek/deepseek-v4-flash", "object": "model", "created": 1719000000, "owned_by": "linkwo"},
{"id": "z-ai/glm-5.1", "object": "model", "created": 1719000000, "owned_by": "linkwo"},
{"id": "z-ai/glm-5.2", "object": "model", "created": 1719000000, "owned_by": "linkwo"},
{"id": "linkwo/fusion", "object": "model", "created": 1719000000, "owned_by": "linkwo"},
{"id": "astra", "object": "model", "created": 1719000000, "owned_by": "linkwo"}
]
}SDK Configuration
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.atrouter.cn/v1",
api_key="YOUR_API_KEY"
)Node.js
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.atrouter.cn/v1',
apiKey: 'YOUR_API_KEY',
});Related
- Regions & Deployment — Regional infrastructure details
- Rate Limits — API rate limiting
- Authentication — API key setup