Skip to content

任务:图生文 Describe

概览

  • 请求方法:POST
  • 路径:/mj/submit/describe
  • 内容类型:application/json

认证

  • 使用 HTTP Bearer Token,示例:Authorization: Bearer sk-xxxxx

请求参数

参数类型必填描述
base64string图片的 base64 字符串,如 data:image/png;base64,xxx
notifyHookstring回调地址,为空使用全局 notifyHook
statestring自定义透传参数

建议字段顺序:base64, notifyHook, state


请求示例

json
{
  "base64": "data:image/png;base64,xxx",
  "notifyHook": "",
  "state": "desc-001"
}

curl

bash
curl -X POST "https://api.gpt.ge/mj/submit/describe" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-xxxx" \
  -d '{"base64":"data:image/png;base64,xxx","notifyHook":"","state":"desc-001"}'

JavaScript (fetch)

javascript
fetch('https://api.gpt.ge/mj/submit/describe', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer sk-xxxx' },
  body: JSON.stringify({ base64: 'data:image/png;base64,xxx', notifyHook: '', state: 'desc-001' })
}).then(r => r.json()).then(console.log)

Python (requests)

python
import requests

payload = { 'base64': 'data:image/png;base64,xxx', 'notifyHook': '', 'state': 'desc-001' }
resp = requests.post('https://api.gpt.ge/mj/submit/describe', headers={'Content-Type':'application/json','Authorization':'Bearer sk-xxxx'}, json=payload)
print(resp.json())

返回示例(200)

json
{
  "code": 1,
  "description": "Submit success",
  "result": "1725017982366993",
  "properties": {
    "discordChannelId": "1278921806769815617",
    "discordInstanceId": "1550471212151513088"
  }
}