Skip to content

SDKs

Official and community SDKs for CPAI.

Use the official OpenAI SDK with our API by changing the base URL:

from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8080/v1",
api_key="your-api-key" # Your CPAI API key
)
response = client.chat.completions.create(
model="kimi-k2.5",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Use the OpenAI JavaScript SDK:

import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'http://localhost:8080/v1',
apiKey: 'your-api-key'
});
const response = await client.chat.completions.create({
model: 'kimi-k2.5',
messages: [{ role: 'user', content: 'Hello!' }]
});
console.log(response.choices[0].message.content);

Since we support the OpenAI API format, you can use any HTTP client:

Terminal window
curl http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k2.5",
"messages": [{"role": "user", "content": "Hello!"}]
}'
  • Official Python SDK with additional features
  • Official JavaScript/TypeScript SDK
  • Go SDK
  • Rust SDK