查询工作流详情
curl --request GET \
--url https://www.chenyu.cn/api/open/v2/workflow/market/info \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chenyu.cn/api/open/v2/workflow/market/info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.chenyu.cn/api/open/v2/workflow/market/info', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.chenyu.cn/api/open/v2/workflow/market/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.chenyu.cn/api/open/v2/workflow/market/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.chenyu.cn/api/open/v2/workflow/market/info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chenyu.cn/api/open/v2/workflow/market/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"workflow_id": "<string>",
"revision_id": "<string>",
"title": "<string>",
"description": "<string>",
"tags": [
{}
],
"covers": [
{}
],
"owner": {},
"quote_currency": "<string>",
"quote_amount": "<string>",
"may_incur_external_model_cost": true,
"external_cost_notice": "<string>",
"editable_parameter_manifest": [
{}
],
"candidate_output_manifest": [
{}
]
}
}工作流市场
查询工作流详情
查询可访问的已发布工作流详情、输入参数清单和输出参数清单
GET
/
api
/
open
/
v2
/
workflow
/
market
/
info
查询工作流详情
curl --request GET \
--url https://www.chenyu.cn/api/open/v2/workflow/market/info \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.chenyu.cn/api/open/v2/workflow/market/info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.chenyu.cn/api/open/v2/workflow/market/info', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.chenyu.cn/api/open/v2/workflow/market/info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.chenyu.cn/api/open/v2/workflow/market/info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.chenyu.cn/api/open/v2/workflow/market/info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.chenyu.cn/api/open/v2/workflow/market/info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 123,
"msg": "<string>",
"data": {
"workflow_id": "<string>",
"revision_id": "<string>",
"title": "<string>",
"description": "<string>",
"tags": [
{}
],
"covers": [
{}
],
"owner": {},
"quote_currency": "<string>",
"quote_amount": "<string>",
"may_incur_external_model_cost": true,
"external_cost_notice": "<string>",
"editable_parameter_manifest": [
{}
],
"candidate_output_manifest": [
{}
]
}
}查询工作流详情
根据工作流 ID 查询当前 API Key 可访问的已发布版本详情。提交运行前,应先读取editable_parameter_manifest,再按参数清单组装 inputs。
版本说明: 返回的
revision_id 是当前可访问的已发布版本。提交运行时可以传入该值来锁定本次调用的版本。可见范围: 支持查询公开发布的工作流,也支持查询当前 API Key 所属用户自己已发布的非公开工作流。
请求参数
工作流 ID
响应参数
响应码,
0 表示成功响应信息
工作流详情
Show data
Show data
工作流 ID
当前发布版本 ID
工作流标题
工作流介绍
工作流标签
工作流封面地址列表
发布者信息,包含
user_id 和 display_name报价币种,当前为
CNY预估报价金额。实际结算以运行完成后的实际消耗为准
是否可能产生第三方模型费用
第三方模型费用提示
可编辑输入参数清单。调用运行接口时,
inputs 的 key 应使用清单中的 key输出参数清单,用于识别运行结果中的输出类型
代码示例
import requests
url = "https://www.chenyu.cn/api/open/v2/workflow/market/info"
headers = {
"Authorization": "Bearer your_api_key",
"Content-Type": "application/json"
}
params = {
"workflow_id": "wf_861ef31e94dcfb10e6e7"
}
response = requests.get(url, headers=headers, params=params)
detail = response.json()["data"]
print(detail["revision_id"])
print(detail["editable_parameter_manifest"])
curl -X GET "https://www.chenyu.cn/api/open/v2/workflow/market/info?workflow_id=wf_861ef31e94dcfb10e6e7" \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json"
响应示例
{
"code": 0,
"msg": "查询成功",
"data": {
"workflow_id": "wf_861ef31e94dcfb10e6e7",
"revision_id": "wfr_f9f2a2dcb99d73b0c3aa",
"title": "文生图111",
"description": "文生图基础工作流",
"tags": ["文生图", "E2E"],
"covers": ["https://www.chenyu.cn/media/example-cover"],
"owner": {
"user_id": 10001,
"display_name": "rohon"
},
"quote_currency": "CNY",
"quote_amount": "0.03000000",
"may_incur_external_model_cost": false,
"external_cost_notice": "",
"editable_parameter_manifest": [
{
"key": "n6_text",
"display_name": "正向提示词",
"type": "string",
"required": true,
"default_value": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,"
},
{
"key": "n7_text",
"display_name": "反向提示词",
"type": "string",
"required": true,
"default_value": "text, watermark"
},
{
"key": "n3_seed",
"display_name": "seed",
"type": "int",
"required": true,
"default_value": 156680208700286
}
],
"candidate_output_manifest": [
{
"key": "n9_images",
"type": "image"
}
]
}
}
⌘I