feat(merge): 以官方 main 为基底融合 PR#530 多维表格与本地定制

- 多维表格(canvas-batch-table-node/use-canvas-batch-table/canvas-batch-table 等)以 PR#530 实现为主
- 保留官方 main 全部新功能:banner/画布版本历史/提示词编辑/方舟 Agent Plan/支付导出
- 移植本地定制:ddcat 多参考图校验、万有引力 lxmone 连接错误提示、Description v20(v24)、自建插件(a6api/metaso-h3/antigravity-proxy/lxmone)、seccomp、Windows 脚本
- 迁移版本升至 v24(官方 v20-23 banner/版本历史 + 我们的 Description 列)
- 修复官方缺失的 markdownPlainText import
This commit is contained in:
Codex committed 2026-09-18 14:09:50 +08:00
1 parent d354829e51
commit 8c9e0adb4c
63 files changed
+9087 -892

No files matched your search

Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
# A6api
A6api 模型网关协议插件。统一入口 `https://api.a6api.com`,OpenAI 兼容(`Authorization: Bearer <api_key>`)。
## Providers
| Provider | 能力 | 端点 |
|---|---|---|
| a6api-chat | text | POST /chat/completions |
| a6api-image | image | POST /images/generations、POST /images/edits |
## 配置
在渠道中填写 API Key(A6api 控制台创建,形如 `sk-xxxxxxxx`),baseUrl 使用 `https://api.a6api.com`。
## 说明
- 模型名以 A6api 模型市场当前列表为准。
- 图像编辑(带参考图)走 `/images/edits` multipart 请求。
- 错误体为 OpenAI 风格,携带 `request_id`。
+522
View File
@@ -0,0 +1,522 @@
# A6api 接口说明
## 鉴权
`Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx`
## 文本对话
POST `https://api.a6api.com/chat/completions`
请求体 OpenAI Chat Completions 格式:`model`、`messages`、`temperature`、`max_tokens`、`tools`、`tool_choice`、`response_format`、`stream` 等。
响应 `choices[0].message.content` 为正文,`choices[0].message.reasoning_content` 为推理内容,`usage` 为用量。
## 图像生成
POST `https://api.a6api.com/images/generations`
请求体:`model`、`prompt`、`n`、`size`、`quality`、`response_format`。
响应 `data[].url` 或 `data[].b64_json`。
## 图像编辑
POST `https://api.a6api.com/images/edits`(multipart,带参考图时使用)
## 模型列表
GET `https://api.a6api.com/models`
<!-- YINGCE_MANIFEST_CONTRACT_START -->
## Manifest 完整接口定义
以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。
```json
{
"apiVersion": "yingce.plugin/v2",
"id": "a6api",
"name": "A6api",
"version": "1.0.0",
"author": "A6api",
"description": "A6api 模型网关协议插件:OpenAI 兼容对话与图像生成。",
"permissions": [
"generation.run",
"media.read"
],
"configuration": {
"fields": [
{
"name": "apiKey",
"type": "secret",
"label": "API Key",
"required": true
}
]
},
"contributes": {
"providers": [
{
"id": "a6api-chat",
"label": "A6api Chat",
"capabilities": [
"text"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "https://api.a6api.com",
"auth": {
"type": "bearer",
"field": "apiKey"
},
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"mapping": "model",
"description": "A6api 模型市场中的模型 ID。"
},
{
"name": "messages",
"type": "message[]",
"required": true,
"mapping": "provider message container",
"description": "包含历史消息和当前用户输入。"
},
{
"name": "instructions",
"type": "string",
"required": false,
"mapping": "system/instructions",
"description": "系统指令。"
},
{
"name": "temperature",
"type": "number",
"required": false,
"mapping": "temperature",
"description": "采样温度。"
},
{
"name": "top_p",
"type": "number",
"required": false,
"mapping": "top_p",
"description": "核采样参数。"
},
{
"name": "max_tokens",
"type": "integer",
"required": false,
"mapping": "max_tokens/max_output_tokens",
"description": "最大输出 token。"
},
{
"name": "tools",
"type": "array",
"required": false,
"mapping": "tools/toolConfig",
"description": "工具定义。"
},
{
"name": "tool_choice",
"type": "object|string",
"required": false,
"mapping": "tool_choice",
"description": "工具选择策略。"
},
{
"name": "response_format",
"type": "object",
"required": false,
"mapping": "response_format/text",
"description": "结构化输出配置。"
},
{
"name": "stream",
"type": "boolean",
"required": false,
"mapping": "stream",
"description": "流式开关;后台任务当前以最终响应归一。"
},
{
"name": "providerOptions",
"type": "object",
"required": false,
"mapping": "provider-specific fields",
"description": "插件命名空间内的厂商扩展字段。"
}
],
"create": {
"method": "POST",
"path": "/chat/completions",
"contentType": "application/json",
"body": {
"model": {
"$ref": "request.model"
},
"messages": {
"$ref": "request.messages"
},
"temperature": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.temperature"
}
},
"top_p": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.top_p"
}
},
"max_tokens": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.extra.max_tokens"
},
{
"$ref": "request.providerOptions.a6api-chat.max_tokens"
}
]
}
},
"tools": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.tools"
}
},
"tool_choice": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.tool_choice"
}
},
"response_format": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.response_format"
}
},
"stream": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.stream"
}
},
"stop": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.stop"
}
},
"seed": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.seed"
}
},
"frequency_penalty": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.frequency_penalty"
}
},
"presence_penalty": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.presence_penalty"
}
},
"user": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.user"
}
}
}
},
"response": {
"status": "succeeded",
"textPaths": [
"choices.0.message.content",
"choices.0.text"
],
"reasoningPaths": [
"choices.0.message.reasoning_content"
],
"usage": {
"$ref": "response.usage"
},
"errorPaths": [
"error.code"
],
"messagePaths": [
"error.message"
]
}
},
{
"id": "a6api-image",
"label": "A6api Image",
"capabilities": [
"image"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "https://api.a6api.com",
"auth": {
"type": "bearer",
"field": "apiKey"
},
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"mapping": "model",
"description": "A6api 模型市场中的图像模型 ID。"
},
{
"name": "prompt",
"type": "string",
"required": true,
"mapping": "prompt",
"description": "图片提示词。"
},
{
"name": "images",
"type": "media[]",
"required": false,
"mapping": "provider image/reference fields",
"description": "参考图或编辑源图,role 由业务层确定。"
},
{
"name": "imageCount",
"type": "integer",
"required": false,
"mapping": "n/sample_count",
"description": "输出数量。"
},
{
"name": "aspectRatio",
"type": "string",
"required": false,
"mapping": "size/aspect_ratio",
"description": "比例或尺寸,语义按协议说明。"
},
{
"name": "resolution",
"type": "string",
"required": false,
"mapping": "resolution/imageSize",
"description": "分辨率档位。"
},
{
"name": "quality",
"type": "string",
"required": false,
"mapping": "quality",
"description": "质量档位。"
},
{
"name": "providerOptions",
"type": "object",
"required": false,
"mapping": "provider-specific fields",
"description": "插件命名空间内的厂商扩展字段。"
}
],
"create": {
"method": "POST",
"path": "/images/generations",
"pathTemplate": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": "/images/edits",
"else": "/images/generations"
}
},
"contentType": "application/json",
"contentTypeTemplate": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": "multipart/form-data",
"else": "application/json"
}
},
"body": {
"model": {
"$ref": "request.model"
},
"prompt": {
"$ref": "request.prompt"
},
"n": {
"$omitEmpty": {
"$if": {
"condition": {
"$gt": [
{
"$ref": "request.imageCount"
},
0
]
},
"then": {
"$ref": "request.imageCount"
},
"else": 1
}
}
},
"size": {
"$omitEmpty": {
"$ref": "request.aspectRatio"
}
},
"quality": {
"$omitEmpty": {
"$ref": "request.quality"
}
},
"output_format": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.providerOptions.a6api-image.output_format"
},
"png"
]
}
},
"response_format": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.providerOptions.a6api-image.response_format"
},
"b64_json"
]
}
},
"user": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-image.user"
}
}
},
"files": [
{
"name": "image",
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$ne": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "source.png"
},
{
"name": "mask",
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "mask.png"
}
]
},
"response": {
"status": "succeeded",
"images": {
"$map": {
"from": {
"$ref": "response.data"
},
"as": "item",
"in": {
"url": {
"$omitEmpty": {
"$ref": "item.url"
}
},
"dataUrl": {
"$if": {
"condition": {
"$ref": "item.b64_json"
},
"then": {
"$concat": [
"data:image/png;base64,",
{
"$ref": "item.b64_json"
}
]
},
"else": null
}
}
}
}
},
"usage": {
"$ref": "response.usage"
},
"errorPaths": [
"error.code"
],
"messagePaths": [
"error.message"
]
}
}
]
},
"documentation": "<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>"
}
```
<!-- YINGCE_MANIFEST_CONTRACT_END -->
+484
View File
@@ -0,0 +1,484 @@
{
"apiVersion": "yingce.plugin/v2",
"id": "a6api",
"name": "A6api",
"version": "1.0.0",
"author": "A6api",
"description": "A6api 模型网关协议插件:OpenAI 兼容对话与图像生成。",
"permissions": [
"generation.run",
"media.read"
],
"configuration": {
"fields": [
{
"name": "apiKey",
"type": "secret",
"label": "API Key",
"required": true
}
]
},
"contributes": {
"providers": [
{
"id": "a6api-chat",
"label": "A6api Chat",
"capabilities": [
"text"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "https://api.a6api.com",
"auth": {
"type": "bearer",
"field": "apiKey"
},
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"mapping": "model",
"description": "A6api 模型市场中的模型 ID。"
},
{
"name": "messages",
"type": "message[]",
"required": true,
"mapping": "provider message container",
"description": "包含历史消息和当前用户输入。"
},
{
"name": "instructions",
"type": "string",
"required": false,
"mapping": "system/instructions",
"description": "系统指令。"
},
{
"name": "temperature",
"type": "number",
"required": false,
"mapping": "temperature",
"description": "采样温度。"
},
{
"name": "top_p",
"type": "number",
"required": false,
"mapping": "top_p",
"description": "核采样参数。"
},
{
"name": "max_tokens",
"type": "integer",
"required": false,
"mapping": "max_tokens/max_output_tokens",
"description": "最大输出 token。"
},
{
"name": "tools",
"type": "array",
"required": false,
"mapping": "tools/toolConfig",
"description": "工具定义。"
},
{
"name": "tool_choice",
"type": "object|string",
"required": false,
"mapping": "tool_choice",
"description": "工具选择策略。"
},
{
"name": "response_format",
"type": "object",
"required": false,
"mapping": "response_format/text",
"description": "结构化输出配置。"
},
{
"name": "stream",
"type": "boolean",
"required": false,
"mapping": "stream",
"description": "流式开关;后台任务当前以最终响应归一。"
},
{
"name": "providerOptions",
"type": "object",
"required": false,
"mapping": "provider-specific fields",
"description": "插件命名空间内的厂商扩展字段。"
}
],
"create": {
"method": "POST",
"path": "/chat/completions",
"contentType": "application/json",
"body": {
"model": {
"$ref": "request.model"
},
"messages": {
"$ref": "request.messages"
},
"temperature": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.temperature"
}
},
"top_p": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.top_p"
}
},
"max_tokens": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.extra.max_tokens"
},
{
"$ref": "request.providerOptions.a6api-chat.max_tokens"
}
]
}
},
"tools": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.tools"
}
},
"tool_choice": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.tool_choice"
}
},
"response_format": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.response_format"
}
},
"stream": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.stream"
}
},
"stop": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.stop"
}
},
"seed": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.seed"
}
},
"frequency_penalty": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.frequency_penalty"
}
},
"presence_penalty": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.presence_penalty"
}
},
"user": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-chat.user"
}
}
}
},
"response": {
"status": "succeeded",
"textPaths": [
"choices.0.message.content",
"choices.0.text"
],
"reasoningPaths": [
"choices.0.message.reasoning_content"
],
"usage": {
"$ref": "response.usage"
},
"errorPaths": [
"error.code"
],
"messagePaths": [
"error.message"
]
}
},
{
"id": "a6api-image",
"label": "A6api Image",
"capabilities": [
"image"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "https://api.a6api.com",
"auth": {
"type": "bearer",
"field": "apiKey"
},
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"mapping": "model",
"description": "A6api 模型市场中的图像模型 ID。"
},
{
"name": "prompt",
"type": "string",
"required": true,
"mapping": "prompt",
"description": "图片提示词。"
},
{
"name": "images",
"type": "media[]",
"required": false,
"mapping": "provider image/reference fields",
"description": "参考图或编辑源图,role 由业务层确定。"
},
{
"name": "imageCount",
"type": "integer",
"required": false,
"mapping": "n/sample_count",
"description": "输出数量。"
},
{
"name": "aspectRatio",
"type": "string",
"required": false,
"mapping": "size/aspect_ratio",
"description": "比例或尺寸,语义按协议说明。"
},
{
"name": "resolution",
"type": "string",
"required": false,
"mapping": "resolution/imageSize",
"description": "分辨率档位。"
},
{
"name": "quality",
"type": "string",
"required": false,
"mapping": "quality",
"description": "质量档位。"
},
{
"name": "providerOptions",
"type": "object",
"required": false,
"mapping": "provider-specific fields",
"description": "插件命名空间内的厂商扩展字段。"
}
],
"create": {
"method": "POST",
"path": "/images/generations",
"pathTemplate": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": "/images/edits",
"else": "/images/generations"
}
},
"contentType": "application/json",
"contentTypeTemplate": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": "multipart/form-data",
"else": "application/json"
}
},
"body": {
"model": {
"$ref": "request.model"
},
"prompt": {
"$ref": "request.prompt"
},
"n": {
"$omitEmpty": {
"$if": {
"condition": {
"$gt": [
{
"$ref": "request.imageCount"
},
0
]
},
"then": {
"$ref": "request.imageCount"
},
"else": 1
}
}
},
"size": {
"$omitEmpty": {
"$ref": "request.aspectRatio"
}
},
"quality": {
"$omitEmpty": {
"$ref": "request.quality"
}
},
"output_format": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.providerOptions.a6api-image.output_format"
},
"png"
]
}
},
"response_format": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.providerOptions.a6api-image.response_format"
},
"b64_json"
]
}
},
"user": {
"$omitEmpty": {
"$ref": "request.providerOptions.a6api-image.user"
}
}
},
"files": [
{
"name": "image",
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$ne": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "source.png"
},
{
"name": "mask",
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "mask.png"
}
]
},
"response": {
"status": "succeeded",
"images": {
"$map": {
"from": {
"$ref": "response.data"
},
"as": "item",
"in": {
"url": {
"$omitEmpty": {
"$ref": "item.url"
}
},
"dataUrl": {
"$if": {
"condition": {
"$ref": "item.b64_json"
},
"then": {
"$concat": [
"data:image/png;base64,",
{
"$ref": "item.b64_json"
}
]
},
"else": null
}
}
}
}
},
"usage": {
"$ref": "response.usage"
},
"errorPaths": [
"error.code"
],
"messagePaths": [
"error.message"
]
}
}
]
},
"documentation": "# A6api\n\nA6api 模型网关协议插件。统一入口 `https://api.a6api.com`,OpenAI 兼容(`Authorization: Bearer <api_key>`)。\n\n## Providers\n\n| Provider | 能力 | 端点 |\n|---|---|---|\n| a6api-chat | text | POST /chat/completions |\n| a6api-image | image | POST /images/generations、POST /images/edits |\n\n## 配置\n\n在渠道中填写 API Key(A6api 控制台创建,形如 `sk-xxxxxxxx`),baseUrl 使用 `https://api.a6api.com`。\n\n## 说明\n\n- 模型名以 A6api 模型市场当前列表为准。\n- 图像编辑(带参考图)走 `/images/edits` multipart 请求。\n- 错误体为 OpenAI 风格,携带 `request_id`。\n\n---\n\n# A6api 接口说明\n\n## 鉴权\n\n`Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx`\n\n## 文本对话\n\nPOST `https://api.a6api.com/chat/completions`\n\n请求体 OpenAI Chat Completions 格式:`model`、`messages`、`temperature`、`max_tokens`、`tools`、`tool_choice`、`response_format`、`stream` 等。\n\n响应 `choices[0].message.content` 为正文,`choices[0].message.reasoning_content` 为推理内容,`usage` 为用量。\n\n## 图像生成\n\nPOST `https://api.a6api.com/images/generations`\n\n请求体:`model`、`prompt`、`n`、`size`、`quality`、`response_format`。\n\n响应 `data[].url` 或 `data[].b64_json`。\n\n## 图像编辑\n\nPOST `https://api.a6api.com/images/edits`(multipart,带参考图时使用)\n\n## 模型列表\n\nGET `https://api.a6api.com/models`\n\n<!-- YINGCE_MANIFEST_CONTRACT_START -->\n## Manifest 完整接口定义\n\n以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。\n\n```json\n{\n \"apiVersion\": \"yingce.plugin/v2\",\n \"id\": \"a6api\",\n \"name\": \"A6api\",\n \"version\": \"1.0.0\",\n \"author\": \"A6api\",\n \"description\": \"A6api 模型网关协议插件:OpenAI 兼容对话与图像生成。\",\n \"permissions\": [\n \"generation.run\",\n \"media.read\"\n ],\n \"configuration\": {\n \"fields\": [\n {\n \"name\": \"apiKey\",\n \"type\": \"secret\",\n \"label\": \"API Key\",\n \"required\": true\n }\n ]\n },\n \"contributes\": {\n \"providers\": [\n {\n \"id\": \"a6api-chat\",\n \"label\": \"A6api Chat\",\n \"capabilities\": [\n \"text\"\n ],\n \"scopes\": [\n \"admin.system-channel\",\n \"user.custom-channel\",\n \"canvas\",\n \"creation\",\n \"agent\"\n ],\n \"baseUrl\": \"https://api.a6api.com\",\n \"auth\": {\n \"type\": \"bearer\",\n \"field\": \"apiKey\"\n },\n \"parameters\": [\n {\n \"name\": \"model\",\n \"type\": \"string\",\n \"required\": true,\n \"mapping\": \"model\",\n \"description\": \"A6api 模型市场中的模型 ID。\"\n },\n {\n \"name\": \"messages\",\n \"type\": \"message[]\",\n \"required\": true,\n \"mapping\": \"provider message container\",\n \"description\": \"包含历史消息和当前用户输入。\"\n },\n {\n \"name\": \"instructions\",\n \"type\": \"string\",\n \"required\": false,\n \"mapping\": \"system/instructions\",\n \"description\": \"系统指令。\"\n },\n {\n \"name\": \"temperature\",\n \"type\": \"number\",\n \"required\": false,\n \"mapping\": \"temperature\",\n \"description\": \"采样温度。\"\n },\n {\n \"name\": \"top_p\",\n \"type\": \"number\",\n \"required\": false,\n \"mapping\": \"top_p\",\n \"description\": \"核采样参数。\"\n },\n {\n \"name\": \"max_tokens\",\n \"type\": \"integer\",\n \"required\": false,\n \"mapping\": \"max_tokens/max_output_tokens\",\n \"description\": \"最大输出 token。\"\n },\n {\n \"name\": \"tools\",\n \"type\": \"array\",\n \"required\": false,\n \"mapping\": \"tools/toolConfig\",\n \"description\": \"工具定义。\"\n },\n {\n \"name\": \"tool_choice\",\n \"type\": \"object|string\",\n \"required\": false,\n \"mapping\": \"tool_choice\",\n \"description\": \"工具选择策略。\"\n },\n {\n \"name\": \"response_format\",\n \"type\": \"objecLine truncated
}
Binary file not shown.
@@ -0,0 +1,41 @@
# Antigravity Proxy
Antigravity 中转渠道插件:OpenAI Chat Completions 兼容对话协议。
## 协议身份
- 插件 ID:`antigravity-proxy`
- Provider ID:`antigravity-chat`
- 能力:`text`
- 默认 Base URL:`http://103.242.14.110:8317`
- 鉴权驱动:`bearer`
- 创建:`POST /chat/completions`
- 生命周期:同步响应
## 配置字段
| 字段 | 类型 | 必填 | 含义 |
| --- | --- | --- | --- |
| `apiKey` | secret | 是 | 中转渠道 API Key |
## 模型
- `gemini-3.8-flash-high`
- `gemini-pro-agent`
## 统一字段映射
| 统一字段 | 类型 | 必填 | 上游映射 |
| --- | --- | --- | --- |
| `model` | string | 是 | `model` |
| `messages` | message[] | 是 | `messages` |
| `instructions` | string | 否 | `system/instructions` |
| `temperature` | number | 否 | `temperature` |
| `top_p` | number | 否 | `top_p` |
| `max_tokens` | integer | 否 | `max_tokens` |
| `tools` | array | 否 | `tools` |
| `tool_choice` | object\|string | 否 | `tool_choice` |
| `response_format` | object | 否 | `response_format` |
| `stream` | boolean | 否 | `stream` |
完整接口见 [docs/interface.md](docs/interface.md)。
@@ -0,0 +1,303 @@
# Antigravity Proxy 接口字段
## 协议身份
- 插件 ID:`antigravity-proxy`
- Provider ID:`antigravity-chat`
- 能力:`text`
- 默认 Base URL:`http://103.242.14.110:8317`
- 鉴权驱动:`bearer`
- 创建:`POST /chat/completions`
- 生命周期:同步响应
## 配置字段
| 字段 | 类型 | 必填 | 含义 |
| --- | --- | --- | --- |
| `apiKey` | secret | 是 | 中转渠道 API Key |
## 统一字段映射
| 统一字段 | 类型 | 必填 | 上游映射 | 说明 |
| --- | --- | --- | --- | --- |
| `model` | string | 是 | `model` | 上游模型 ID。 |
| `messages` | message[] | 是 | `messages` | 包含历史消息和当前用户输入。 |
| `instructions` | string | 否 | `system/instructions` | 系统指令。 |
| `temperature` | number | 否 | `temperature` | 采样温度。 |
| `top_p` | number | 否 | `top_p` | 核采样参数。 |
| `max_tokens` | integer | 否 | `max_tokens/max_output_tokens` | 最大输出 token。 |
| `tools` | array | 否 | `tools/toolConfig` | 工具定义。 |
| `tool_choice` | object\|string | 否 | `tool_choice` | 工具选择策略。 |
| `response_format` | object | 否 | `response_format/text` | 结构化输出配置。 |
| `stream` | boolean | 否 | `stream` | 流式开关。 |
## 上游请求模板
| 上游位置 | 值或转换表达式 |
| --- | --- |
| `create.method` | `"POST"` |
| `create.path` | `"/chat/completions"` |
| `create.contentType` | `"application/json"` |
| `create.body.model` | `{"$ref":"request.model"}` |
| `create.body.messages` | `{"$ref":"request.messages"}` |
| `create.body.temperature` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.temperature"}}` |
| `create.body.top_p` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.top_p"}}` |
| `create.body.max_tokens` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.extra.max_tokens"},{"$ref":"request.providerOptions.antigravity-chat.max_tokens"}]}}` |
| `create.body.tools` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.tools"}}` |
| `create.body.tool_choice` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.tool_choice"}}` |
| `create.body.response_format` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.response_format"}}` |
| `create.body.stream` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.stream"}}` |
| `create.body.stop` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.stop"}}` |
| `create.body.seed` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.seed"}}` |
| `create.body.frequency_penalty` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.frequency_penalty"}}` |
| `create.body.presence_penalty` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.presence_penalty"}}` |
| `create.body.user` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.user"}}` |
## 响应映射
| 映射位置 | 上游路径或转换表达式 |
| --- | --- |
| `response.status` | `"succeeded"` |
| `response.textPaths[0]` | `"choices.0.message.content"` |
| `response.textPaths[1]` | `"choices.0.text"` |
| `response.reasoningPaths[0]` | `"choices.0.message.reasoning_content"` |
| `response.usage` | `{"$ref":"response.usage"}` |
| `response.errorPaths[0]` | `"error.code"` |
| `response.messagePaths[0]` | `"error.message"` |
## 兼容边界
该包只代表 Antigravity 中转渠道的 OpenAI Chat Completions 线协议;其他端点或网关包装必须使用独立插件。
<!-- YINGCE_MANIFEST_CONTRACT_START -->
## Manifest 完整接口定义
以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。
```json
{
"apiVersion": "yingce.plugin/v2",
"id": "antigravity-proxy",
"name": "Antigravity Proxy",
"version": "1.0.0",
"author": "Yingce",
"description": "Antigravity 中转渠道插件:OpenAI 兼容对话(gemini-3.8-flash-high / gemini-pro-agent)。",
"permissions": [
"generation.run",
"media.read"
],
"configuration": {
"fields": [
{
"name": "apiKey",
"type": "secret",
"label": "API Key",
"required": true
}
]
},
"contributes": {
"providers": [
{
"id": "antigravity-chat",
"label": "Antigravity Chat",
"capabilities": [
"text"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "http://103.242.14.110:8317",
"auth": {
"type": "bearer",
"field": "apiKey"
},
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"mapping": "model",
"description": "模型 ID(gemini-3.8-flash-high / gemini-pro-agent)。"
},
{
"name": "messages",
"type": "message[]",
"required": true,
"mapping": "provider message container",
"description": "包含历史消息和当前用户输入。"
},
{
"name": "instructions",
"type": "string",
"required": false,
"mapping": "system/instructions",
"description": "系统指令。"
},
{
"name": "temperature",
"type": "number",
"required": false,
"mapping": "temperature",
"description": "采样温度。"
},
{
"name": "top_p",
"type": "number",
"required": false,
"mapping": "top_p",
"description": "核采样参数。"
},
{
"name": "max_tokens",
"type": "integer",
"required": false,
"mapping": "max_tokens/max_output_tokens",
"description": "最大输出 token。"
},
{
"name": "tools",
"type": "array",
"required": false,
"mapping": "tools/toolConfig",
"description": "工具定义。"
},
{
"name": "tool_choice",
"type": "object|string",
"required": false,
"mapping": "tool_choice",
"description": "工具选择策略。"
},
{
"name": "response_format",
"type": "object",
"required": false,
"mapping": "response_format/text",
"description": "结构化输出配置。"
},
{
"name": "stream",
"type": "boolean",
"required": false,
"mapping": "stream",
"description": "流式开关;后台任务当前以最终响应归一。"
},
{
"name": "providerOptions",
"type": "object",
"required": false,
"mapping": "provider-specific fields",
"description": "插件命名空间内的厂商扩展字段。"
}
],
"create": {
"method": "POST",
"path": "/chat/completions",
"contentType": "application/json",
"body": {
"model": {
"$ref": "request.model"
},
"messages": {
"$ref": "request.messages"
},
"temperature": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.temperature"
}
},
"top_p": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.top_p"
}
},
"max_tokens": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.extra.max_tokens"
},
{
"$ref": "request.providerOptions.antigravity-chat.max_tokens"
}
]
}
},
"tools": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.tools"
}
},
"tool_choice": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.tool_choice"
}
},
"response_format": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.response_format"
}
},
"stream": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.stream"
}
},
"stop": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.stop"
}
},
"seed": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.seed"
}
},
"frequency_penalty": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.frequency_penalty"
}
},
"presence_penalty": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.presence_penalty"
}
},
"user": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.user"
}
}
}
},
"response": {
"status": "succeeded",
"textPaths": [
"choices.0.message.content",
"choices.0.text"
],
"reasoningPaths": [
"choices.0.message.reasoning_content"
],
"usage": {
"$ref": "response.usage"
},
"errorPaths": [
"error.code"
],
"messagePaths": [
"error.message"
]
}
}
]
},
"documentation": "<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>"
}
```
<!-- YINGCE_MANIFEST_CONTRACT_END -->
@@ -0,0 +1,224 @@
{
"apiVersion": "yingce.plugin/v2",
"id": "antigravity-proxy",
"name": "Antigravity Proxy",
"version": "1.0.0",
"author": "Yingce",
"description": "Antigravity 中转渠道插件:OpenAI 兼容对话(gemini-3.8-flash-high / gemini-pro-agent)。",
"permissions": [
"generation.run",
"media.read"
],
"configuration": {
"fields": [
{
"name": "apiKey",
"type": "secret",
"label": "API Key",
"required": true
}
]
},
"contributes": {
"providers": [
{
"id": "antigravity-chat",
"label": "Antigravity Chat",
"capabilities": [
"text"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "http://103.242.14.110:8317",
"auth": {
"type": "bearer",
"field": "apiKey"
},
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"mapping": "model",
"description": "模型 ID(gemini-3.8-flash-high / gemini-pro-agent)。"
},
{
"name": "messages",
"type": "message[]",
"required": true,
"mapping": "provider message container",
"description": "包含历史消息和当前用户输入。"
},
{
"name": "instructions",
"type": "string",
"required": false,
"mapping": "system/instructions",
"description": "系统指令。"
},
{
"name": "temperature",
"type": "number",
"required": false,
"mapping": "temperature",
"description": "采样温度。"
},
{
"name": "top_p",
"type": "number",
"required": false,
"mapping": "top_p",
"description": "核采样参数。"
},
{
"name": "max_tokens",
"type": "integer",
"required": false,
"mapping": "max_tokens/max_output_tokens",
"description": "最大输出 token。"
},
{
"name": "tools",
"type": "array",
"required": false,
"mapping": "tools/toolConfig",
"description": "工具定义。"
},
{
"name": "tool_choice",
"type": "object|string",
"required": false,
"mapping": "tool_choice",
"description": "工具选择策略。"
},
{
"name": "response_format",
"type": "object",
"required": false,
"mapping": "response_format/text",
"description": "结构化输出配置。"
},
{
"name": "stream",
"type": "boolean",
"required": false,
"mapping": "stream",
"description": "流式开关;后台任务当前以最终响应归一。"
},
{
"name": "providerOptions",
"type": "object",
"required": false,
"mapping": "provider-specific fields",
"description": "插件命名空间内的厂商扩展字段。"
}
],
"create": {
"method": "POST",
"path": "/chat/completions",
"contentType": "application/json",
"body": {
"model": {
"$ref": "request.model"
},
"messages": {
"$ref": "request.messages"
},
"temperature": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.temperature"
}
},
"top_p": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.top_p"
}
},
"max_tokens": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.extra.max_tokens"
},
{
"$ref": "request.providerOptions.antigravity-chat.max_tokens"
}
]
}
},
"tools": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.tools"
}
},
"tool_choice": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.tool_choice"
}
},
"response_format": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.response_format"
}
},
"stream": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.stream"
}
},
"stop": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.stop"
}
},
"seed": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.seed"
}
},
"frequency_penalty": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.frequency_penalty"
}
},
"presence_penalty": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.presence_penalty"
}
},
"user": {
"$omitEmpty": {
"$ref": "request.providerOptions.antigravity-chat.user"
}
}
}
},
"response": {
"status": "succeeded",
"textPaths": [
"choices.0.message.content",
"choices.0.text"
],
"reasoningPaths": [
"choices.0.message.reasoning_content"
],
"usage": {
"$ref": "response.usage"
},
"errorPaths": [
"error.code"
],
"messagePaths": [
"error.message"
]
}
}
]
},
"documentation": "# Antigravity Proxy\n\nAntigravity 中转渠道插件:OpenAI Chat Completions 兼容对话协议。\n\n## 协议身份\n\n- 插件 ID:`antigravity-proxy`\n- Provider ID:`antigravity-chat`\n- 能力:`text`\n- 默认 Base URL:`http://103.242.14.110:8317`\n- 鉴权驱动:`bearer`\n- 创建:`POST /chat/completions`\n- 生命周期:同步响应\n\n## 配置字段\n\n| 字段 | 类型 | 必填 | 含义 |\n| --- | --- | --- | --- |\n| `apiKey` | secret | 是 | 中转渠道 API Key |\n\n## 模型\n\n- `gemini-3.8-flash-high`\n- `gemini-pro-agent`\n\n## 统一字段映射\n\n| 统一字段 | 类型 | 必填 | 上游映射 |\n| --- | --- | --- | --- |\n| `model` | string | 是 | `model` |\n| `messages` | message[] | 是 | `messages` |\n| `instructions` | string | 否 | `system/instructions` |\n| `temperature` | number | 否 | `temperature` |\n| `top_p` | number | 否 | `top_p` |\n| `max_tokens` | integer | 否 | `max_tokens` |\n| `tools` | array | 否 | `tools` |\n| `tool_choice` | object\\|string | 否 | `tool_choice` |\n| `response_format` | object | 否 | `response_format` |\n| `stream` | boolean | 否 | `stream` |\n\n完整接口见 [docs/interface.md](docs/interface.md)。\n\n---\n\n# Antigravity Proxy 接口字段\n\n## 协议身份\n\n- 插件 ID:`antigravity-proxy`\n- Provider ID:`antigravity-chat`\n- 能力:`text`\n- 默认 Base URL:`http://103.242.14.110:8317`\n- 鉴权驱动:`bearer`\n- 创建:`POST /chat/completions`\n- 生命周期:同步响应\n\n## 配置字段\n\n| 字段 | 类型 | 必填 | 含义 |\n| --- | --- | --- | --- |\n| `apiKey` | secret | 是 | 中转渠道 API Key |\n\n## 统一字段映射\n\n| 统一字段 | 类型 | 必填 | 上游映射 | 说明 |\n| --- | --- | --- | --- | --- |\n| `model` | string | 是 | `model` | 上游模型 ID。 |\n| `messages` | message[] | 是 | `messages` | 包含历史消息和当前用户输入。 |\n| `instructions` | string | 否 | `system/instructions` | 系统指令。 |\n| `temperature` | number | 否 | `temperature` | 采样温度。 |\n| `top_p` | number | 否 | `top_p` | 核采样参数。 |\n| `max_tokens` | integer | 否 | `max_tokens/max_output_tokens` | 最大输出 token。 |\n| `tools` | array | 否 | `tools/toolConfig` | 工具定义。 |\n| `tool_choice` | object\\|string | 否 | `tool_choice` | 工具选择策略。 |\n| `response_format` | object | 否 | `response_format/text` | 结构化输出配置。 |\n| `stream` | boolean | 否 | `stream` | 流式开关。 |\n\n## 上游请求模板\n\n| 上游位置 | 值或转换表达式 |\n| --- | --- |\n| `create.method` | `\"POST\"` |\n| `create.path` | `\"/chat/completions\"` |\n| `create.contentType` | `\"application/json\"` |\n| `create.body.model` | `{\"$ref\":\"request.model\"}` |\n| `create.body.messages` | `{\"$ref\":\"request.messages\"}` |\n| `create.body.temperature` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.temperature\"}}` |\n| `create.body.top_p` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.top_p\"}}` |\n| `create.body.max_tokens` | `{\"$omitEmpty\":{\"$coalesce\":[{\"$ref\":\"request.extra.max_tokens\"},{\"$ref\":\"request.providerOptions.antigravity-chat.max_tokens\"}]}}` |\n| `create.body.tools` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.tools\"}}` |\n| `create.body.tool_choice` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.tool_choice\"}}` |\n| `create.body.response_format` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.response_format\"}}` |\n| `create.body.stream` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.stream\"}}` |\n| `create.body.stop` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.stop\"}}` |\n| `create.body.seed` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.seed\"}}` |\n| `create.body.frequency_penalty` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.frequency_penalty\"}}` |\n| `create.body.presence_penalty` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.presence_penalty\"}}` |\n| `create.body.user` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.antigravity-chat.user\"}}` |\n\n## 响应映射\n\n| 映射位置 | 上游路径或转换表达式 |\n| --- | --- |\n| `response.status` | `\"succeeded\"` |\n| `response.textPaths[0]` | `\"choices.0.message.content\"` |\n| `response.textPaths[1]` | `\"choices.0.text\"` |\n| `response.reasoningPaths[0]` | `\"choices.0.message.reasoning_content\"` |\n| `response.usage` | `{\"$ref\":\"response.usage\"}` |\n| `response.errorPaths[0]` | `\"error.code\"` |\n| `response.messagePaths[0]` | `\"error.message\"` |\n\n## 兼容边界\n\n该包只代表 Antigravity 中转渠道的 OpenAI Chat Completions 线协议;其他端点或网关包装必须使用独立插件。\n\n<!-- YINGCE_MANIFEST_CONTRACT_START -->\n## ManiLine truncated
}
Binary file not shown.
@@ -0,0 +1,27 @@
# 万有引力视频套件(lxmone.xyz)
该目录是万有引力中转站(`https://lxmone.xyz/v1`)视频协议的官方声明式插件源码。
后端从生成的 `lxmone-video-suite.yingce-plugin` 包加载,不依赖系统内置 `host:` 适配器。
协议按中转站公开接口文档 `https://lxmone.xyz/docs/` 的 `/v1/videos` 与 `/v1/videos/generations`
两套请求体形状编写,拆成 8 个 provider,覆盖该站点当前开放的全部视频模型:
| Provider ID | 覆盖模型 | 创建接口 |
| --- | --- | --- |
| `lxmone-wan-videos` | `wan3.0-video`、`wan3.0-video-prime` | `POST /v1/videos` |
| `lxmone-wan-channel-s` | `wan3.0-video-s`、`wan3.0-video-prime-s` | `POST /v1/videos` |
| `lxmone-seedance-videos` | `seedance-2-pro/fast/mini`、`seedance-2.5-pro`、`seedance2.0-a`~`seedance2.0-f`、`seedance2.5-a` | `POST /v1/videos` |
| `lxmone-h3-max-videos` | `minimax-h3-max` | `POST /v1/videos` |
| `lxmone-sd-videos` | `sd-2.0-a`、`sd-2.0-b`、`sd-2.0-c`、`sd-2.5-a`、`sd-2.5` | `POST /v1/videos` |
| `lxmone-sd-mini-videos` | `sd-mini` | `POST /v1/videos` |
| `lxmone-grok-videos` | `grok-imagine-video`、`grok-imagine-video-1.5`、`grok-imagine-video-1.5S` | `POST /v1/videos/generations` |
| `lxmone-h3-workflow` | `minimax-h3-a`~`minimax-h3-e` | `POST /v1/videos/generations` |
完整字段、请求模板与响应映射见 [docs/interface.md](docs/interface.md)。
## 构建
```sh
node plugin-packages/embed-documentation.mjs lxmone-video-suite
sh plugin-packages/build-packages.sh
```
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
# METASO MiniMax H3
秘塔 METASO MiniMax H3 文生视频 / 图生视频协议插件(异步任务模式)。
## Provider
| Provider | 能力 | 端点 |
|---|---|---|
| metaso-h3 | video | POST /api/minimax/v2/video_generation(创建)<br>GET /api/minimax/v2/query/video_generation/{taskId}(轮询) |
## 配置
在渠道中填写 API Key(METASO 控制台创建,形如 `mk-xxxxxxxx`),baseUrl 使用 `https://metaso.cn`。
## 说明
- 模型:`MiniMax-H3`(支持 768P / 2K,4-15 秒,文生图/图生视频/多模态参考),`MiniMax-H3-Max`(480P / 768P,5-15 秒)。
- 文生视频:仅文本提示词,ratio 必填(21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16)。
- 图生视频:图片 role 为 first_frame / last_frame(首尾帧)。
- 多模态参考:图片 reference_image / 视频 reference_video / 音频 reference_audio。
- 异步任务:创建后返回 task_id,轮询查询接口直到 status=succeeded,成片 URL 在 task.content.url。
- 鉴权:`Authorization: Bearer mk-xxx`。
+437
View File
@@ -0,0 +1,437 @@
# METASO MiniMax H3 接口说明
## 鉴权
`Authorization: Bearer mk-xxxxxxxxxxxxxxxxxxxxxxxx`
## 创建视频生成任务
POST `https://metaso.cn/api/minimax/v2/video_generation`
请求体:
```json
{
"model": "MiniMax-H3",
"content": [
{ "type": "text", "text": "视频描述" },
{ "type": "image_url", "image_url": { "url": "https://..." }, "role": "first_frame" },
{ "type": "video_url", "video_url": { "url": "https://..." }, "role": "reference_video" },
{ "type": "audio_url", "audio_url": { "url": "https://..." }, "role": "reference_audio" }
],
"resolution": "768P",
"duration": 5,
"ratio": "16:9"
}
```
- content 必须包含一个非空 text 项。
- 首尾帧(first_frame/last_frame)与多模态参考(reference_*)互斥。
- 图片 ≤ 9 张、视频 ≤ 3 段、音频 ≤ 3 段;请求体总大小 ≤ 64 MB。
响应:
```json
{ "task_id": "424010985738629" }
```
## 查询任务
GET `https://metaso.cn/api/minimax/v2/query/video_generation/{task_id}`
响应:
```json
{
"task": {
"id": "424010985738629",
"status": "succeeded",
"content": { "url": "https://.../output.mp4" },
"resolution": "2K",
"duration": 5,
"usage": { "total_seconds": 5, "output_seconds": 5 }
}
}
```
status 取值:queued / running / succeeded / failed / cancelled。
## 错误
创建与查询均返回 OpenAI 风格错误体,含 `error.type` / `error.message` / `request_id`;余额不足为 402,速率限制为 429。
<!-- YINGCE_MANIFEST_CONTRACT_START -->
## Manifest 完整接口定义
以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。
```json
{
"apiVersion": "yingce.plugin/v2",
"id": "metaso-h3",
"name": "METASO MiniMax H3",
"version": "1.0.0",
"author": "METASO",
"description": "秘塔 METASO MiniMax H3 文生视频/图生视频协议插件(异步任务)。",
"permissions": [
"generation.run",
"media.read"
],
"configuration": {
"fields": [
{
"name": "apiKey",
"type": "secret",
"label": "API Key",
"required": true
}
]
},
"contributes": {
"providers": [
{
"id": "metaso-h3",
"label": "METASO MiniMax H3",
"capabilities": [
"video"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "https://metaso.cn",
"auth": {
"type": "bearer",
"field": "apiKey"
},
"requiresPublicMediaUrls": true,
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"mapping": "model",
"description": "视频模型 ID(MiniMax-H3 / MiniMax-H3-Max)。"
},
{
"name": "prompt",
"type": "string",
"required": true,
"mapping": "prompt/content/input",
"description": "视频提示词。"
},
{
"name": "images",
"type": "media[]",
"required": false,
"mapping": "first/last/reference image",
"description": "显式 role 图片输入(首帧/尾帧/参考图)。"
},
{
"name": "videos",
"type": "media[]",
"required": false,
"mapping": "reference video",
"description": "参考视频。"
},
{
"name": "audios",
"type": "media[]",
"required": false,
"mapping": "reference audio/voice",
"description": "参考音频或音色。"
},
{
"name": "duration",
"type": "integer",
"required": false,
"mapping": "duration/seconds",
"description": "时长秒数(4-15)。"
},
{
"name": "aspectRatio",
"type": "string",
"required": false,
"mapping": "ratio/aspect_ratio/size",
"description": "画幅比例(16:9 等)。"
},
{
"name": "resolution",
"type": "string",
"required": false,
"mapping": "resolution",
"description": "分辨率档位(768P / 2K)。"
},
{
"name": "watermark",
"type": "boolean",
"required": false,
"mapping": "watermark",
"description": "AIGC 水印开关。"
},
{
"name": "providerOptions",
"type": "object",
"required": false,
"mapping": "provider-specific fields",
"description": "插件命名空间内的厂商扩展字段。"
}
],
"create": {
"method": "POST",
"path": "/api/minimax/v2/video_generation",
"contentType": "application/json",
"body": {
"model": {
"$coalesce": [
{
"$ref": "request.model"
},
"MiniMax-H3"
]
},
"content": {
"$concatArrays": [
{
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.prompt"
}
},
0
]
},
"then": [
{
"type": "text",
"text": {
"$ref": "request.prompt"
}
}
],
"else": []
}
},
{
"$map": {
"from": {
"$ref": "request.images"
},
"as": "media",
"in": {
"type": "image_url",
"image_url": {
"url": {
"$coalesce": [
{
"$ref": "media.url"
},
{
"$ref": "media.dataUrl"
}
]
}
},
"role": {
"$omitEmpty": {
"$ref": "media.role"
}
}
}
}
},
{
"$map": {
"from": {
"$ref": "request.videos"
},
"as": "media",
"in": {
"type": "video_url",
"video_url": {
"url": {
"$coalesce": [
{
"$ref": "media.url"
},
{
"$ref": "media.dataUrl"
}
]
}
},
"role": {
"$omitEmpty": {
"$ref": "media.role"
}
}
}
}
},
{
"$map": {
"from": {
"$ref": "request.audios"
},
"as": "media",
"in": {
"type": "audio_url",
"audio_url": {
"url": {
"$coalesce": [
{
"$ref": "media.url"
},
{
"$ref": "media.dataUrl"
}
]
}
},
"role": {
"$omitEmpty": {
"$ref": "media.role"
}
}
}
}
}
]
},
"resolution": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.resolution"
},
{
"$ref": "request.providerOptions.metaso-h3.resolution"
},
"768P"
]
}
},
"duration": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.duration"
},
{
"$ref": "request.providerOptions.metaso-h3.duration"
},
5
]
}
},
"ratio": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.aspectRatio"
},
{
"$ref": "request.providerOptions.metaso-h3.ratio"
},
"16:9"
]
}
},
"aigc_watermark": {
"$omitEmpty": {
"$ref": "request.providerOptions.metaso-h3.aigc_watermark"
}
}
}
},
"poll": {
"method": "GET",
"path": "/api/minimax/v2/query/video_generation/{{taskId}}"
},
"response": {
"taskId": {
"$coalesce": [
{
"$ref": "response.task_id"
},
{
"$ref": "response.taskId"
},
{
"$ref": "response.data.task_id"
}
]
},
"status": {
"$coalesce": [
{
"$ref": "response.task.status"
},
{
"$ref": "response.status"
},
{
"$ref": "response.data.status"
},
"pending"
]
},
"message": {
"$coalesce": [
{
"$ref": "response.task.error.message"
},
{
"$ref": "response.task.fail_reason"
},
{
"$ref": "response.error.message"
},
{
"$ref": "response.message"
}
]
},
"videos": {
"$coalesce": [
{
"$ref": "response.task.content.url"
},
{
"$ref": "response.task.content.video_url"
},
{
"$ref": "response.content.url"
},
{
"$ref": "response.data.url"
}
]
},
"usage": {
"$ref": "response.task.usage"
},
"errorPaths": [
"task.error.type",
"error.type",
"error.code"
],
"resultEphemeral": true,
"messagePaths": [
"task.error.message",
"error.message"
]
}
}
]
},
"documentation": "<当前插件的完整 documentation,由 README.md 与 docs/interface.md 拼接而成;为避免 JSON 递归,此处不重复展开正文。>"
}
```
<!-- YINGCE_MANIFEST_CONTRACT_END -->
+367
View File
@@ -0,0 +1,367 @@
{
"apiVersion": "yingce.plugin/v2",
"id": "metaso-h3",
"name": "METASO MiniMax H3",
"version": "1.0.0",
"author": "METASO",
"description": "秘塔 METASO MiniMax H3 文生视频/图生视频协议插件(异步任务)。",
"permissions": [
"generation.run",
"media.read"
],
"configuration": {
"fields": [
{
"name": "apiKey",
"type": "secret",
"label": "API Key",
"required": true
}
]
},
"contributes": {
"providers": [
{
"id": "metaso-h3",
"label": "METASO MiniMax H3",
"capabilities": [
"video"
],
"scopes": [
"admin.system-channel",
"user.custom-channel",
"canvas",
"creation",
"agent"
],
"baseUrl": "https://metaso.cn",
"auth": {
"type": "bearer",
"field": "apiKey"
},
"requiresPublicMediaUrls": true,
"parameters": [
{
"name": "model",
"type": "string",
"required": true,
"mapping": "model",
"description": "视频模型 ID(MiniMax-H3 / MiniMax-H3-Max)。"
},
{
"name": "prompt",
"type": "string",
"required": true,
"mapping": "prompt/content/input",
"description": "视频提示词。"
},
{
"name": "images",
"type": "media[]",
"required": false,
"mapping": "first/last/reference image",
"description": "显式 role 图片输入(首帧/尾帧/参考图)。"
},
{
"name": "videos",
"type": "media[]",
"required": false,
"mapping": "reference video",
"description": "参考视频。"
},
{
"name": "audios",
"type": "media[]",
"required": false,
"mapping": "reference audio/voice",
"description": "参考音频或音色。"
},
{
"name": "duration",
"type": "integer",
"required": false,
"mapping": "duration/seconds",
"description": "时长秒数(4-15)。"
},
{
"name": "aspectRatio",
"type": "string",
"required": false,
"mapping": "ratio/aspect_ratio/size",
"description": "画幅比例(16:9 等)。"
},
{
"name": "resolution",
"type": "string",
"required": false,
"mapping": "resolution",
"description": "分辨率档位(768P / 2K)。"
},
{
"name": "watermark",
"type": "boolean",
"required": false,
"mapping": "watermark",
"description": "AIGC 水印开关。"
},
{
"name": "providerOptions",
"type": "object",
"required": false,
"mapping": "provider-specific fields",
"description": "插件命名空间内的厂商扩展字段。"
}
],
"create": {
"method": "POST",
"path": "/api/minimax/v2/video_generation",
"contentType": "application/json",
"body": {
"model": {
"$coalesce": [
{
"$ref": "request.model"
},
"MiniMax-H3"
]
},
"content": {
"$concatArrays": [
{
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.prompt"
}
},
0
]
},
"then": [
{
"type": "text",
"text": {
"$ref": "request.prompt"
}
}
],
"else": []
}
},
{
"$map": {
"from": {
"$ref": "request.images"
},
"as": "media",
"in": {
"type": "image_url",
"image_url": {
"url": {
"$coalesce": [
{
"$ref": "media.url"
},
{
"$ref": "media.dataUrl"
}
]
}
},
"role": {
"$omitEmpty": {
"$ref": "media.role"
}
}
}
}
},
{
"$map": {
"from": {
"$ref": "request.videos"
},
"as": "media",
"in": {
"type": "video_url",
"video_url": {
"url": {
"$coalesce": [
{
"$ref": "media.url"
},
{
"$ref": "media.dataUrl"
}
]
}
},
"role": {
"$omitEmpty": {
"$ref": "media.role"
}
}
}
}
},
{
"$map": {
"from": {
"$ref": "request.audios"
},
"as": "media",
"in": {
"type": "audio_url",
"audio_url": {
"url": {
"$coalesce": [
{
"$ref": "media.url"
},
{
"$ref": "media.dataUrl"
}
]
}
},
"role": {
"$omitEmpty": {
"$ref": "media.role"
}
}
}
}
}
]
},
"resolution": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.resolution"
},
{
"$ref": "request.providerOptions.metaso-h3.resolution"
},
"768P"
]
}
},
"duration": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.duration"
},
{
"$ref": "request.providerOptions.metaso-h3.duration"
},
5
]
}
},
"ratio": {
"$omitEmpty": {
"$coalesce": [
{
"$ref": "request.aspectRatio"
},
{
"$ref": "request.providerOptions.metaso-h3.ratio"
},
"16:9"
]
}
},
"aigc_watermark": {
"$omitEmpty": {
"$ref": "request.providerOptions.metaso-h3.aigc_watermark"
}
}
}
},
"poll": {
"method": "GET",
"path": "/api/minimax/v2/query/video_generation/{{taskId}}"
},
"response": {
"taskId": {
"$coalesce": [
{
"$ref": "response.task_id"
},
{
"$ref": "response.taskId"
},
{
"$ref": "response.data.task_id"
}
]
},
"status": {
"$coalesce": [
{
"$ref": "response.task.status"
},
{
"$ref": "response.status"
},
{
"$ref": "response.data.status"
},
"pending"
]
},
"message": {
"$coalesce": [
{
"$ref": "response.task.error.message"
},
{
"$ref": "response.task.fail_reason"
},
{
"$ref": "response.error.message"
},
{
"$ref": "response.message"
}
]
},
"videos": {
"$coalesce": [
{
"$ref": "response.task.content.url"
},
{
"$ref": "response.task.content.video_url"
},
{
"$ref": "response.content.url"
},
{
"$ref": "response.data.url"
}
]
},
"usage": {
"$ref": "response.task.usage"
},
"errorPaths": [
"task.error.type",
"error.type",
"error.code"
],
"resultEphemeral": true,
"messagePaths": [
"task.error.message",
"error.message"
]
}
}
]
},
"documentation": "# METASO MiniMax H3\n\n秘塔 METASO MiniMax H3 文生视频 / 图生视频协议插件(异步任务模式)。\n\n## Provider\n\n| Provider | 能力 | 端点 |\n|---|---|---|\n| metaso-h3 | video | POST /api/minimax/v2/video_generation(创建)<br>GET /api/minimax/v2/query/video_generation/{taskId}(轮询) |\n\n## 配置\n\n在渠道中填写 API Key(METASO 控制台创建,形如 `mk-xxxxxxxx`),baseUrl 使用 `https://metaso.cn`。\n\n## 说明\n\n- 模型:`MiniMax-H3`(支持 768P / 2K,4-15 秒,文生图/图生视频/多模态参考),`MiniMax-H3-Max`(480P / 768P,5-15 秒)。\n- 文生视频:仅文本提示词,ratio 必填(21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16)。\n- 图生视频:图片 role 为 first_frame / last_frame(首尾帧)。\n- 多模态参考:图片 reference_image / 视频 reference_video / 音频 reference_audio。\n- 异步任务:创建后返回 task_id,轮询查询接口直到 status=succeeded,成片 URL 在 task.content.url。\n- 鉴权:`Authorization: Bearer mk-xxx`。\n\n---\n\n# METASO MiniMax H3 接口说明\n\n## 鉴权\n\n`Authorization: Bearer mk-xxxxxxxxxxxxxxxxxxxxxxxx`\n\n## 创建视频生成任务\n\nPOST `https://metaso.cn/api/minimax/v2/video_generation`\n\n请求体:\n\n```json\n{\n \"model\": \"MiniMax-H3\",\n \"content\": [\n { \"type\": \"text\", \"text\": \"视频描述\" },\n { \"type\": \"image_url\", \"image_url\": { \"url\": \"https://...\" }, \"role\": \"first_frame\" },\n { \"type\": \"video_url\", \"video_url\": { \"url\": \"https://...\" }, \"role\": \"reference_video\" },\n { \"type\": \"audio_url\", \"audio_url\": { \"url\": \"https://...\" }, \"role\": \"reference_audio\" }\n ],\n \"resolution\": \"768P\",\n \"duration\": 5,\n \"ratio\": \"16:9\"\n}\n```\n\n- content 必须包含一个非空 text 项。\n- 首尾帧(first_frame/last_frame)与多模态参考(reference_*)互斥。\n- 图片 ≤ 9 张、视频 ≤ 3 段、音频 ≤ 3 段;请求体总大小 ≤ 64 MB。\n\n响应:\n\n```json\n{ \"task_id\": \"424010985738629\" }\n```\n\n## 查询任务\n\nGET `https://metaso.cn/api/minimax/v2/query/video_generation/{task_id}`\n\n响应:\n\n```json\n{\n \"task\": {\n \"id\": \"424010985738629\",\n \"status\": \"succeeded\",\n \"content\": { \"url\": \"https://.../output.mp4\" },\n \"resolution\": \"2K\",\n \"duration\": 5,\n \"usage\": { \"total_seconds\": 5, \"output_seconds\": 5 }\n }\n}\n```\n\nstatus 取值:queued / running / succeeded / failed / cancelled。\n\n## 错误\n\n创建与查询均返回 OpenAI 风格错误体,含 `error.type` / `error.message` / `request_id`;余额不足为 402,速率限制为 429。\n\n<!-- YINGCE_MANIFEST_CONTRACT_START -->\n## Manifest 完整接口定义\n\n以下 JSON 与插件包内实际 `manifest.json` 逐字段一致,覆盖插件身份、权限、配置、鉴权、参数、校验、创建、Agent、查询、取消、结果下载、响应和 Agent 响应映射。`documentation` 字段的值就是当前完整文档;为避免文档在自身内部无限递归,JSON 中仅用等义占位文本表示正文。\n\n```json\n{\n \"apiVersion\": \"yingce.plugin/v2\",\n \"id\": \"metaso-h3\",\n \"name\": \"METASO MiniMax H3\",\n \"version\": \"1.0.0\",\n \"author\": \"METASO\",\n \"description\": \"秘塔 METASO MiniMax H3 文生视频/图生视频协议插件(异步任务)。\",\n \"permissions\": [\n \"generation.run\",\n \"media.read\"\n ],\n \"configuration\": {\n \"fields\": [\n {\n \"name\": \"apiKey\",\n \"type\": \"secret\",\n \"label\": \"API Key\",\n \"required\": true\n }\n ]\n },\n \"contributes\": {\n \"providers\": [\n {\n \"id\": \"metaso-h3\",\n \"label\": \"METASO MiniMax H3\",\n \"capabilities\": [\n \"video\"\n ],\n \"scopes\": [\n \"admin.system-channel\",\n \"user.custom-channel\",\n \"canvas\",\n \"creation\",\n \"agent\"\n ],\n \"baseUrl\": \"https://metaso.cn\",\n \"auth\": {\n \"type\": \"bearer\",\n \"field\": \"apiKey\"\n },\n \"requiresPublicMediaUrls\": true,\n \"parameters\": [\n {\n \"name\": \"model\",\n \"type\": \"string\",\n \"required\": true,\n \"mapping\": \"model\",\n \"description\": \"视频模型 ID(MiniMax-H3 / MiniMax-H3-Max)。\"\n },\n {\n \"name\": \"prompt\",\n \"type\": \"string\",\n \"required\": true,\n \"mapping\": \"prompt/content/input\",\n \"description\": \"视频提示词。\"\n },\n {\n \"name\": \"images\",\n \"type\": \"media[]\",\n \"required\": false,\n \"mapping\": \"first/last/reference image\",\n \"desLine truncated
}
Binary file not shown.
+74 -112
View File
@@ -40,8 +40,6 @@
| `create.contentType` | `"application/json"` |
| `create.body.model` | `{"$ref":"request.model"}` |
| `create.body.prompt` | `{"$ref":"request.prompt"}` |
| `create.body.images` | `{"$omitEmpty":{"$if":{"condition":{"$gt":[{"$len":{"$ref":"request.images"}},0]},"then":{"$map":{"from":{"$filter":{"from":{"$sortByOrder":{"$ref":"request.images"}},"as":"media","where":{"$ne":[{"$ref":"media.role"},"mask"]}}},"as":"media","in":{"image_url":{"$ref":"media.value"}}}},"else":null}}}` |
| `create.body.mask` | `{"$omitEmpty":{"$if":{"condition":{"$gt":[{"$len":{"$filter":{"from":{"$ref":"request.images"},"as":"media","where":{"$eq":[{"$ref":"media.role"},"mask"]}}}},0]},"then":{"image_url":{"$first":{"$map":{"from":{"$filter":{"from":{"$sortByOrder":{"$ref":"request.images"}},"as":"media","where":{"$eq":[{"$ref":"media.role"},"mask"]}}},"as":"media","in":{"$ref":"media.value"}}}}},"else":null}}}` |
| `create.body.n` | `{"$omitEmpty":{"$if":{"condition":{"$gt":[{"$ref":"request.imageCount"},0]},"then":{"$ref":"request.imageCount"},"else":1}}}` |
| `create.body.size` | `{"$omitEmpty":{"$if":{"condition":{"$in":[{"$lower":{"$trim":{"$ref":"request.aspectRatio"}}},["","auto"]]},"then":null,"else":{"$ref":"request.aspectRatio"}}}}` |
| `create.body.quality` | `{"$omitEmpty":{"$switch":{"cases":[{"when":{"$in":[{"$lower":{"$trim":{"$ref":"request.quality"}}},["1k"]]},"then":"low"},{"when":{"$in":[{"$lower":{"$trim":{"$ref":"request.quality"}}},["2k"]]},"then":"medium"},{"when":{"$in":[{"$lower":{"$trim":{"$ref":"request.quality"}}},["4k"]]},"then":"high"},{"when":{"$in":[{"$lower":{"$trim":{"$ref":"request.quality"}}},["","auto"]]},"then":null}],"default":{"$ref":"request.quality"}}}}` |
@@ -49,9 +47,15 @@
| `create.body.output_format` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.providerOptions.openai-image.output_format"},"png"]}}` |
| `create.body.output_compression` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.output_compression"}}` |
| `create.body.moderation` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.moderation"}}` |
| `create.body.response_format` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.response_format"}}` |
| `create.body.response_format` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.providerOptions.openai-image.response_format"},"b64_json"]}}` |
| `create.body.style` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.style"}}` |
| `create.body.user` | `{"$omitEmpty":{"$ref":"request.providerOptions.openai-image.user"}}` |
| `create.files[0].name` | `"image"` |
| `create.files[0].source` | `{"$filter":{"from":{"$ref":"request.images"},"as":"media","where":{"$ne":[{"$ref":"media.role"},"mask"]}}}` |
| `create.files[0].filename` | `"source.png"` |
| `create.files[1].name` | `"mask"` |
| `create.files[1].source` | `{"$filter":{"from":{"$ref":"request.images"},"as":"media","where":{"$eq":[{"$ref":"media.role"},"mask"]}}}` |
| `create.files[1].filename` | `"mask.png"` |
## Provider 扩展键
@@ -81,7 +85,7 @@
## 兼容边界
无参考图走 JSON generations;有参考图或蒙版走 JSON edits,并按官方 images 数组传入多张 image_url。quality 的 1k/2k/4k 映射为 OpenAI low/medium/high。
无参考图走 JSON generations;有参考图或蒙版走 multipart edits。quality 的 1k/2k/4k 映射为 OpenAI low/medium/high。
<!-- YINGCE_MANIFEST_CONTRACT_START -->
## Manifest 完整接口定义
@@ -127,7 +131,7 @@
"agent"
],
"baseUrl": "https://api.openai.com",
"requiresPublicMediaUrls": true,
"requiresPublicMediaUrls": false,
"auth": {
"type": "bearer",
"field": "apiKey"
@@ -210,6 +214,22 @@
}
},
"contentType": "application/json",
"contentTypeTemplate": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": "multipart/form-data",
"else": "application/json"
}
},
"body": {
"model": {
"$ref": "request.model"
@@ -217,111 +237,6 @@
"prompt": {
"$ref": "request.prompt"
},
"images": {
"$omitEmpty": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": {
"$map": {
"from": {
"$filter": {
"from": {
"$sortByOrder": {
"$ref": "request.images"
}
},
"as": "media",
"where": {
"$ne": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"as": "media",
"in": {
"image_url": {
"$ref": "media.value"
}
}
}
},
"else": null
}
}
},
"mask": {
"$omitEmpty": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
}
},
0
]
},
"then": {
"image_url": {
"$first": {
"$map": {
"from": {
"$filter": {
"from": {
"$sortByOrder": {
"$ref": "request.images"
}
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"as": "media",
"in": {
"$ref": "media.value"
}
}
}
}
},
"else": null
}
}
},
"n": {
"$omitEmpty": {
"$if": {
@@ -490,7 +405,12 @@
},
"response_format": {
"$omitEmpty": {
"$ref": "request.providerOptions.openai-image.response_format"
"$coalesce": [
{
"$ref": "request.providerOptions.openai-image.response_format"
},
"b64_json"
]
}
},
"style": {
@@ -503,7 +423,49 @@
"$ref": "request.providerOptions.openai-image.user"
}
}
}
},
"files": [
{
"name": "image",
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$ne": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "source.png"
},
{
"name": "mask",
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "mask.png"
}
]
},
"response": {
"status": "succeeded",
+67 -109
View File
@@ -5,7 +5,7 @@
"version": "2.0.0",
"author": "OpenAI / 影策",
"description": "OpenAI Images 独立请求协议插件。",
"documentation": "# OpenAI Images\n\n该目录是独立官方协议插件源码。后端从生成的 `openai-images.yingce-plugin` 包加载,不依赖系统内置 `host:` 适配器。\n\n完整接口见 [docs/interface.md](docs/interface.md)。\n\n---\n\n# OpenAI Images 接口字段\n\n## 协议身份\n\n- 插件 ID:`openai-images`。\n- Provider ID:`openai-image`。\n- 能力:`image`。\n- 默认 Base URL:`https://api.openai.com`。\n- 鉴权驱动:`bearer`。\n- 创建:`POST /v1/images/generations`。\n- 生命周期:同步响应。\n\n## 配置字段\n\n| 字段 | 类型 | 必填 | 含义 |\n| --- | --- | --- | --- |\n| `apiKey` | secret | 是 | API Key |\n\n## 统一字段映射\n\n| 统一字段 | 类型 | 必填 | 上游映射 | 说明 |\n| --- | --- | --- | --- | --- |\n| `model` | string | 是 | `model` | 图片模型 ID。 |\n| `prompt` | string | 是 | `prompt` | 图片提示词。 |\n| `images` | media[] | 否 | `provider image/reference fields` | 参考图或编辑源图,role 由业务层确定。 |\n| `imageCount` | integer | 否 | `n/sample_count` | 输出数量。 |\n| `aspectRatio` | string | 否 | `size/aspect_ratio` | 比例或尺寸,语义按协议说明。 |\n| `resolution` | string | 否 | `resolution/imageSize` | 分辨率档位。 |\n| `quality` | string | 否 | `quality` | 质量档位。 |\n| `providerOptions` | object | 否 | `provider-specific fields` | 插件命名空间内的厂商扩展字段。 |\n\n## 上游请求模板逐字段清单\n\n下表由插件请求模板生成,覆盖 body、query、headers 和 multipart 文件声明中的每个字段。\n\n| 上游位置 | 值或转换表达式 |\n| --- | --- |\n| `create.method` | `\"POST\"` |\n| `create.path` | `\"/v1/images/generations\"` |\n| `create.contentType` | `\"application/json\"` |\n| `create.body.model` | `{\"$ref\":\"request.model\"}` |\n| `create.body.prompt` | `{\"$ref\":\"request.prompt\"}` |\n| `create.body.images` | `{\"$omitEmpty\":{\"$if\":{\"condition\":{\"$gt\":[{\"$len\":{\"$ref\":\"request.images\"}},0]},\"then\":{\"$map\":{\"from\":{\"$filter\":{\"from\":{\"$sortByOrder\":{\"$ref\":\"request.images\"}},\"as\":\"media\",\"where\":{\"$ne\":[{\"$ref\":\"media.role\"},\"mask\"]}}},\"as\":\"media\",\"in\":{\"image_url\":{\"$ref\":\"media.value\"}}}},\"else\":null}}}` |\n| `create.body.mask` | `{\"$omitEmpty\":{\"$if\":{\"condition\":{\"$gt\":[{\"$len\":{\"$filter\":{\"from\":{\"$ref\":\"request.images\"},\"as\":\"media\",\"where\":{\"$eq\":[{\"$ref\":\"media.role\"},\"mask\"]}}}},0]},\"then\":{\"image_url\":{\"$first\":{\"$map\":{\"from\":{\"$filter\":{\"from\":{\"$sortByOrder\":{\"$ref\":\"request.images\"}},\"as\":\"media\",\"where\":{\"$eq\":[{\"$ref\":\"media.role\"},\"mask\"]}}},\"as\":\"media\",\"in\":{\"$ref\":\"media.value\"}}}}},\"else\":null}}}` |\n| `create.body.n` | `{\"$omitEmpty\":{\"$if\":{\"condition\":{\"$gt\":[{\"$ref\":\"request.imageCount\"},0]},\"then\":{\"$ref\":\"request.imageCount\"},\"else\":1}}}` |\n| `create.body.size` | `{\"$omitEmpty\":{\"$if\":{\"condition\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.aspectRatio\"}}},[\"\",\"auto\"]]},\"then\":null,\"else\":{\"$ref\":\"request.aspectRatio\"}}}}` |\n| `create.body.quality` | `{\"$omitEmpty\":{\"$switch\":{\"cases\":[{\"when\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.quality\"}}},[\"1k\"]]},\"then\":\"low\"},{\"when\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.quality\"}}},[\"2k\"]]},\"then\":\"medium\"},{\"when\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.quality\"}}},[\"4k\"]]},\"then\":\"high\"},{\"when\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.quality\"}}},[\"\",\"auto\"]]},\"then\":null}],\"default\":{\"$ref\":\"request.quality\"}}}}` |\n| `create.body.background` | `{\"$omitEmpty\":{\"$coalesce\":[{\"$ref\":\"request.providerOptions.openai-image.background\"},{\"$if\":{\"condition\":{\"$eq\":[{\"$ref\":\"request.extra.transparentBackground\"},\"true\"]},\"then\":\"transparent\",\"else\":null}}]}}` |\n| `create.body.output_format` | `{\"$omitEmpty\":{\"$coalesce\":[{\"$ref\":\"request.providerOptions.openai-image.output_format\"},\"png\"]}}` |\n| `create.body.output_compression` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.output_compression\"}}` |\n| `create.body.moderation` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.moderation\"}}` |\n| `create.body.response_format` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.response_format\"}}` |\n| `create.body.style` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.style\"}}` |\n| `create.body.user` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.user\"}}` |\n\n## Provider 扩展键\n\n- `providerOptions.openai-image.background`\n- `providerOptions.openai-image.moderation`\n- `providerOptions.openai-image.output_compression`\n- `providerOptions.openai-image.output_format`\n- `providerOptions.openai-imaLine truncated
"documentation": "# OpenAI Images\n\n该目录是独立官方协议插件源码。后端从生成的 `openai-images.yingce-plugin` 包加载,不依赖系统内置 `host:` 适配器。\n\n完整接口见 [docs/interface.md](docs/interface.md)。\n\n---\n\n# OpenAI Images 接口字段\n\n## 协议身份\n\n- 插件 ID:`openai-images`。\n- Provider ID:`openai-image`。\n- 能力:`image`。\n- 默认 Base URL:`https://api.openai.com`。\n- 鉴权驱动:`bearer`。\n- 创建:`POST /v1/images/generations`。\n- 生命周期:同步响应。\n\n## 配置字段\n\n| 字段 | 类型 | 必填 | 含义 |\n| --- | --- | --- | --- |\n| `apiKey` | secret | 是 | API Key |\n\n## 统一字段映射\n\n| 统一字段 | 类型 | 必填 | 上游映射 | 说明 |\n| --- | --- | --- | --- | --- |\n| `model` | string | 是 | `model` | 图片模型 ID。 |\n| `prompt` | string | 是 | `prompt` | 图片提示词。 |\n| `images` | media[] | 否 | `provider image/reference fields` | 参考图或编辑源图,role 由业务层确定。 |\n| `imageCount` | integer | 否 | `n/sample_count` | 输出数量。 |\n| `aspectRatio` | string | 否 | `size/aspect_ratio` | 比例或尺寸,语义按协议说明。 |\n| `resolution` | string | 否 | `resolution/imageSize` | 分辨率档位。 |\n| `quality` | string | 否 | `quality` | 质量档位。 |\n| `providerOptions` | object | 否 | `provider-specific fields` | 插件命名空间内的厂商扩展字段。 |\n\n## 上游请求模板逐字段清单\n\n下表由插件请求模板生成,覆盖 body、query、headers 和 multipart 文件声明中的每个字段。\n\n| 上游位置 | 值或转换表达式 |\n| --- | --- |\n| `create.method` | `\"POST\"` |\n| `create.path` | `\"/v1/images/generations\"` |\n| `create.contentType` | `\"application/json\"` |\n| `create.body.model` | `{\"$ref\":\"request.model\"}` |\n| `create.body.prompt` | `{\"$ref\":\"request.prompt\"}` |\n| `create.body.n` | `{\"$omitEmpty\":{\"$if\":{\"condition\":{\"$gt\":[{\"$ref\":\"request.imageCount\"},0]},\"then\":{\"$ref\":\"request.imageCount\"},\"else\":1}}}` |\n| `create.body.size` | `{\"$omitEmpty\":{\"$if\":{\"condition\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.aspectRatio\"}}},[\"\",\"auto\"]]},\"then\":null,\"else\":{\"$ref\":\"request.aspectRatio\"}}}}` |\n| `create.body.quality` | `{\"$omitEmpty\":{\"$switch\":{\"cases\":[{\"when\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.quality\"}}},[\"1k\"]]},\"then\":\"low\"},{\"when\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.quality\"}}},[\"2k\"]]},\"then\":\"medium\"},{\"when\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.quality\"}}},[\"4k\"]]},\"then\":\"high\"},{\"when\":{\"$in\":[{\"$lower\":{\"$trim\":{\"$ref\":\"request.quality\"}}},[\"\",\"auto\"]]},\"then\":null}],\"default\":{\"$ref\":\"request.quality\"}}}}` |\n| `create.body.background` | `{\"$omitEmpty\":{\"$coalesce\":[{\"$ref\":\"request.providerOptions.openai-image.background\"},{\"$if\":{\"condition\":{\"$eq\":[{\"$ref\":\"request.extra.transparentBackground\"},\"true\"]},\"then\":\"transparent\",\"else\":null}}]}}` |\n| `create.body.output_format` | `{\"$omitEmpty\":{\"$coalesce\":[{\"$ref\":\"request.providerOptions.openai-image.output_format\"},\"png\"]}}` |\n| `create.body.output_compression` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.output_compression\"}}` |\n| `create.body.moderation` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.moderation\"}}` |\n| `create.body.response_format` | `{\"$omitEmpty\":{\"$coalesce\":[{\"$ref\":\"request.providerOptions.openai-image.response_format\"},\"b64_json\"]}}` |\n| `create.body.style` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.style\"}}` |\n| `create.body.user` | `{\"$omitEmpty\":{\"$ref\":\"request.providerOptions.openai-image.user\"}}` |\n| `create.files[0].name` | `\"image\"` |\n| `create.files[0].source` | `{\"$filter\":{\"from\":{\"$ref\":\"request.images\"},\"as\":\"media\",\"where\":{\"$ne\":[{\"$ref\":\"media.role\"},\"mask\"]}}}` |\n| `create.files[0].filename` | `\"source.png\"` |\n| `create.files[1].name` | `\"mask\"` |\n| `create.files[1].source` | `{\"$filter\":{\"from\":{\"$ref\":\"request.images\"},\"as\":\"media\",\"where\":{\"$eq\":[{\"$ref\":\"media.role\"},\"mask\"]}}}` |\n| `create.files[1].filename` | `\"mask.png\"` |\n\n## Provider 扩展键\n\n- `providerOptions.openai-image.background`\n- `providerOptions.openai-image.moderation`\n- `providerOptions.openai-image.output_compression`\n- `providerOptions.openai-image.output_format`\n- `providerOptions.openai-image.response_format`\n- `providerOptions.openai-image.style`\n- `providerOptions.openai-image.user`\n\n动态模型或工作流允许使用文档声明的完整 `parameters/input/extra_body` 对象;该对象是协议本身的开放 schema,不会被宿主裁剪。\n\n## 响应映射逐字段清单\n\n| 映射位置 | 上游路径或转换表Line truncated
"permissions": [
"generation.run",
"media.read"
@@ -36,7 +36,7 @@
"agent"
],
"baseUrl": "https://api.openai.com",
"requiresPublicMediaUrls": true,
"requiresPublicMediaUrls": false,
"auth": {
"type": "bearer",
"field": "apiKey"
@@ -119,6 +119,22 @@
}
},
"contentType": "application/json",
"contentTypeTemplate": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": "multipart/form-data",
"else": "application/json"
}
},
"body": {
"model": {
"$ref": "request.model"
@@ -126,111 +142,6 @@
"prompt": {
"$ref": "request.prompt"
},
"images": {
"$omitEmpty": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$ref": "request.images"
}
},
0
]
},
"then": {
"$map": {
"from": {
"$filter": {
"from": {
"$sortByOrder": {
"$ref": "request.images"
}
},
"as": "media",
"where": {
"$ne": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"as": "media",
"in": {
"image_url": {
"$ref": "media.value"
}
}
}
},
"else": null
}
}
},
"mask": {
"$omitEmpty": {
"$if": {
"condition": {
"$gt": [
{
"$len": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
}
},
0
]
},
"then": {
"image_url": {
"$first": {
"$map": {
"from": {
"$filter": {
"from": {
"$sortByOrder": {
"$ref": "request.images"
}
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"as": "media",
"in": {
"$ref": "media.value"
}
}
}
}
},
"else": null
}
}
},
"n": {
"$omitEmpty": {
"$if": {
@@ -399,7 +310,12 @@
},
"response_format": {
"$omitEmpty": {
"$ref": "request.providerOptions.openai-image.response_format"
"$coalesce": [
{
"$ref": "request.providerOptions.openai-image.response_format"
},
"b64_json"
]
}
},
"style": {
@@ -412,7 +328,49 @@
"$ref": "request.providerOptions.openai-image.user"
}
}
}
},
"files": [
{
"name": "image",
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$ne": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "source.png"
},
{
"name": "mask",
"source": {
"$filter": {
"from": {
"$ref": "request.images"
},
"as": "media",
"where": {
"$eq": [
{
"$ref": "media.role"
},
"mask"
]
}
}
},
"filename": "mask.png"
}
]
},
"response": {
"status": "succeeded",
+20
View File
@@ -0,0 +1,20 @@
# A6api
A6api 模型网关协议插件。统一入口 `https://api.a6api.com`,OpenAI 兼容(`Authorization: Bearer <api_key>`)。
## Providers
| Provider | 能力 | 端点 |
|---|---|---|
| a6api-chat | text | POST /chat/completions |
| a6api-image | image | POST /images/generations、POST /images/edits |
## 配置
在渠道中填写 API Key(A6api 控制台创建,形如 `sk-xxxxxxxx`),baseUrl 使用 `https://api.a6api.com`。
## 说明
- 模型名以 A6api 模型市场当前列表为准。
- 图像编辑(带参考图)走 `/images/edits` multipart 请求。
- 错误体为 OpenAI 风格,携带 `request_id`。
@@ -0,0 +1,29 @@
# A6api 接口说明
## 鉴权
`Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxx`
## 文本对话
POST `https://api.a6api.com/chat/completions`
请求体 OpenAI Chat Completions 格式:`model`、`messages`、`temperature`、`max_tokens`、`tools`、`tool_choice`、`response_format`、`stream` 等。
响应 `choices[0].message.content` 为正文,`choices[0].message.reasoning_content` 为推理内容,`usage` 为用量。
## 图像生成
POST `https://api.a6api.com/images/generations`
请求体:`model`、`prompt`、`n`、`size`、`quality`、`response_format`。
响应 `data[].url` 或 `data[].b64_json`。
## 图像编辑
POST `https://api.a6api.com/images/edits`(multipart,带参考图时使用)
## 模型列表
GET `https://api.a6api.com/models`
+143
View File
@@ -0,0 +1,143 @@
{
"apiVersion": "yingce.plugin/v2",
"id": "a6api",
"name": "A6api",
"version": "1.0.0",
"author": "A6api",
"description": "A6api 模型网关协议插件:OpenAI 兼容对话与图像生成。",
"permissions": ["generation.run", "media.read"],
"configuration": {
"fields": [
{ "name": "apiKey", "type": "secret", "label": "API Key", "required": true }
]
},
"contributes": {
"providers": [
{
"id": "a6api-chat",
"label": "A6api Chat",
"capabilities": ["text"],
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
"baseUrl": "https://api.a6api.com",
"auth": { "type": "bearer", "field": "apiKey" },
"parameters": [
{ "name": "model", "type": "string", "required": true, "mapping": "model", "description": "A6api 模型市场中的模型 ID。" },
{ "name": "messages", "type": "message[]", "required": true, "mapping": "provider message container", "description": "包含历史消息和当前用户输入。" },
{ "name": "instructions", "type": "string", "required": false, "mapping": "system/instructions", "description": "系统指令。" },
{ "name": "temperature", "type": "number", "required": false, "mapping": "temperature", "description": "采样温度。" },
{ "name": "top_p", "type": "number", "required": false, "mapping": "top_p", "description": "核采样参数。" },
{ "name": "max_tokens", "type": "integer", "required": false, "mapping": "max_tokens/max_output_tokens", "description": "最大输出 token。" },
{ "name": "tools", "type": "array", "required": false, "mapping": "tools/toolConfig", "description": "工具定义。" },
{ "name": "tool_choice", "type": "object|string", "required": false, "mapping": "tool_choice", "description": "工具选择策略。" },
{ "name": "response_format", "type": "object", "required": false, "mapping": "response_format/text", "description": "结构化输出配置。" },
{ "name": "stream", "type": "boolean", "required": false, "mapping": "stream", "description": "流式开关;后台任务当前以最终响应归一。" },
{ "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "插件命名空间内的厂商扩展字段。" }
],
"create": {
"method": "POST",
"path": "/chat/completions",
"contentType": "application/json",
"body": {
"model": { "$ref": "request.model" },
"messages": { "$ref": "request.messages" },
"temperature": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.temperature" } },
"top_p": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.top_p" } },
"max_tokens": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.extra.max_tokens" }, { "$ref": "request.providerOptions.a6api-chat.max_tokens" } ] } },
"tools": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.tools" } },
"tool_choice": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.tool_choice" } },
"response_format": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.response_format" } },
"stream": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.stream" } },
"stop": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.stop" } },
"seed": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.seed" } },
"frequency_penalty": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.frequency_penalty" } },
"presence_penalty": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.presence_penalty" } },
"user": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-chat.user" } }
}
},
"response": {
"status": "succeeded",
"textPaths": ["choices.0.message.content", "choices.0.text"],
"reasoningPaths": ["choices.0.message.reasoning_content"],
"usage": { "$ref": "response.usage" },
"errorPaths": ["error.code"],
"messagePaths": ["error.message"]
}
},
{
"id": "a6api-image",
"label": "A6api Image",
"capabilities": ["image"],
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
"baseUrl": "https://api.a6api.com",
"auth": { "type": "bearer", "field": "apiKey" },
"parameters": [
{ "name": "model", "type": "string", "required": true, "mapping": "model", "description": "A6api 模型市场中的图像模型 ID。" },
{ "name": "prompt", "type": "string", "required": true, "mapping": "prompt", "description": "图片提示词。" },
{ "name": "images", "type": "media[]", "required": false, "mapping": "provider image/reference fields", "description": "参考图或编辑源图,role 由业务层确定。" },
{ "name": "imageCount", "type": "integer", "required": false, "mapping": "n/sample_count", "description": "输出数量。" },
{ "name": "aspectRatio", "type": "string", "required": false, "mapping": "size/aspect_ratio", "description": "比例或尺寸,语义按协议说明。" },
{ "name": "resolution", "type": "string", "required": false, "mapping": "resolution/imageSize", "description": "分辨率档位。" },
{ "name": "quality", "type": "string", "required": false, "mapping": "quality", "description": "质量档位。" },
{ "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "插件命名空间内的厂商扩展字段。" }
],
"create": {
"method": "POST",
"path": "/images/generations",
"pathTemplate": {
"$if": {
"condition": { "$gt": [ { "$len": { "$ref": "request.images" } }, 0 ] },
"then": "/images/edits",
"else": "/images/generations"
}
},
"contentType": "application/json",
"contentTypeTemplate": {
"$if": {
"condition": { "$gt": [ { "$len": { "$ref": "request.images" } }, 0 ] },
"then": "multipart/form-data",
"else": "application/json"
}
},
"body": {
"model": { "$ref": "request.model" },
"prompt": { "$ref": "request.prompt" },
"n": { "$omitEmpty": { "$if": { "condition": { "$gt": [ { "$ref": "request.imageCount" }, 0 ] }, "then": { "$ref": "request.imageCount" }, "else": 1 } } },
"size": { "$omitEmpty": { "$ref": "request.aspectRatio" } },
"quality": { "$omitEmpty": { "$ref": "request.quality" } },
"output_format": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.providerOptions.a6api-image.output_format" }, "png" ] } },
"response_format": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.providerOptions.a6api-image.response_format" }, "b64_json" ] } },
"user": { "$omitEmpty": { "$ref": "request.providerOptions.a6api-image.user" } }
},
"files": [
{
"name": "image",
"source": { "$filter": { "from": { "$ref": "request.images" }, "as": "media", "where": { "$ne": [ { "$ref": "media.role" }, "mask" ] } } },
"filename": "source.png"
},
{
"name": "mask",
"source": { "$filter": { "from": { "$ref": "request.images" }, "as": "media", "where": { "$eq": [ { "$ref": "media.role" }, "mask" ] } } },
"filename": "mask.png"
}
]
},
"response": {
"status": "succeeded",
"images": {
"$map": {
"from": { "$ref": "response.data" },
"as": "item",
"in": {
"url": { "$omitEmpty": { "$ref": "item.url" } },
"dataUrl": { "$if": { "condition": { "$ref": "item.b64_json" }, "then": { "$concat": [ "data:image/png;base64,", { "$ref": "item.b64_json" } ] }, "else": null } }
}
}
},
"usage": { "$ref": "response.usage" },
"errorPaths": ["error.code"],
"messagePaths": ["error.message"]
}
}
]
}
}
@@ -0,0 +1,41 @@
# Antigravity Proxy
Antigravity 中转渠道插件:OpenAI Chat Completions 兼容对话协议。
## 协议身份
- 插件 ID:`antigravity-proxy`
- Provider ID:`antigravity-chat`
- 能力:`text`
- 默认 Base URL:`http://103.242.14.110:8317`
- 鉴权驱动:`bearer`
- 创建:`POST /chat/completions`
- 生命周期:同步响应
## 配置字段
| 字段 | 类型 | 必填 | 含义 |
| --- | --- | --- | --- |
| `apiKey` | secret | 是 | 中转渠道 API Key |
## 模型
- `gemini-3.8-flash-high`
- `gemini-pro-agent`
## 统一字段映射
| 统一字段 | 类型 | 必填 | 上游映射 |
| --- | --- | --- | --- |
| `model` | string | 是 | `model` |
| `messages` | message[] | 是 | `messages` |
| `instructions` | string | 否 | `system/instructions` |
| `temperature` | number | 否 | `temperature` |
| `top_p` | number | 否 | `top_p` |
| `max_tokens` | integer | 否 | `max_tokens` |
| `tools` | array | 否 | `tools` |
| `tool_choice` | object\|string | 否 | `tool_choice` |
| `response_format` | object | 否 | `response_format` |
| `stream` | boolean | 否 | `stream` |
完整接口见 [docs/interface.md](docs/interface.md)。
@@ -0,0 +1,70 @@
# Antigravity Proxy 接口字段
## 协议身份
- 插件 ID:`antigravity-proxy`
- Provider ID:`antigravity-chat`
- 能力:`text`
- 默认 Base URL:`http://103.242.14.110:8317`
- 鉴权驱动:`bearer`
- 创建:`POST /chat/completions`
- 生命周期:同步响应
## 配置字段
| 字段 | 类型 | 必填 | 含义 |
| --- | --- | --- | --- |
| `apiKey` | secret | 是 | 中转渠道 API Key |
## 统一字段映射
| 统一字段 | 类型 | 必填 | 上游映射 | 说明 |
| --- | --- | --- | --- | --- |
| `model` | string | 是 | `model` | 上游模型 ID。 |
| `messages` | message[] | 是 | `messages` | 包含历史消息和当前用户输入。 |
| `instructions` | string | 否 | `system/instructions` | 系统指令。 |
| `temperature` | number | 否 | `temperature` | 采样温度。 |
| `top_p` | number | 否 | `top_p` | 核采样参数。 |
| `max_tokens` | integer | 否 | `max_tokens/max_output_tokens` | 最大输出 token。 |
| `tools` | array | 否 | `tools/toolConfig` | 工具定义。 |
| `tool_choice` | object\|string | 否 | `tool_choice` | 工具选择策略。 |
| `response_format` | object | 否 | `response_format/text` | 结构化输出配置。 |
| `stream` | boolean | 否 | `stream` | 流式开关。 |
## 上游请求模板
| 上游位置 | 值或转换表达式 |
| --- | --- |
| `create.method` | `"POST"` |
| `create.path` | `"/chat/completions"` |
| `create.contentType` | `"application/json"` |
| `create.body.model` | `{"$ref":"request.model"}` |
| `create.body.messages` | `{"$ref":"request.messages"}` |
| `create.body.temperature` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.temperature"}}` |
| `create.body.top_p` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.top_p"}}` |
| `create.body.max_tokens` | `{"$omitEmpty":{"$coalesce":[{"$ref":"request.extra.max_tokens"},{"$ref":"request.providerOptions.antigravity-chat.max_tokens"}]}}` |
| `create.body.tools` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.tools"}}` |
| `create.body.tool_choice` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.tool_choice"}}` |
| `create.body.response_format` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.response_format"}}` |
| `create.body.stream` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.stream"}}` |
| `create.body.stop` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.stop"}}` |
| `create.body.seed` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.seed"}}` |
| `create.body.frequency_penalty` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.frequency_penalty"}}` |
| `create.body.presence_penalty` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.presence_penalty"}}` |
| `create.body.user` | `{"$omitEmpty":{"$ref":"request.providerOptions.antigravity-chat.user"}}` |
## 响应映射
| 映射位置 | 上游路径或转换表达式 |
| --- | --- |
| `response.status` | `"succeeded"` |
| `response.textPaths[0]` | `"choices.0.message.content"` |
| `response.textPaths[1]` | `"choices.0.text"` |
| `response.reasoningPaths[0]` | `"choices.0.message.reasoning_content"` |
| `response.usage` | `{"$ref":"response.usage"}` |
| `response.errorPaths[0]` | `"error.code"` |
| `response.messagePaths[0]` | `"error.message"` |
## 兼容边界
该包只代表 Antigravity 中转渠道的 OpenAI Chat Completions 线协议;其他端点或网关包装必须使用独立插件。
@@ -0,0 +1,68 @@
{
"apiVersion": "yingce.plugin/v2",
"id": "antigravity-proxy",
"name": "Antigravity Proxy",
"version": "1.0.0",
"author": "Yingce",
"description": "Antigravity 中转渠道插件:OpenAI 兼容对话(gemini-3.8-flash-high / gemini-pro-agent)。",
"permissions": ["generation.run", "media.read"],
"configuration": {
"fields": [
{ "name": "apiKey", "type": "secret", "label": "API Key", "required": true }
]
},
"contributes": {
"providers": [
{
"id": "antigravity-chat",
"label": "Antigravity Chat",
"capabilities": ["text"],
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
"baseUrl": "http://103.242.14.110:8317",
"auth": { "type": "bearer", "field": "apiKey" },
"parameters": [
{ "name": "model", "type": "string", "required": true, "mapping": "model", "description": "模型 ID(gemini-3.8-flash-high / gemini-pro-agent)。" },
{ "name": "messages", "type": "message[]", "required": true, "mapping": "provider message container", "description": "包含历史消息和当前用户输入。" },
{ "name": "instructions", "type": "string", "required": false, "mapping": "system/instructions", "description": "系统指令。" },
{ "name": "temperature", "type": "number", "required": false, "mapping": "temperature", "description": "采样温度。" },
{ "name": "top_p", "type": "number", "required": false, "mapping": "top_p", "description": "核采样参数。" },
{ "name": "max_tokens", "type": "integer", "required": false, "mapping": "max_tokens/max_output_tokens", "description": "最大输出 token。" },
{ "name": "tools", "type": "array", "required": false, "mapping": "tools/toolConfig", "description": "工具定义。" },
{ "name": "tool_choice", "type": "object|string", "required": false, "mapping": "tool_choice", "description": "工具选择策略。" },
{ "name": "response_format", "type": "object", "required": false, "mapping": "response_format/text", "description": "结构化输出配置。" },
{ "name": "stream", "type": "boolean", "required": false, "mapping": "stream", "description": "流式开关;后台任务当前以最终响应归一。" },
{ "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "插件命名空间内的厂商扩展字段。" }
],
"create": {
"method": "POST",
"path": "/chat/completions",
"contentType": "application/json",
"body": {
"model": { "$ref": "request.model" },
"messages": { "$ref": "request.messages" },
"temperature": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.temperature" } },
"top_p": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.top_p" } },
"max_tokens": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.extra.max_tokens" }, { "$ref": "request.providerOptions.antigravity-chat.max_tokens" } ] } },
"tools": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.tools" } },
"tool_choice": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.tool_choice" } },
"response_format": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.response_format" } },
"stream": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.stream" } },
"stop": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.stop" } },
"seed": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.seed" } },
"frequency_penalty": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.frequency_penalty" } },
"presence_penalty": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.presence_penalty" } },
"user": { "$omitEmpty": { "$ref": "request.providerOptions.antigravity-chat.user" } }
}
},
"response": {
"status": "succeeded",
"textPaths": ["choices.0.message.content", "choices.0.text"],
"reasoningPaths": ["choices.0.message.reasoning_content"],
"usage": { "$ref": "response.usage" },
"errorPaths": ["error.code"],
"messagePaths": ["error.message"]
}
}
]
}
}
+22
View File
@@ -0,0 +1,22 @@
# METASO MiniMax H3
秘塔 METASO MiniMax H3 文生视频 / 图生视频协议插件(异步任务模式)。
## Provider
| Provider | 能力 | 端点 |
|---|---|---|
| metaso-h3 | video | POST /api/minimax/v2/video_generation(创建)<br>GET /api/minimax/v2/query/video_generation/{taskId}(轮询) |
## 配置
在渠道中填写 API Key(METASO 控制台创建,形如 `mk-xxxxxxxx`),baseUrl 使用 `https://metaso.cn`。
## 说明
- 模型:`MiniMax-H3`(支持 768P / 2K,4-15 秒,文生图/图生视频/多模态参考),`MiniMax-H3-Max`(480P / 768P,5-15 秒)。
- 文生视频:仅文本提示词,ratio 必填(21:9 / 16:9 / 4:3 / 1:1 / 3:4 / 9:16)。
- 图生视频:图片 role 为 first_frame / last_frame(首尾帧)。
- 多模态参考:图片 reference_image / 视频 reference_video / 音频 reference_audio。
- 异步任务:创建后返回 task_id,轮询查询接口直到 status=succeeded,成片 URL 在 task.content.url。
- 鉴权:`Authorization: Bearer mk-xxx`。
@@ -0,0 +1,61 @@
# METASO MiniMax H3 接口说明
## 鉴权
`Authorization: Bearer mk-xxxxxxxxxxxxxxxxxxxxxxxx`
## 创建视频生成任务
POST `https://metaso.cn/api/minimax/v2/video_generation`
请求体:
```json
{
"model": "MiniMax-H3",
"content": [
{ "type": "text", "text": "视频描述" },
{ "type": "image_url", "image_url": { "url": "https://..." }, "role": "first_frame" },
{ "type": "video_url", "video_url": { "url": "https://..." }, "role": "reference_video" },
{ "type": "audio_url", "audio_url": { "url": "https://..." }, "role": "reference_audio" }
],
"resolution": "768P",
"duration": 5,
"ratio": "16:9"
}
```
- content 必须包含一个非空 text 项。
- 首尾帧(first_frame/last_frame)与多模态参考(reference_*)互斥。
- 图片 ≤ 9 张、视频 ≤ 3 段、音频 ≤ 3 段;请求体总大小 ≤ 64 MB。
响应:
```json
{ "task_id": "424010985738629" }
```
## 查询任务
GET `https://metaso.cn/api/minimax/v2/query/video_generation/{task_id}`
响应:
```json
{
"task": {
"id": "424010985738629",
"status": "succeeded",
"content": { "url": "https://.../output.mp4" },
"resolution": "2K",
"duration": 5,
"usage": { "total_seconds": 5, "output_seconds": 5 }
}
}
```
status 取值:queued / running / succeeded / failed / cancelled。
## 错误
创建与查询均返回 OpenAI 风格错误体,含 `error.type` / `error.message` / `request_id`;余额不足为 402,速率限制为 429。
+100
View File
@@ -0,0 +1,100 @@
{
"apiVersion": "yingce.plugin/v2",
"id": "metaso-h3",
"name": "METASO MiniMax H3",
"version": "1.0.0",
"author": "METASO",
"description": "秘塔 METASO MiniMax H3 文生视频/图生视频协议插件(异步任务)。",
"permissions": ["generation.run", "media.read"],
"configuration": {
"fields": [
{ "name": "apiKey", "type": "secret", "label": "API Key", "required": true }
]
},
"contributes": {
"providers": [
{
"id": "metaso-h3",
"label": "METASO MiniMax H3",
"capabilities": ["video"],
"scopes": ["admin.system-channel", "user.custom-channel", "canvas", "creation", "agent"],
"baseUrl": "https://metaso.cn",
"auth": { "type": "bearer", "field": "apiKey" },
"requiresPublicMediaUrls": true,
"parameters": [
{ "name": "model", "type": "string", "required": true, "mapping": "model", "description": "视频模型 ID(MiniMax-H3 / MiniMax-H3-Max)。" },
{ "name": "prompt", "type": "string", "required": true, "mapping": "prompt/content/input", "description": "视频提示词。" },
{ "name": "images", "type": "media[]", "required": false, "mapping": "first/last/reference image", "description": "显式 role 图片输入(首帧/尾帧/参考图)。" },
{ "name": "videos", "type": "media[]", "required": false, "mapping": "reference video", "description": "参考视频。" },
{ "name": "audios", "type": "media[]", "required": false, "mapping": "reference audio/voice", "description": "参考音频或音色。" },
{ "name": "duration", "type": "integer", "required": false, "mapping": "duration/seconds", "description": "时长秒数(4-15)。" },
{ "name": "aspectRatio", "type": "string", "required": false, "mapping": "ratio/aspect_ratio/size", "description": "画幅比例(16:9 等)。" },
{ "name": "resolution", "type": "string", "required": false, "mapping": "resolution", "description": "分辨率档位(768P / 2K)。" },
{ "name": "watermark", "type": "boolean", "required": false, "mapping": "watermark", "description": "AIGC 水印开关。" },
{ "name": "providerOptions", "type": "object", "required": false, "mapping": "provider-specific fields", "description": "插件命名空间内的厂商扩展字段。" }
],
"create": {
"method": "POST",
"path": "/api/minimax/v2/video_generation",
"contentType": "application/json",
"body": {
"model": { "$coalesce": [ { "$ref": "request.model" }, "MiniMax-H3" ] },
"content": {
"$concatArrays": [
{ "$if": { "condition": { "$gt": [ { "$len": { "$ref": "request.prompt" } }, 0 ] }, "then": [ { "type": "text", "text": { "$ref": "request.prompt" } } ], "else": [] } },
{ "$map": { "from": { "$ref": "request.images" }, "as": "media", "in": { "type": "image_url", "image_url": { "url": { "$coalesce": [ { "$ref": "media.url" }, { "$ref": "media.dataUrl" } ] } }, "role": { "$omitEmpty": { "$ref": "media.role" } } } } },
{ "$map": { "from": { "$ref": "request.videos" }, "as": "media", "in": { "type": "video_url", "video_url": { "url": { "$coalesce": [ { "$ref": "media.url" }, { "$ref": "media.dataUrl" } ] } }, "role": { "$omitEmpty": { "$ref": "media.role" } } } } },
{ "$map": { "from": { "$ref": "request.audios" }, "as": "media", "in": { "type": "audio_url", "audio_url": { "url": { "$coalesce": [ { "$ref": "media.url" }, { "$ref": "media.dataUrl" } ] } }, "role": { "$omitEmpty": { "$ref": "media.role" } } } } }
]
},
"resolution": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.resolution" }, { "$ref": "request.providerOptions.metaso-h3.resolution" }, "768P" ] } },
"duration": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.duration" }, { "$ref": "request.providerOptions.metaso-h3.duration" }, 5 ] } },
"ratio": { "$omitEmpty": { "$coalesce": [ { "$ref": "request.aspectRatio" }, { "$ref": "request.providerOptions.metaso-h3.ratio" }, "16:9" ] } },
"aigc_watermark": { "$omitEmpty": { "$ref": "request.providerOptions.metaso-h3.aigc_watermark" } }
}
},
"poll": {
"method": "GET",
"path": "/api/minimax/v2/query/video_generation/{{taskId}}"
},
"response": {
"taskId": {
"$coalesce": [
{ "$ref": "response.task_id" },
{ "$ref": "response.taskId" },
{ "$ref": "response.data.task_id" }
]
},
"status": {
"$coalesce": [
{ "$ref": "response.task.status" },
{ "$ref": "response.status" },
{ "$ref": "response.data.status" },
"pending"
]
},
"message": {
"$coalesce": [
{ "$ref": "response.task.error.message" },
{ "$ref": "response.task.fail_reason" },
{ "$ref": "response.error.message" },
{ "$ref": "response.message" }
]
},
"videos": {
"$coalesce": [
{ "$ref": "response.task.content.url" },
{ "$ref": "response.task.content.video_url" },
{ "$ref": "response.content.url" },
{ "$ref": "response.data.url" }
]
},
"usage": { "$ref": "response.task.usage" },
"errorPaths": ["task.error.type", "error.type", "error.code"],
"resultEphemeral": true,
"messagePaths": ["task.error.message", "error.message"]
}
}
]
}
}