图片反推提示词
服务正常
视觉大模型
1 点 / 次
上传图片,AI 分析画面并生成可直接用于 AI 绘画的提示词。
每次成功调用扣除 1 点。调用失败(上游异常)自动退还点数。
请求参数
| 参数名 | 必填 | 类型 | 示例值 | 说明 |
|---|---|---|---|---|
service |
必填 | string | image |
固定值 image |
image |
必填 | string | data:image/jpeg;base64,... |
图片 base64 data URL,或 https 图片地址 |
返回参数
| 字段名 | 类型 | 说明 |
|---|---|---|
code | int | 0 表示成功 |
data.prompt | string | 生成的反推提示词 |
data.credits_cost | int | 本次消耗点数 |
data.credits_balance | int | 剩余点数 |
暂无返回示例。
| 错误码 | 说明 |
|---|---|
0 | 成功 |
401 | API Key 无效或已禁用 |
402 | 点数不足,请充值 |
500 | 服务器内部错误 |
cURL
curl -X POST "https://www.wkidc.cn/api/v1/prompt.php" \
-H "X-API-Key: sk_你的KEY" \
-H "Content-Type: application/json" \
-d '{"service":"image","image":"data:image\/jpeg;base64,..."}'
PHP
<?php
$endpoint = 'https://www.wkidc.cn/api/v1/prompt.php';
$apiKey = 'sk_你的KEY';
$params = array (
'service' => 'image',
'image' => 'data:image/jpeg;base64,...',
);
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($params, JSON_UNESCAPED_UNICODE),
]);
$res = curl_exec($ch);
curl_close($ch);
var_dump(json_decode($res, true));
Python
import requests
url = 'https://www.wkidc.cn/api/v1/prompt.php'
headers = {'X-API-Key': 'sk_你的KEY'}
params = array (
'service' => 'image',
'image' => 'data:image/jpeg;base64,...',
)
resp = requests.post(url, headers=headers, json=params)
print(resp.json())
Node.js
const res = await fetch('https://www.wkidc.cn/api/v1/prompt.php', {
method: 'POST',
headers: {
'X-API-Key': 'sk_你的KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({"service":"image","image":"data:image\/jpeg;base64,..."})
});
console.log(await res.json());
Go
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
body := []byte(`{"service":"image","image":"data:image\/jpeg;base64,..."}`)
req, _ := http.NewRequest("POST", "https://www.wkidc.cn/api/v1/prompt.php", bytes.NewBuffer(body))
req.Header.Set("X-API-Key", "sk_你的KEY")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
b, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(b))
}
在线调试会真实请求接口并消耗你的点数,请勿填写私密信息。每账号每小时最多 30 次。
| 参数名 | 值 |
|---|---|
service 必填固定值 image |
|
image 必填图片 base64 data URL,或 https 图片地址 |