图片反推提示词

服务正常 视觉大模型 1 点 / 次

上传图片,AI 分析画面并生成可直接用于 AI 绘画的提示词。

接口地址
https://www.wkidc.cn/api/v1/prompt.php
请求方式POST
返回格式application/json
免费额度注册赠送
累计调用44 次

每次成功调用扣除 1 点。调用失败(上游异常)自动退还点数。

请求参数

参数名必填类型示例值说明
service 必填 string image 固定值 image
image 必填 string data:image/jpeg;base64,... 图片 base64 data URL,或 https 图片地址

返回参数

字段名类型说明
codeint0 表示成功
data.promptstring生成的反推提示词
data.credits_costint本次消耗点数
data.credits_balanceint剩余点数

暂无返回示例。

错误码说明
0成功
401API 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 图片地址