AITRE API Documents
  1. MidJourney
AITRE API Documents
  • 介绍
  • 项目说明
  • 发出请求
  • Openai格式聊天(Chat)
    • gpt-4o-image文生图
      POST
    • 聊天接口
      POST
  • 文生图(Images)
    • Openai格式的DALL·E 3
      POST
    • Openai格式的Flux
      POST
    • Openai格式的Gpt-image-1
      POST
  • 音频接口(Audio)
    • TTS语音转文本
      POST
    • 创建转录
      POST
    • 创建翻译
      POST
  • 向量接口(Embeddings)
    • 嵌入对象
    • 创建嵌入
      POST
  • 模型(Models)
    • 列出模型
      GET
  • 自动补全(Completions)
    • 内容补全接口
      POST
  • MidJourney
    • 说明
    • 根据TaskId查询任务
      GET
    • 提交swap_face任务
      POST
    • 执行Action任务
      POST
    • 提交Blend任务(图生图)
      POST
    • 提交Describe任务(图生文)
      POST
    • 提交Imagine任务(文生图、文图生图)
      POST
    • 提交Modal(提交局部重绘、ZOOM)
      POST
    • 提交Shorten任务(prompt分析)
      POST
  1. MidJourney

提交swap_face任务

POST
{{BASE_URL}}/mj/insight-face/swap

请求参数

Header 参数
Authorization
string 
可选
示例值:
Bearer {{YOUR_API_KEY}}
Body 参数application/json
sourceBase64
string 
必需
人脸源图片base64
targetBase64
string 
必需
目标图片base64
notifyHook
string 
可选
回调地址, 为空时使用全局notifyHook
state
string 
自定义参数
可选
示例
{
    "sourceBase64": "data:image/png;base64,xxx1",
    "targetBase64": "data:image/png;base64,xxx2",
    "notifyHook": "string",
    "state": "string"
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST '{{BASE_URL}}/mj/insight-face/swap' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sourceBase64": "data:image/png;base64,xxx1",
    "targetBase64": "data:image/png;base64,xxx2",
    "notifyHook": "string",
    "state": "string"
}'

返回响应

🟢200成功
application/json
Body
code
integer 
必需
description
string 
必需
result
string 
必需
示例
{
    "code": 0,
    "description": "string",
    "result": "string"
}
修改于 2024-10-22 10:06:29
上一页
根据TaskId查询任务
下一页
执行Action任务
Built with