API Endpoints

All LW AI API requests are made to https://openapi.linkwo.ai. The API is fully OpenAI-compatible, so you can use any OpenAI SDK by changing the base URL.

Base URL

RegionBase URL
Global (single endpoint)https://openapi.linkwo.ai/v1

openapi.linkwo.ai uses GeoDNS to route users to the nearest region: American users to Hillsboro, and other international users to Singapore. All regions share the same data and API key.

Available Endpoints

Chat & Text Generation

EndpointMethodDescription
/v1/chat/completionsPOSTGenerate chat completions
/v1/completionsPOSTText completions (legacy)

Embeddings

EndpointMethodDescription
/v1/embeddingsPOSTGenerate text embeddings

Models

EndpointMethodDescription
/v1/modelsGETList available models
/v1/models/{model}GETGet model details

Batch

EndpointMethodDescription
/v1/batchesPOSTCreate a batch
/v1/batches/{batch_id}GETGet batch status
/v1/batches/{batch_id}/cancelPOSTCancel a batch

Files

EndpointMethodDescription
/v1/filesGETList files
/v1/filesPOSTUpload a file
/v1/files/{file_id}GETGet file info
/v1/files/{file_id}/contentGETDownload file content
/v1/files/{file_id}DELETEDelete a file

Responses

EndpointMethodDescription
/v1/responsesPOSTCreate a response (agentic)

Listing Models

curl https://openapi.linkwo.ai/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://openapi.linkwo.ai/v1",
    api_key="YOUR_API_KEY"
)

Node.js

import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://openapi.linkwo.ai/v1',
  apiKey: 'YOUR_API_KEY',
});