Overview
CloudBase AI provides unified large model access capabilities, supporting multi-platform calls including Web, Mini Programs, and Node.js, with one set of code adapting to multiple models.
Supported Models
| Model | Provider | Description |
|---|---|---|
| Tencent Hunyuan | hunyuan.tencent.com | Tencent's proprietary large model |
| DeepSeek | deepseek.com | High-performance inference model |
| Custom Models | - | Support for any model compatible with OpenAI protocol |
See complete model list on CloudBase AI Console
Core Capabilities
| Capability | Description | Supported Platforms |
|---|---|---|
| Text Generation | Non-streaming call, returns complete result at once | Web / Mini Program / Node.js |
| Streaming Text Generation | Streaming return, suitable for real-time conversation scenarios | Web / Mini Program / Node.js |
| Image Generation | Text-to-image capability | Node.js |
| Image Understanding | Image-to-text capability | Web / Node.js |
| Tool Calling | Function Calling, extends model capabilities | Web / Node.js |
Calling Methods
Choose the appropriate calling method based on your development scenario:
| Calling Method | Use Case | Documentation |
|---|---|---|
| Mini Program SDK | WeChat Mini Program / Mini Games | Mini Program Calling |
| Web SDK | Browser-based Web applications | Web SDK Calling |
| Node SDK | Cloud Functions, CloudBase Run, Node.js services | Node SDK Calling |
| cURL / HTTP API | Backend services, scripts, any language | cURL Calling |
| OpenAI SDK | Project migration compatible with OpenAI SDK | OpenAI SDK Calling |
Quick Start
1. Get Environment ID and API Key
- Visit CloudBase Console
- Go to Environment Configuration → API Key Configuration
- Create API Key (for HTTP API calls) or Publishable Key (for client SDK)
2. Configure Large Model
- Visit CloudBase AI Console
- Select the large model you want to access
- Fill in the API Key provided by the model provider
For detailed configuration instructions, see Large Model Configuration Guide
3. Choose Calling Method
Web example:
import cloudbase from "@cloudbase/js-sdk";
const app = cloudbase.init({
env: "<YOUR_ENV_ID>",
accessKey: "<YOUR_PUBLISHABLE_KEY>"
});
const ai = app.ai();
const model = ai.createModel("hunyuan-exp");
const result = await model.streamText({
model: "hunyuan-turbos-latest",
messages: [{ role: "user", content: "Hello" }],
});
for await (const text of result.textStream) {
console.log(text);
}
Mini Program example:
wx.cloud.init({ env: "<YOUR_ENV_ID>" });
const model = wx.cloud.extend.AI.createModel("hunyuan-exp");
const result = await model.generateText({
model: "hunyuan-turbos-latest",
messages: [{ role: "user", content: "Hello" }],
});
console.log(result.choices[0].message.content);