curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "V8.2",
"prompt": "a cute cat",
"parameters": {
"stylize": 1000,
"chaos": 100,
"weird": 1000,
"seed": 1231231,
"sw": 1000,
"iw": 1,
"no": "black cat",
"aspect": "9:16",
"raw": true,
"tile": true
},
"images": [
{
"type": "style_reference",
"image_url": "https://example.com/style.png"
},
{
"type": "image_reference",
"image_url": "https://example.com/reference.png"
}
],
"mode": "fast"
}
'import requests
url = "https://api.tikway.ai/v1/images/generations"
payload = {
"model": "V8.2",
"prompt": "a cute cat",
"parameters": {
"stylize": 1000,
"chaos": 100,
"weird": 1000,
"seed": 1231231,
"sw": 1000,
"iw": 1,
"no": "black cat",
"aspect": "9:16",
"raw": True,
"tile": True
},
"images": [
{
"type": "style_reference",
"image_url": "https://example.com/style.png"
},
{
"type": "image_reference",
"image_url": "https://example.com/reference.png"
}
],
"mode": "fast"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'V8.2',
prompt: 'a cute cat',
parameters: {
stylize: 1000,
chaos: 100,
weird: 1000,
seed: 1231231,
sw: 1000,
iw: 1,
no: 'black cat',
aspect: '9:16',
raw: true,
tile: true
},
images: [
{type: 'style_reference', image_url: 'https://example.com/style.png'},
{type: 'image_reference', image_url: 'https://example.com/reference.png'}
],
mode: 'fast'
})
};
fetch('https://api.tikway.ai/v1/images/generations', 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://api.tikway.ai/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'V8.2',
'prompt' => 'a cute cat',
'parameters' => [
'stylize' => 1000,
'chaos' => 100,
'weird' => 1000,
'seed' => 1231231,
'sw' => 1000,
'iw' => 1,
'no' => 'black cat',
'aspect' => '9:16',
'raw' => true,
'tile' => true
],
'images' => [
[
'type' => 'style_reference',
'image_url' => 'https://example.com/style.png'
],
[
'type' => 'image_reference',
'image_url' => 'https://example.com/reference.png'
]
],
'mode' => 'fast'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tikway.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"V8.2\",\n \"prompt\": \"a cute cat\",\n \"parameters\": {\n \"stylize\": 1000,\n \"chaos\": 100,\n \"weird\": 1000,\n \"seed\": 1231231,\n \"sw\": 1000,\n \"iw\": 1,\n \"no\": \"black cat\",\n \"aspect\": \"9:16\",\n \"raw\": true,\n \"tile\": true\n },\n \"images\": [\n {\n \"type\": \"style_reference\",\n \"image_url\": \"https://example.com/style.png\"\n },\n {\n \"type\": \"image_reference\",\n \"image_url\": \"https://example.com/reference.png\"\n }\n ],\n \"mode\": \"fast\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tikway.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"V8.2\",\n \"prompt\": \"a cute cat\",\n \"parameters\": {\n \"stylize\": 1000,\n \"chaos\": 100,\n \"weird\": 1000,\n \"seed\": 1231231,\n \"sw\": 1000,\n \"iw\": 1,\n \"no\": \"black cat\",\n \"aspect\": \"9:16\",\n \"raw\": true,\n \"tile\": true\n },\n \"images\": [\n {\n \"type\": \"style_reference\",\n \"image_url\": \"https://example.com/style.png\"\n },\n {\n \"type\": \"image_reference\",\n \"image_url\": \"https://example.com/reference.png\"\n }\n ],\n \"mode\": \"fast\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tikway.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"V8.2\",\n \"prompt\": \"a cute cat\",\n \"parameters\": {\n \"stylize\": 1000,\n \"chaos\": 100,\n \"weird\": 1000,\n \"seed\": 1231231,\n \"sw\": 1000,\n \"iw\": 1,\n \"no\": \"black cat\",\n \"aspect\": \"9:16\",\n \"raw\": true,\n \"tile\": true\n },\n \"images\": [\n {\n \"type\": \"style_reference\",\n \"image_url\": \"https://example.com/style.png\"\n },\n {\n \"type\": \"image_reference\",\n \"image_url\": \"https://example.com/reference.png\"\n }\n ],\n \"mode\": \"fast\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "image.generation",
"model": "<string>",
"status": "pending",
"polling_url": "<string>",
"data": {
"prompt": "<string>",
"effective_prompt": "<string>",
"mode": "fast",
"parameters": {},
"progress": 50,
"actions": [
"<string>"
],
"native_url": {
"url": "<string>",
"split_image_urls": [
"<string>"
]
},
"image_url": {
"url": "<string>",
"split_image_urls": [
"<string>"
]
}
},
"error": {
"code": "<string>",
"message": "<string>"
},
"parent_task_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
}图片生成
model 可用模型库 ID 或已支持的别名;模型与 prompt 中的版本参数必须一致。此操作只描述首次生图,不包含同路径的任务动作。
curl --request POST \
--url https://api.tikway.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "V8.2",
"prompt": "a cute cat",
"parameters": {
"stylize": 1000,
"chaos": 100,
"weird": 1000,
"seed": 1231231,
"sw": 1000,
"iw": 1,
"no": "black cat",
"aspect": "9:16",
"raw": true,
"tile": true
},
"images": [
{
"type": "style_reference",
"image_url": "https://example.com/style.png"
},
{
"type": "image_reference",
"image_url": "https://example.com/reference.png"
}
],
"mode": "fast"
}
'import requests
url = "https://api.tikway.ai/v1/images/generations"
payload = {
"model": "V8.2",
"prompt": "a cute cat",
"parameters": {
"stylize": 1000,
"chaos": 100,
"weird": 1000,
"seed": 1231231,
"sw": 1000,
"iw": 1,
"no": "black cat",
"aspect": "9:16",
"raw": True,
"tile": True
},
"images": [
{
"type": "style_reference",
"image_url": "https://example.com/style.png"
},
{
"type": "image_reference",
"image_url": "https://example.com/reference.png"
}
],
"mode": "fast"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'V8.2',
prompt: 'a cute cat',
parameters: {
stylize: 1000,
chaos: 100,
weird: 1000,
seed: 1231231,
sw: 1000,
iw: 1,
no: 'black cat',
aspect: '9:16',
raw: true,
tile: true
},
images: [
{type: 'style_reference', image_url: 'https://example.com/style.png'},
{type: 'image_reference', image_url: 'https://example.com/reference.png'}
],
mode: 'fast'
})
};
fetch('https://api.tikway.ai/v1/images/generations', 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://api.tikway.ai/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'V8.2',
'prompt' => 'a cute cat',
'parameters' => [
'stylize' => 1000,
'chaos' => 100,
'weird' => 1000,
'seed' => 1231231,
'sw' => 1000,
'iw' => 1,
'no' => 'black cat',
'aspect' => '9:16',
'raw' => true,
'tile' => true
],
'images' => [
[
'type' => 'style_reference',
'image_url' => 'https://example.com/style.png'
],
[
'type' => 'image_reference',
'image_url' => 'https://example.com/reference.png'
]
],
'mode' => 'fast'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tikway.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"V8.2\",\n \"prompt\": \"a cute cat\",\n \"parameters\": {\n \"stylize\": 1000,\n \"chaos\": 100,\n \"weird\": 1000,\n \"seed\": 1231231,\n \"sw\": 1000,\n \"iw\": 1,\n \"no\": \"black cat\",\n \"aspect\": \"9:16\",\n \"raw\": true,\n \"tile\": true\n },\n \"images\": [\n {\n \"type\": \"style_reference\",\n \"image_url\": \"https://example.com/style.png\"\n },\n {\n \"type\": \"image_reference\",\n \"image_url\": \"https://example.com/reference.png\"\n }\n ],\n \"mode\": \"fast\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tikway.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"V8.2\",\n \"prompt\": \"a cute cat\",\n \"parameters\": {\n \"stylize\": 1000,\n \"chaos\": 100,\n \"weird\": 1000,\n \"seed\": 1231231,\n \"sw\": 1000,\n \"iw\": 1,\n \"no\": \"black cat\",\n \"aspect\": \"9:16\",\n \"raw\": true,\n \"tile\": true\n },\n \"images\": [\n {\n \"type\": \"style_reference\",\n \"image_url\": \"https://example.com/style.png\"\n },\n {\n \"type\": \"image_reference\",\n \"image_url\": \"https://example.com/reference.png\"\n }\n ],\n \"mode\": \"fast\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tikway.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"V8.2\",\n \"prompt\": \"a cute cat\",\n \"parameters\": {\n \"stylize\": 1000,\n \"chaos\": 100,\n \"weird\": 1000,\n \"seed\": 1231231,\n \"sw\": 1000,\n \"iw\": 1,\n \"no\": \"black cat\",\n \"aspect\": \"9:16\",\n \"raw\": true,\n \"tile\": true\n },\n \"images\": [\n {\n \"type\": \"style_reference\",\n \"image_url\": \"https://example.com/style.png\"\n },\n {\n \"type\": \"image_reference\",\n \"image_url\": \"https://example.com/reference.png\"\n }\n ],\n \"mode\": \"fast\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "image.generation",
"model": "<string>",
"status": "pending",
"polling_url": "<string>",
"data": {
"prompt": "<string>",
"effective_prompt": "<string>",
"mode": "fast",
"parameters": {},
"progress": 50,
"actions": [
"<string>"
],
"native_url": {
"url": "<string>",
"split_image_urls": [
"<string>"
]
},
"image_url": {
"url": "<string>",
"split_image_urls": [
"<string>"
]
}
},
"error": {
"code": "<string>",
"message": "<string>"
},
"parent_task_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求头
上游速度cost、stable、fast
请求体
- Niji 5
- Niji 5
- Niji 6
- Niji 6
- Niji 7
- Niji 7
- V 5.2
- V 5.2
- V 6
- V 6
- V 6.1
- V 6.1
- V 7
- V 7
- V 8.1
- V 8.1
- V 8.2
- V 8.2
模型 Niji 5,版本 niji 5。只包含当前项目中启用的参数。
Niji 5;推荐使用模型库 ID midjourney/niji-5。
midjourney/niji-5, NIJI5, niji 5 文本提示词,可带 Midjourney CLI 参数;显式 parameters 优先。
1Niji 5 的结构化原生参数;只列出当前启用的参数。
Hide child attributes
Hide child attributes
原生模型版本;必须与顶层 model 一致。
niji 5 生成通道;默认 DISCORD。部分功能仅支持 WEB。
DISCORD, WEB 宽高比,与顶层 aspect_ratio 二选一;一般最大长短边比 14:1,V8 HD 为 4:1。
^[1-9][0-9]{0,8}:[1-9][0-9]{0,8}$"1:1"
"2:3"
"3:2"
"9:16"
"16:9"
变化程度。
0 <= x <= 100风格化强度。
0 <= x <= 1000Midjourney 原生数值质量,不是顶层质量档位。
0.25, 0.5, 1 0 < x <= 1模型专属风格。
expressive, cute, original, scenic 1^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$随机种子;Turbo 模式下种子锁定不可靠。
0 <= x <= 4294967295无缝平铺。
false, true 排除内容。
1\S图片提示词 URL 列表;也可以通过 images 的 image_reference 传入。
1 - 4 elements^https?://\S+$图片提示词权重,需提供 ref 或 image_reference。
0.2 <= x <= 2生成速度模式;顶层 mode 优先。当前代理不接受 turbo。
fast, relax 重复次数;受订阅方案限制,Relax 模式不可用。
2 <= x <= 40提前停止的完成百分比。
10 <= x <= 100代理当前接受 relax 和 fast;turbo 上游不支持。
relax, fast 平台质量档位。auto 表示不显式设置原生 quality。
auto, low, medium, standard 宽高比;一般最大 14:1,V8 HD 最大 4:1。
^[1-9][0-9]{0,8}:[1-9][0-9]{0,8}$兼容字段:auto 或宽高比;不接受像素尺寸。
"auto"任务通知回调 URL。
^https?://是否向 webhook_url 通知过程图。
响应
任务已接受,使用 polling_url 查询结果。
11pending, in_progress, completed, failed 1Hide child attributes
Hide child attributes
1fast, relax 0 <= x <= 10011
