Source: 对接指南 · Category: Interface — AI Image Generation (接口-AI生图) · Updated 2026-09-29 08:43:16
English Translation
Integration Guide
Before you start — understand the image-generation flow. First get familiar with the relationship between templates, tasks, callbacks, and consumption queries.
What to prepare before starting?
Prepare your merchant ID, merchant secret key, and the image-generation callback URL. AI uses merchant credentials, not the printer-device key.
AI tasks are asynchronous: after the task ID is returned, wait for the callback to receive the synthesized image, then submit a print task separately. A successful image generation does not automatically complete printing.
Next: Check the billing method →
I. Document Notes
Purpose
This document guides developers on how to integrate the AI Image Generation interface and complete debugging and usage of the AI service.
Intended Audience
- Developers
- System integrators
- Technical staff who need to use the AI image-generation service
Integration Flow Overview
Register & Authenticate → Select Model → Submit Task → Asynchronous Generation → Receive Result → Manage Account
II. Integration Flow Overview
Complete Integration in 6 Steps
| Step | Description |
|---|---|
| 1. Register & Authenticate | Obtain the merchant ID and merchant secret key — contact the platform representative to get them. |
| 2. Select Model | When creating an AI task you must pass a template ID; the big-data model mapped to that template will be used to generate the AI image. |
| 3. Create AI Task | Submit a request to the system to generate an image, including the template ID and description content, etc. The system processes it asynchronously and returns the generated image. |
| 4. Asynchronous Callback Notification | After creating an AI task, the system asynchronously notifies the task result via callback. |
| 5. Consumption Records | View the cost details incurred when using the AI service, including the consumption of each image generation. |
| 6. Merchant Info | View the basic profile of the current account, including the merchant ID, balance, and other key information. |
III. AI Model List
Register & Authenticate
How to obtain: Contact the platform representative to obtain the merchant ID and merchant secret key.
| Item | Description |
|---|---|
| Merchant ID | Unique identifier of the account |
| Merchant Secret Key | Used for API signature verification; keep it safe |
Select Model
When creating an AI task you must pass a template ID; the big-data model mapped to that template will be used to generate the AI image.
Notes:
- Each template ID corresponds to one AI generation model
- Different models suit different image-generation scenarios
- The specific template list can be queried by calling the "Get Templates" interface
Create AI Task
Submit a request to the system to generate an image.
Request parameters include:
- Template ID (select the AI model)
- Description content (creative description for image generation)
- Other optional parameters
Processing: The system processes it asynchronously and returns the generated image.
Asynchronous Callback Notification
After creating an AI task, the system asynchronously notifies the task result via callback.
Callback content:
- Task status
- Generated image URL
- Other task information
IV. Interface Calls
Interface List
The AI interface provides the following 5 interfaces:
| No. | Interface Name | Purpose | Docs |
|---|---|---|---|
| 1 | Merchant Signature | Generate the API call signature | View |
| 2 | Get Templates | Get the available AI template list | View |
| 3 | Create AI Task | Submit an AI image-generation request | View |
| 4 | Consumption Records | View AI service consumption details | View |
| 5 | Merchant Info | View basic account information | View |
Call Flow
1. Get merchant credentials → 2. Generate signature → 3. Get templates → 4. Create AI task → 5. Receive callback → 6. View consumption records
V. FAQ
Q1: How do I get the merchant ID and merchant secret key?
A: Contact the platform representative to obtain them.
Q2: What is a template ID?
A: A template ID corresponds to one AI generation model. It must be passed when creating an AI task; the system generates the AI image based on that template.
Q3: How do I get the available template list?
A: Call the "Get Templates" interface to query all available AI templates and their IDs.
Q4: What parameters are required to create an AI task?
A: The main parameters include:
- Template ID (select the AI model)
- Description content (creative description for image generation)
- Other optional parameters (refer to the interface documentation)
Q5: How are AI task results returned?
A: The system uses asynchronous processing:
- After submitting the task, the system immediately returns a task ID
- After processing completes, the result is notified asynchronously via callback
- The callback includes the generated image URL
Q6: How do I view the AI service consumption records?
A: Call the "Consumption Records" interface to view the cost details incurred when using the AI service, including the consumption of each image generation.
Q7: How do I view account information?
A: Call the "Merchant Info" interface to view the basic profile of the current account, including the merchant ID, balance, and other key information.
Q8: What is the merchant signature?
A: The merchant signature is used for identity verification when calling the interface, ensuring request security. Refer to the "Merchant Signature" documentation for the specific generation method.
Q9: How long does AI image generation take?
A: Generating a single image currently takes about 30 seconds. The system uses asynchronous processing; the actual generation time depends on image complexity and system load. You will be notified via callback once generation is complete.
The following documents are related to AI interface integration and may need to be reviewed together:
| Document | Purpose |
|---|---|
| About the AI Interface | Detailed explanation of the AI interface |
| Merchant Signature | Generate the API call signature |
| Get Templates | Get the available AI template list |
| Create AI Task | Submit an AI image-generation request |
| Consumption Records | View AI service consumption details |
| Merchant Info | View basic account information |
Congratulations — you have completed the basic integration of the AI Image Generation interface and can now use it formally in your business scenarios!
If you encounter unsolvable issues while debugging the device, contact the cloud-printing representative for troubleshooting. Contact details: Tel: 137-5177-4454 [WeChat same number] Email: info@ColorPark.cn