Admin 管理 API

版本 2026-11-19.1。Base URL:https://api.latenth.com/voice/v1。同一平台API Key,Authorization: Bearer API_KEY;只访问自己的租户资源。管理指南 · 下载完整 OpenAPI 3.1。

写入使用 application/json,请求体最多512KiB。成功为 {success:true,data:…};失败先检查HTTP状态,错误体可能为JSON、纯文本或空;JSON 错误可带稳定的 code 字段,按 code 处理,不要匹配 message 文本。409需要重新读取revision或使用新资源版本,不能盲目重复发布。401/403检查权限,404检查租户和资源,429有限退避重试。列表无统一分页保证。

正式接入接口 · 完整对象字段

以自定义模型为例:界面中的模型名称、基础型号、语言、音色和 Instructions,对应 CustomConfig。先在界面了解配置,再按下方接口完成草稿、校验和发布。

自定义模型草稿配置:名称、语音型号、输入输出语言、音色和业务指令;内容为未保存的示例。
自定义模型草稿配置:名称、语音型号、输入输出语言、音色和业务指令;内容为未保存的示例。 · 点击图片查看大图

正式接入接口

接口目录
GET /catalog · 查询语音模型、语言、音色及价格目录

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Catalog"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "models": [],
    "agent_models": [],
    "voice_models": [],
    "voices": [],
    "default_voice": "example",
    "prices": {}
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_catalog",
  "summary": "查询语音模型、语言、音色及价格目录",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Catalog"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /voices · 查询公共音色

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "default": {
          "type": "string"
        },
        "voices": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Voice"
          }
        }
      },
      "required": []
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "default": "example",
    "voices": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_voices",
  "summary": "查询公共音色",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "object",
                "properties": {
                  "default": {
                    "type": "string"
                  },
                  "voices": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Voice"
                    }
                  }
                },
                "required": []
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /custom-models · 列出自定义模型

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CustomModel"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_custom_models",
  "summary": "列出自定义模型",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CustomModel"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /custom-models/{id} · 读取草稿和发布版本

参数:id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/CustomModel"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "id": "support",
    "revision": 1,
    "config": {
      "name": "售后客服",
      "base_model": "latentx-realtime-2.5-mini",
      "voice": "female-default",
      "instructions": "回答售后问题,必要时搜索知识。",
      "asr_language": "auto",
      "skills": [],
      "knowledge_refs": [],
      "mcp_refs": [],
      "tools": []
    },
    "versions": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_custom_models_id",
  "summary": "读取草稿和发布版本",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/CustomModel"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
PUT /custom-models/{id} · 创建或完整更新草稿

id限1–24位字母数字及_.-,首位字母或数字。revision冲突409。草稿更新不影响已发布版本。保存草稿不检查 Skill 引用;config.skills 含内联 markdown 时在校验步骤返回400。

参数:id (path)

请求体

DraftWrite
{
  "revision": 0,
  "config": {
    "name": "售后客服",
    "base_model": "latentx-realtime-2.5-mini",
    "voice": "female-default",
    "instructions": "回答售后问题,必要时搜索知识。",
    "asr_language": "auto",
    "skills": [],
    "knowledge_refs": [],
    "mcp_refs": [],
    "tools": []
  }
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/CustomModel"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "id": "support",
    "revision": 1,
    "config": {
      "name": "售后客服",
      "base_model": "latentx-realtime-2.5-mini",
      "voice": "female-default",
      "instructions": "回答售后问题,必要时搜索知识。",
      "asr_language": "auto",
      "skills": [],
      "knowledge_refs": [],
      "mcp_refs": [],
      "tools": []
    },
    "versions": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "put_custom_models_id",
  "summary": "创建或完整更新草稿",
  "description": "id限1–24位字母数字及_.-,首位字母或数字。revision冲突409。草稿更新不影响已发布版本。保存草稿不检查 Skill 引用;config.skills 含内联 markdown 时在校验步骤返回400。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/CustomModel"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/DraftWrite"
        },
        "example": {
          "revision": 0,
          "config": {
            "name": "售后客服",
            "base_model": "latentx-realtime-2.5-mini",
            "voice": "female-default",
            "instructions": "回答售后问题,必要时搜索知识。",
            "asr_language": "auto",
            "skills": [],
            "knowledge_refs": [],
            "mcp_refs": [],
            "tools": []
          }
        }
      }
    }
  }
}
DELETE /custom-models/{id} · 删除未发布草稿

存在任何发布版本时拒绝删除。

参数:id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "deleted": {
          "type": "boolean"
        }
      },
      "required": []
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "deleted": true
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "delete_custom_models_id",
  "summary": "删除未发布草稿",
  "description": "存在任何发布版本时拒绝删除。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "object",
                "properties": {
                  "deleted": {
                    "type": "boolean"
                  }
                },
                "required": []
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
POST /custom-models/{id}/validate · 校验草稿

检查配置、资源归属、MCP连通和工具兼容。失败为非2xx;客户可修正的错误带 code 和对应说明,例如 skill_inline_not_allowed(config.skills 内联了 markdown,应先保存 Skill 版本再引用)、skill_version_not_found、knowledge_version_not_found、voice_unavailable。没有 code 时,依次检查 Skill 引用、资源版本、语言和音色。

参数:id (path)

请求体

Revision
{
  "revision": 1
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "valid": {
          "type": "boolean"
        },
        "price": {
          "$ref": "#/$defs/VoicePrice"
        }
      },
      "required": []
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "valid": true,
    "price": {
      "currency": "CNY",
      "text_input": 1,
      "text_output": 1,
      "audio_input": 1,
      "audio_output": 1
    }
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "post_custom_models_id_validate",
  "summary": "校验草稿",
  "description": "检查配置、资源归属、MCP连通和工具兼容。失败为非2xx;客户可修正的错误带 code 和对应说明,例如 skill_inline_not_allowed(config.skills 内联了 markdown,应先保存 Skill 版本再引用)、skill_version_not_found、knowledge_version_not_found、voice_unavailable。没有 code 时,依次检查 Skill 引用、资源版本、语言和音色。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "object",
                "properties": {
                  "valid": {
                    "type": "boolean"
                  },
                  "price": {
                    "$ref": "#/components/schemas/VoicePrice"
                  }
                },
                "required": []
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Revision"
        },
        "example": {
          "revision": 1
        }
      }
    }
  }
}
POST /custom-models/{id}/publish · 发布不可变版本

返回versions[].model;必须使用实际返回值。发布会增加revision,最多50版本。

参数:id (path)

请求体

Revision
{
  "revision": 1
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/CustomModel"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "id": "support",
    "revision": 2,
    "config": {
      "name": "售后客服",
      "base_model": "latentx-realtime-2.5-mini",
      "voice": "female-default",
      "instructions": "回答售后问题,必要时搜索知识。",
      "asr_language": "auto",
      "skills": [],
      "knowledge_refs": [],
      "mcp_refs": [],
      "tools": []
    },
    "versions": [
      {
        "model": "custom-example-support-v1",
        "version": 1,
        "enabled": true,
        "published_at": "2026-11-17T06:00:00Z",
        "config": {
          "name": "售后客服",
          "base_model": "latentx-realtime-2.5-mini",
          "voice": "female-default",
          "instructions": "回答售后问题,必要时搜索知识。",
          "asr_language": "auto",
          "skills": [],
          "knowledge_refs": [],
          "mcp_refs": [],
          "tools": []
        }
      }
    ]
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "post_custom_models_id_publish",
  "summary": "发布不可变版本",
  "description": "返回versions[].model;必须使用实际返回值。发布会增加revision,最多50版本。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/CustomModel"
              }
            },
            "required": [
              "success",
              "data"
            ]
          },
          "example": {
            "success": true,
            "data": {
              "id": "support",
              "revision": 2,
              "config": {
                "name": "售后客服",
                "base_model": "latentx-realtime-2.5-mini",
                "voice": "female-default",
                "instructions": "回答售后问题,必要时搜索知识。",
                "asr_language": "auto",
                "skills": [],
                "knowledge_refs": [],
                "mcp_refs": [],
                "tools": []
              },
              "versions": [
                {
                  "model": "custom-example-support-v1",
                  "version": 1,
                  "enabled": true,
                  "published_at": "2026-11-17T06:00:00Z",
                  "config": {
                    "name": "售后客服",
                    "base_model": "latentx-realtime-2.5-mini",
                    "voice": "female-default",
                    "instructions": "回答售后问题,必要时搜索知识。",
                    "asr_language": "auto",
                    "skills": [],
                    "knowledge_refs": [],
                    "mcp_refs": [],
                    "tools": []
                  }
                }
              ]
            }
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Revision"
        },
        "example": {
          "revision": 1
        }
      }
    }
  }
}
DELETE /custom-models/{id}/versions/{version} · 停用发布版本

停止新调用;不是删除版本内容。

参数:id (path), version (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/CustomModel"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "id": "support",
    "revision": 3,
    "config": {
      "name": "售后客服",
      "base_model": "latentx-realtime-2.5-mini",
      "voice": "female-default",
      "instructions": "回答售后问题,必要时搜索知识。",
      "asr_language": "auto",
      "skills": [],
      "knowledge_refs": [],
      "mcp_refs": [],
      "tools": []
    },
    "versions": [
      {
        "model": "custom-example-support-v1",
        "version": 1,
        "enabled": false,
        "published_at": "2026-11-17T06:00:00Z",
        "config": {
          "name": "售后客服",
          "base_model": "latentx-realtime-2.5-mini",
          "voice": "female-default",
          "instructions": "回答售后问题,必要时搜索知识。",
          "asr_language": "auto",
          "skills": [],
          "knowledge_refs": [],
          "mcp_refs": [],
          "tools": []
        }
      }
    ]
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "delete_custom_models_id_versions_version",
  "summary": "停用发布版本",
  "description": "停止新调用;不是删除版本内容。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/CustomModel"
              }
            },
            "required": [
              "success",
              "data"
            ]
          },
          "example": {
            "success": true,
            "data": {
              "id": "support",
              "revision": 3,
              "config": {
                "name": "售后客服",
                "base_model": "latentx-realtime-2.5-mini",
                "voice": "female-default",
                "instructions": "回答售后问题,必要时搜索知识。",
                "asr_language": "auto",
                "skills": [],
                "knowledge_refs": [],
                "mcp_refs": [],
                "tools": []
              },
              "versions": [
                {
                  "model": "custom-example-support-v1",
                  "version": 1,
                  "enabled": false,
                  "published_at": "2026-11-17T06:00:00Z",
                  "config": {
                    "name": "售后客服",
                    "base_model": "latentx-realtime-2.5-mini",
                    "voice": "female-default",
                    "instructions": "回答售后问题,必要时搜索知识。",
                    "asr_language": "auto",
                    "skills": [],
                    "knowledge_refs": [],
                    "mcp_refs": [],
                    "tools": []
                  }
                }
              ]
            }
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /skills · 列出流程Skill版本

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Bundle"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_skills",
  "summary": "列出流程Skill版本",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Bundle"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /skills/{id}/versions/{version} · 读取流程Skill完整正文与资源

参数:id (path), version (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Bundle"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "id": "support",
    "version": "v1",
    "kind": "example",
    "sha256": "example",
    "markdown": "---\nname: support\ndescription: 示例知识\n---\n以订单约定为准。",
    "resources": {},
    "required_tools": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_skills_id_versions_version",
  "summary": "读取流程Skill完整正文与资源",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Bundle"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
PUT /skills/{id}/versions/{version} · 创建流程Skill不可变版本

id/version限1–64位字母数字及_.-。正文变化需新版本;相同版本内容冲突409。

参数:id (path), version (path)

请求体

BundleWrite
{
  "markdown": "---\nname: support\ndescription: 售后说明\n---\n## 退货期限\n问:多久可以退货?\n答:签收后7天内可申请,具体以订单约定为准。",
  "resources": {}
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Bundle"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "id": "support",
    "version": "v1",
    "kind": "example",
    "sha256": "example",
    "markdown": "---\nname: support\ndescription: 示例知识\n---\n以订单约定为准。",
    "resources": {},
    "required_tools": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "put_skills_id_versions_version",
  "summary": "创建流程Skill不可变版本",
  "description": "id/version限1–64位字母数字及_.-。正文变化需新版本;相同版本内容冲突409。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Bundle"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/BundleWrite"
        },
        "example": {
          "markdown": "---\nname: support\ndescription: 售后说明\n---\n## 退货期限\n问:多久可以退货?\n答:签收后7天内可申请,具体以订单约定为准。",
          "resources": {}
        }
      }
    }
  }
}
GET /knowledge · 列出知识版本

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Bundle"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_knowledge",
  "summary": "列出知识版本",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Bundle"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /knowledge/{id}/versions/{version} · 读取知识完整正文与资源

参数:id (path), version (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Bundle"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "id": "support",
    "version": "v1",
    "kind": "example",
    "sha256": "example",
    "markdown": "---\nname: support\ndescription: 示例知识\n---\n以订单约定为准。",
    "resources": {},
    "required_tools": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_knowledge_id_versions_version",
  "summary": "读取知识完整正文与资源",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Bundle"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
PUT /knowledge/{id}/versions/{version} · 创建知识不可变版本

id/version限1–64位字母数字及_.-。正文变化需新版本;相同版本内容冲突409。

参数:id (path), version (path)

请求体

BundleWrite
{
  "markdown": "---\nname: support\ndescription: 售后说明\n---\n## 退货期限\n问:多久可以退货?\n答:签收后7天内可申请,具体以订单约定为准。",
  "resources": {}
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Bundle"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "id": "support",
    "version": "v1",
    "kind": "example",
    "sha256": "example",
    "markdown": "---\nname: support\ndescription: 示例知识\n---\n以订单约定为准。",
    "resources": {},
    "required_tools": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "put_knowledge_id_versions_version",
  "summary": "创建知识不可变版本",
  "description": "id/version限1–64位字母数字及_.-。正文变化需新版本;相同版本内容冲突409。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Bundle"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/BundleWrite"
        },
        "example": {
          "markdown": "---\nname: support\ndescription: 售后说明\n---\n## 退货期限\n问:多久可以退货?\n答:签收后7天内可申请,具体以订单约定为准。",
          "resources": {}
        }
      }
    }
  }
}
GET /mcp · 列出MCP资源

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MCPResource"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_mcp",
  "summary": "列出MCP资源",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MCPResource"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
POST /mcp · 注册MCP资源

请求体

object
{
  "mcp_id": "orders",
  "name": "订单查询",
  "url": "https://example.com/mcp",
  "tools": [
    "lookup_order"
  ],
  "enabled": true
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/MCPResource"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "mcp_id": "example",
    "name": "示例资源",
    "url": "https://example.com/temporary-recording",
    "tools": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "post_mcp",
  "summary": "注册MCP资源",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/MCPResource"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "mcp_id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "description": "公网HTTPS:443 URL。"
            },
            "headers": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "writeOnly": true
            },
            "tools": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "enabled": {
              "type": "boolean"
            }
          },
          "required": [
            "mcp_id",
            "name",
            "url",
            "tools"
          ]
        },
        "example": {
          "mcp_id": "orders",
          "name": "订单查询",
          "url": "https://example.com/mcp",
          "tools": [
            "lookup_order"
          ],
          "enabled": true
        }
      }
    }
  }
}
GET /mcp/{id} · 读取MCP元数据

参数:id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/MCPResource"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "mcp_id": "example",
    "name": "示例资源",
    "url": "https://example.com/temporary-recording",
    "tools": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_mcp_id",
  "summary": "读取MCP元数据",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/MCPResource"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
PUT /mcp/{id} · 完整替换MCP配置

headers不回显,省略不代表保留旧凭据;请安全保留并提交所需headers/tools/enabled。

参数:id (path)

请求体

MCPWrite
{
  "$ref": "#/$defs/MCPWrite"
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/MCPResource"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "mcp_id": "example",
    "name": "示例资源",
    "url": "https://example.com/temporary-recording",
    "tools": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "put_mcp_id",
  "summary": "完整替换MCP配置",
  "description": "headers不回显,省略不代表保留旧凭据;请安全保留并提交所需headers/tools/enabled。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/MCPResource"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MCPWrite"
        }
      }
    }
  }
}
DELETE /mcp/{id} · 删除MCP资源

参数:id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "deleted": {
          "type": "boolean"
        }
      },
      "required": []
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "deleted": true
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "delete_mcp_id",
  "summary": "删除MCP资源",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "object",
                "properties": {
                  "deleted": {
                    "type": "boolean"
                  }
                },
                "required": []
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
POST /webrtc/credentials · 签发单通话网页凭证

从客户后端调用;返回SDK短期凭据、session_id和预占额度。支持MCP需allow_mcp_tools=true;不支持客户执行的Function。

请求体

CredentialRequest
{
  "model": "latentx-realtime-2.5-mini",
  "from": "web-client",
  "greeting": "您好,请问有什么可以帮您?",
  "allow_mcp_tools": false
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Credential"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "ws": "wss://example.com",
    "uri": "sip:caller@example.com",
    "target": "sip:target@example.com",
    "auth_user": "example",
    "password": "TEMPORARY_CREDENTIAL",
    "expires_at": "2026-11-17T06:05:00Z",
    "session_id": "pg-example",
    "caller": "example",
    "reserved_quota": 1
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "post_webrtc_credentials",
  "summary": "签发单通话网页凭证",
  "description": "从客户后端调用;返回SDK短期凭据、session_id和预占额度。支持MCP需allow_mcp_tools=true;不支持客户执行的Function。",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Credential"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CredentialRequest"
        },
        "example": {
          "model": "latentx-realtime-2.5-mini",
          "from": "web-client",
          "greeting": "您好,请问有什么可以帮您?",
          "allow_mcp_tools": false
        }
      }
    }
  }
}
GET /phone-numbers · 列出租户号码

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Phone"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_phone_numbers",
  "summary": "列出租户号码",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Phone"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /phone-numbers/{phone_id} · 读取号码配置

参数:phone_id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Phone"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "phone_id": "example",
    "line_id": "example",
    "number": "example",
    "bound": true,
    "model": "custom-example-support-v1",
    "instructions": "请简短回答。",
    "greeting": "example",
    "voice": "example",
    "silence_duration_ms": 1,
    "idle_timeout_ms": 1,
    "allow_mcp_tools": true,
    "enabled": true,
    "outbound_enabled": true,
    "updated_at": "2026-11-17T06:00:00Z"
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_phone_numbers_phone_id",
  "summary": "读取号码配置",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "phone_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Phone"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
PUT /phone-numbers/{phone_id} · 绑定模型和通话配置

使用列表返回的phone_id,只修改该号码,不影响同线路其他号码。只能配置当前租户已分配号码;不能在此购买或跨租户转移号码。旧line_id仅作为原展示号码的兼容别名,不代表整条线路。

参数:phone_id (path)

请求体

EndpointConfig
{
  "model": "实际发布的模型ID",
  "greeting": "您好,请问有什么可以帮您?",
  "allow_mcp_tools": true,
  "enabled": true
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Phone"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "phone_id": "example",
    "line_id": "example",
    "number": "example",
    "bound": true,
    "model": "custom-example-support-v1",
    "instructions": "请简短回答。",
    "greeting": "example",
    "voice": "example",
    "silence_duration_ms": 1,
    "idle_timeout_ms": 1,
    "allow_mcp_tools": true,
    "enabled": true,
    "outbound_enabled": true,
    "updated_at": "2026-11-17T06:00:00Z"
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "put_phone_numbers_phone_id",
  "summary": "绑定模型和通话配置",
  "description": "使用列表返回的phone_id,只修改该号码,不影响同线路其他号码。只能配置当前租户已分配号码;不能在此购买或跨租户转移号码。旧line_id仅作为原展示号码的兼容别名,不代表整条线路。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "phone_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Phone"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/EndpointConfig"
        },
        "example": {
          "model": "实际发布的模型ID",
          "greeting": "您好,请问有什么可以帮您?",
          "allow_mcp_tools": true,
          "enabled": true
        }
      }
    }
  }
}
DELETE /phone-numbers/{phone_id} · 解绑号码

参数:phone_id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "unbound": {
          "type": "boolean"
        }
      },
      "required": []
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "unbound": true
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "delete_phone_numbers_phone_id",
  "summary": "解绑号码",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "phone_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "object",
                "properties": {
                  "unbound": {
                    "type": "boolean"
                  }
                },
                "required": []
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
POST /calls · 发起单通电话外呼

拨号前校验号码归属、外呼能力、模型权限、账号和API Key余额。不会修改呼入绑定。网络超时或503时,使用同一request_id查询/重试,不能换新ID盲目重拨。尚在preparing的失败请求可能保留短期额度预留,未启动的预留会过期释放。结束通话再次重试仍返回原记录。含外部MCP的模型需allow_mcp_tools=true;不支持客户执行的Function。

请求体

OutboundRequest
{
  "model": "latentx-realtime-2.5-mini",
  "phone_id": "pn-00000000000000000000000000000000",
  "to": "13800000000",
  "request_id": "support-callback-001",
  "greeting": "您好,我是您的业务助手。",
  "ring_timeout": 40
}

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/OutboundCall"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "call_id": "call-example",
    "request_id": "example",
    "model": "custom-example-support-v1",
    "phone_id": "example",
    "from": "example",
    "to": "example",
    "status": "preparing",
    "hangup_reason": "example",
    "created_at": "example",
    "updated_at": "2026-11-17T06:00:00Z",
    "answer_at": "example",
    "end_at": "example"
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "post_calls",
  "summary": "发起单通电话外呼",
  "description": "拨号前校验号码归属、外呼能力、模型权限、账号和API Key余额。不会修改呼入绑定。网络超时或503时,使用同一request_id查询/重试,不能换新ID盲目重拨。尚在preparing的失败请求可能保留短期额度预留,未启动的预留会过期释放。结束通话再次重试仍返回原记录。含外部MCP的模型需allow_mcp_tools=true;不支持客户执行的Function。",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/OutboundCall"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/OutboundRequest"
        },
        "example": {
          "model": "latentx-realtime-2.5-mini",
          "phone_id": "pn-00000000000000000000000000000000",
          "to": "13800000000",
          "request_id": "support-callback-001",
          "greeting": "您好,我是您的业务助手。",
          "ring_timeout": 40
        }
      }
    }
  }
}
GET /calls · 按幂等键查询外呼

request_id必填,只查询本账号。

参数:request_id (query)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/OutboundCall"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "call_id": "call-example",
    "request_id": "example",
    "model": "custom-example-support-v1",
    "phone_id": "example",
    "from": "example",
    "to": "example",
    "status": "preparing",
    "hangup_reason": "example",
    "created_at": "example",
    "updated_at": "2026-11-17T06:00:00Z",
    "answer_at": "example",
    "end_at": "example"
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_calls",
  "summary": "按幂等键查询外呼",
  "description": "request_id必填,只查询本账号。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "request_id",
      "in": "query",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/OutboundCall"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /calls/{call_id} · 查询单通外呼状态

参数:call_id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/OutboundCall"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "call_id": "call-example",
    "request_id": "example",
    "model": "custom-example-support-v1",
    "phone_id": "example",
    "from": "example",
    "to": "example",
    "status": "preparing",
    "hangup_reason": "example",
    "created_at": "example",
    "updated_at": "2026-11-17T06:00:00Z",
    "answer_at": "example",
    "end_at": "example"
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_calls_call_id",
  "summary": "查询单通外呼状态",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "call_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/OutboundCall"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
POST /calls/{call_id}/cancel · 取消拨号或挂断已接通外呼

异步取消,重复调用幂等;随后查询直到ended。已发生用量仍正常结算。

参数:call_id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/OutboundCall"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "call_id": "call-example",
    "request_id": "example",
    "model": "custom-example-support-v1",
    "phone_id": "example",
    "from": "example",
    "to": "example",
    "status": "preparing",
    "hangup_reason": "example",
    "created_at": "example",
    "updated_at": "2026-11-17T06:00:00Z",
    "answer_at": "example",
    "end_at": "example"
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "post_calls_call_id_cancel",
  "summary": "取消拨号或挂断已接通外呼",
  "description": "异步取消,重复调用幂等;随后查询直到ended。已发生用量仍正常结算。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "call_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/OutboundCall"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /conversations · 查询通话列表

合并网页、电话及Realtime会话。默认limit=50,最大500;from/to为RFC3339;origin可选realtime/web/external。下一页传最后一项的cursor,直到返回空数组;无total。

参数:limit (query), from (query), to (query), origin (query), cursor (query)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Conversation"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_conversations",
  "summary": "查询通话列表",
  "description": "合并网页、电话及Realtime会话。默认limit=50,最大500;from/to为RFC3339;origin可选realtime/web/external。下一页传最后一项的cursor,直到返回空数组;无total。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "minimum": 1,
        "maximum": 500
      }
    },
    {
      "name": "from",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "to",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "origin",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /conversations/{call_id} · 读取通话详情、转写与录音

参数:call_id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/Conversation"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "call_id": "call-example",
    "direction": "example",
    "caller": "example",
    "callee": "example",
    "origin": "example",
    "start_at": "example",
    "answer_at": "example",
    "end_at": "example",
    "hangup_by": "example",
    "hangup_reason": "example",
    "transcript": [],
    "recording": {
      "state": "unavailable",
      "url": "https://example.com/temporary-recording",
      "expires_at": "2026-11-17T06:05:00Z"
    },
    "session_id": "pg-example",
    "model": "custom-example-support-v1",
    "status": "completed",
    "cursor": "example",
    "items": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_conversations_call_id",
  "summary": "读取通话详情、转写与录音",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "call_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/Conversation"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /conversations/{call_id}/events · 分页查询会话事件

统一查询电话、网页和Realtime事件。新会话默认记录,旧会话仅返回已有内容。完整Realtime历史的data与实时服务端事件具有相同ID、类型和内容,音频Base64分片除外;发送记录不代表客户端收到或已播放。电话和网页保留原生语义。limit默认100、最大200;原样传递不透明next_cursor,空items但有游标时继续。complete=完整采集,collecting=采集中,partial=部分丢失,legacy=旧记录,unavailable=未采集,expired=已过期。各来源内部顺序稳定,跨页不承诺跨来源全局时钟顺序。活跃会话完成后从首页刷新。transcription 模式的历史转写用量位于 items[].data.usage;与实时事件按 event_id 对应,不能重复累计。序号间隙不代表丢失。

参数:call_id (path), limit (query), cursor (query)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ConversationEvent"
          }
        },
        "next_cursor": {
          "type": "string"
        },
        "mapping_version": {
          "type": "integer"
        },
        "capture_state": {
          "enum": [
            "complete",
            "collecting",
            "partial",
            "legacy",
            "unavailable",
            "expired",
            "unsupported_mapping"
          ]
        }
      },
      "required": []
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "items": [],
    "next_cursor": "example",
    "mapping_version": 1,
    "capture_state": "complete"
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_conversations_call_id_events",
  "summary": "分页查询会话事件",
  "description": "统一查询电话、网页和Realtime事件。新会话默认记录,旧会话仅返回已有内容。完整Realtime历史的data与实时服务端事件具有相同ID、类型和内容,音频Base64分片除外;发送记录不代表客户端收到或已播放。电话和网页保留原生语义。limit默认100、最大200;原样传递不透明next_cursor,空items但有游标时继续。complete=完整采集,collecting=采集中,partial=部分丢失,legacy=旧记录,unavailable=未采集,expired=已过期。各来源内部顺序稳定,跨页不承诺跨来源全局时钟顺序。活跃会话完成后从首页刷新。transcription 模式的历史转写用量位于 items[].data.usage;与实时事件按 event_id 对应,不能重复累计。序号间隙不代表丢失。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "call_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "minimum": 1,
        "maximum": 200
      }
    },
    {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ConversationEvent"
                    }
                  },
                  "next_cursor": {
                    "type": "string"
                  },
                  "mapping_version": {
                    "type": "integer"
                  },
                  "capture_state": {
                    "enum": [
                      "complete",
                      "collecting",
                      "partial",
                      "legacy",
                      "unavailable",
                      "expired",
                      "unsupported_mapping"
                    ]
                  }
                },
                "required": []
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /conversations/{call_id}/recordings · 查询录音轨道

按账号开通情况返回录音分段。电话和网页优先从详情 recording 获取整通录音,也可有分段。Realtime 的详情没有整通文件时,仍可有分段。streams[].state、tracks[].state 和整通录音状态分别判断;partial 不代表已有文件都不可用。链接过期重新查询。音频按buffer或item关联,不承诺逐音频事件或逐字重放。

参数:call_id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "streams": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CaptureStream"
          }
        }
      },
      "required": []
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "streams": []
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_conversations_call_id_recordings",
  "summary": "查询录音轨道",
  "description": "按账号开通情况返回录音分段。电话和网页优先从详情 recording 获取整通录音,也可有分段。Realtime 的详情没有整通文件时,仍可有分段。streams[].state、tracks[].state 和整通录音状态分别判断;partial 不代表已有文件都不可用。链接过期重新查询。音频按buffer或item关联,不承诺逐音频事件或逐字重放。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "call_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "object",
                "properties": {
                  "streams": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/CaptureStream"
                    }
                  }
                },
                "required": []
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /logs · 查询管理操作日志

默认limit=100;不包含请求体和凭据。

参数:limit (query)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Audit"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_logs",
  "summary": "查询管理操作日志",
  "description": "默认limit=100;不包含请求体和凭据。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "minimum": 1,
        "maximum": 500
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Audit"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /usage · 查询Realtime响应用量

默认limit=100;用量审计,不是最终钱包扣费金额。

参数:limit (query)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UsageRecord"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_usage",
  "summary": "查询Realtime响应用量",
  "description": "默认limit=100;用量审计,不是最终钱包扣费金额。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "minimum": 1,
        "maximum": 500
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UsageRecord"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /playground/sessions · 查询网页计费会话

最新50条;当前无分页参数。

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BillingSession"
      }
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": []
}

完整 OpenAPI 接口定义

{
  "operationId": "get_playground_sessions",
  "summary": "查询网页计费会话",
  "description": "最新50条;当前无分页参数。",
  "tags": [
    "租户管理"
  ],
  "parameters": [],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BillingSession"
                }
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
GET /playground/sessions/{session_id} · 查询单通网页计费状态

参数:session_id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "$ref": "#/$defs/BillingSession"
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "session_id": "pg-example",
    "model": "custom-example-support-v1",
    "source": "example",
    "call_id": "call-example",
    "status": "completed",
    "created_at": 1,
    "updated_at": 1,
    "expires_at": 1,
    "deadline": 1,
    "text_input": 1,
    "text_output": 1,
    "audio_input": 1,
    "audio_output": 1,
    "quota": 1,
    "reserved_quota": 1
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "get_playground_sessions_session_id",
  "summary": "查询单通网页计费状态",
  "description": "",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "session_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "$ref": "#/components/schemas/BillingSession"
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}
DELETE /playground/sessions/{session_id} · 请求停止网页通话

异步停止请求;需继续查询最终状态。

参数:session_id (path)

成功响应结构

{
  "type": "object",
  "properties": {
    "success": {
      "const": true
    },
    "data": {
      "type": "object",
      "properties": {
        "status": {
          "const": "stopping"
        }
      },
      "required": []
    }
  },
  "required": [
    "success",
    "data"
  ]
}

成功响应示例(虚构数据)

{
  "success": true,
  "data": {
    "status": "stopping"
  }
}

完整 OpenAPI 接口定义

{
  "operationId": "delete_playground_sessions_session_id",
  "summary": "请求停止网页通话",
  "description": "异步停止请求;需继续查询最终状态。",
  "tags": [
    "租户管理"
  ],
  "parameters": [
    {
      "name": "session_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "成功",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "const": true
              },
              "data": {
                "type": "object",
                "properties": {
                  "status": {
                    "const": "stopping"
                  }
                },
                "required": []
              }
            },
            "required": [
              "success",
              "data"
            ]
          }
        }
      }
    },
    "default": {
      "description": "非2xx失败;可能为JSON、纯文本或空响应。先判断HTTP状态。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean"
              },
              "message": {
                "type": "string"
              }
            },
            "required": []
          }
        },
        "text/plain": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  }
}

完整对象字段

KnowledgeRef

字段类型必填约束与说明
idstring是
versionstring是

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "version": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "version"
  ],
  "additionalProperties": false
}
Skill

字段类型必填约束与说明
idstring是
versionstring是
preloadboolean否true 全量预加载;false 仅描述,按需读取。 default=false
markdownstring否内联正文,仅用于 Realtime session.latentx.skills。自定义模型 config.skills 只接受已保存版本引用 {id,version,preload}:先 PUT /voice/v1/skills/{id}/versions/{version},再引用;带 markdown、resources 或 required_tools 时校验返回400。
resourcesobject否
required_toolsarray否

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "preload": {
      "type": "boolean",
      "default": false,
      "description": "true 全量预加载;false 仅描述,按需读取。"
    },
    "markdown": {
      "type": "string",
      "description": "内联正文,仅用于 Realtime session.latentx.skills。自定义模型 config.skills 只接受已保存版本引用 {id,version,preload}:先 PUT /voice/v1/skills/{id}/versions/{version},再引用;带 markdown、resources 或 required_tools 时校验返回400。"
    },
    "resources": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "required_tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "id",
    "version"
  ],
  "additionalProperties": false
}
FunctionTool

字段类型必填约束与说明
typeconst是 const="function"
namestring是
descriptionstring否
parametersobject是工具参数的 JSON Schema;由客户执行前再次校验。

完整 Schema

{
  "type": "object",
  "properties": {
    "type": {
      "const": "function"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "parameters": {
      "type": "object",
      "description": "工具参数的 JSON Schema;由客户执行前再次校验。"
    }
  },
  "required": [
    "type",
    "name",
    "parameters"
  ],
  "additionalProperties": false
}
Usage

字段类型必填约束与说明
total_tokensinteger是
input_tokensinteger是
output_tokensinteger是
input_token_detailsobject是
output_token_detailsobject是

完整 Schema

{
  "type": "object",
  "properties": {
    "total_tokens": {
      "type": "integer"
    },
    "input_tokens": {
      "type": "integer"
    },
    "output_tokens": {
      "type": "integer"
    },
    "input_token_details": {
      "type": "object",
      "properties": {
        "text_tokens": {
          "type": "integer"
        },
        "audio_tokens": {
          "type": "integer"
        },
        "cached_tokens": {
          "type": "integer"
        },
        "cached_tokens_details": {
          "type": "object",
          "properties": {
            "text_tokens": {
              "type": "integer"
            },
            "audio_tokens": {
              "type": "integer"
            }
          },
          "required": []
        }
      },
      "required": []
    },
    "output_token_details": {
      "type": "object",
      "properties": {
        "text_tokens": {
          "type": "integer"
        },
        "audio_tokens": {
          "type": "integer"
        }
      },
      "required": []
    }
  },
  "required": [
    "total_tokens",
    "input_tokens",
    "output_tokens",
    "input_token_details",
    "output_token_details"
  ]
}
CustomConfig

字段类型必填约束与说明
namestring是必填,1–200字符。
instructionsstring否最多64KiB。
base_modelstring是从 catalog.voice_models 选择公开语音型号;无需传组件字段。
asr_languagestring否从 catalog.voice_models 对应型号的 input_languages 选择;空值使用模型默认。
tts_languagestring否从 catalog.voice_models 对应型号的 output_languages 选择;空值使用模型默认。
voicestring否
temperaturenumber否
max_tokensinteger否
silence_duration_msinteger否0 为默认;显式值200–2000ms。
skillsarray否固定版本引用 {id,version,preload},Skill 须先通过 PUT /voice/v1/skills/{id}/versions/{version} 保存;不接受内联 markdown、resources、required_tools。 items: Skill
knowledge_refsarray否 items: KnowledgeRef
mcp_refsarray否
toolsarray否 items: FunctionTool

完整 Schema

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "必填,1–200字符。",
      "minLength": 1,
      "maxLength": 200
    },
    "instructions": {
      "type": "string",
      "description": "最多64KiB。"
    },
    "base_model": {
      "type": "string",
      "description": "从 catalog.voice_models 选择公开语音型号;无需传组件字段。"
    },
    "asr_language": {
      "type": "string",
      "description": "从 catalog.voice_models 对应型号的 input_languages 选择;空值使用模型默认。"
    },
    "tts_language": {
      "type": "string",
      "description": "从 catalog.voice_models 对应型号的 output_languages 选择;空值使用模型默认。"
    },
    "voice": {
      "type": "string"
    },
    "temperature": {
      "type": "number"
    },
    "max_tokens": {
      "type": "integer"
    },
    "silence_duration_ms": {
      "type": "integer",
      "description": "0 为默认;显式值200–2000ms。"
    },
    "skills": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Skill"
      },
      "description": "固定版本引用 {id,version,preload},Skill 须先通过 PUT /voice/v1/skills/{id}/versions/{version} 保存;不接受内联 markdown、resources、required_tools。"
    },
    "knowledge_refs": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/KnowledgeRef"
      }
    },
    "mcp_refs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/FunctionTool"
      }
    }
  },
  "required": [
    "name",
    "base_model"
  ]
}
CustomConfigRead

字段类型必填约束与说明
namestring是必填,1–200字符。
instructionsstring否最多64KiB。
base_modelstring是从 catalog.voice_models 选择公开语音型号;无需传组件字段。
asr_languagestring否从 catalog.voice_models 对应型号的 input_languages 选择;空值使用模型默认。
tts_languagestring否从 catalog.voice_models 对应型号的 output_languages 选择;空值使用模型默认。
voicestring否
temperaturenumber否
max_tokensinteger否
silence_duration_msinteger否0 为默认;显式值200–2000ms。
skillsarray否固定版本引用 {id,version,preload},Skill 须先通过 PUT /voice/v1/skills/{id}/versions/{version} 保存;不接受内联 markdown、resources、required_tools。 items: Skill
knowledge_refs['array', 'null']否未挂载时部分保存版本返回null;写入建议使用[]。 items: KnowledgeRef
mcp_refsarray否
toolsarray否 items: FunctionTool

完整 Schema

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "必填,1–200字符。",
      "minLength": 1,
      "maxLength": 200
    },
    "instructions": {
      "type": "string",
      "description": "最多64KiB。"
    },
    "base_model": {
      "type": "string",
      "description": "从 catalog.voice_models 选择公开语音型号;无需传组件字段。"
    },
    "asr_language": {
      "type": "string",
      "description": "从 catalog.voice_models 对应型号的 input_languages 选择;空值使用模型默认。"
    },
    "tts_language": {
      "type": "string",
      "description": "从 catalog.voice_models 对应型号的 output_languages 选择;空值使用模型默认。"
    },
    "voice": {
      "type": "string"
    },
    "temperature": {
      "type": "number"
    },
    "max_tokens": {
      "type": "integer"
    },
    "silence_duration_ms": {
      "type": "integer",
      "description": "0 为默认;显式值200–2000ms。"
    },
    "skills": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Skill"
      },
      "description": "固定版本引用 {id,version,preload},Skill 须先通过 PUT /voice/v1/skills/{id}/versions/{version} 保存;不接受内联 markdown、resources、required_tools。"
    },
    "knowledge_refs": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/components/schemas/KnowledgeRef"
      },
      "description": "未挂载时部分保存版本返回null;写入建议使用[]。"
    },
    "mcp_refs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tools": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/FunctionTool"
      }
    }
  },
  "required": [
    "name",
    "base_model"
  ]
}
VoicePrice

每百万计费token的公开基础价格。

字段类型必填约束与说明
currencystring否
text_inputnumber否
text_outputnumber否
audio_inputnumber否
audio_outputnumber否

完整 Schema

{
  "type": "object",
  "properties": {
    "currency": {
      "type": "string"
    },
    "text_input": {
      "type": "number"
    },
    "text_output": {
      "type": "number"
    },
    "audio_input": {
      "type": "number"
    },
    "audio_output": {
      "type": "number"
    }
  },
  "required": [],
  "description": "每百万计费token的公开基础价格。"
}
CustomVersion

字段类型必填约束与说明
modelstring否
versioninteger否
enabledboolean否
published_atstring否
priceVoicePrice否
configCustomConfigRead否

完整 Schema

{
  "type": "object",
  "properties": {
    "model": {
      "type": "string"
    },
    "version": {
      "type": "integer"
    },
    "enabled": {
      "type": "boolean"
    },
    "published_at": {
      "type": "string",
      "description": "",
      "format": "date-time"
    },
    "price": {
      "$ref": "#/components/schemas/VoicePrice"
    },
    "config": {
      "$ref": "#/components/schemas/CustomConfigRead"
    }
  },
  "required": []
}
CustomModel

字段类型必填约束与说明
idstring是
revisioninteger是
configCustomConfigRead是
versionsarray是 items: CustomVersion

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "revision": {
      "type": "integer"
    },
    "config": {
      "$ref": "#/components/schemas/CustomConfigRead"
    },
    "versions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/CustomVersion"
      }
    }
  },
  "required": [
    "id",
    "revision",
    "config",
    "versions"
  ]
}
DraftWrite

字段类型必填约束与说明
revisioninteger是新建为0,更新使用最新读取的revision;完整替换config。 minimum=0
configCustomConfig是

完整 Schema

{
  "type": "object",
  "properties": {
    "revision": {
      "type": "integer",
      "minimum": 0,
      "description": "新建为0,更新使用最新读取的revision;完整替换config。"
    },
    "config": {
      "$ref": "#/components/schemas/CustomConfig"
    }
  },
  "required": [
    "revision",
    "config"
  ]
}
Revision

字段类型必填约束与说明
revisioninteger是

完整 Schema

{
  "type": "object",
  "properties": {
    "revision": {
      "type": "integer"
    }
  },
  "required": [
    "revision"
  ]
}
BundleWrite

字段类型必填约束与说明
markdownstring是Markdown正文,包含name/description元信息;知识可用结构化QA或原文。
resourcesobject否
required_toolsarray否

完整 Schema

{
  "type": "object",
  "properties": {
    "markdown": {
      "type": "string",
      "description": "Markdown正文,包含name/description元信息;知识可用结构化QA或原文。"
    },
    "resources": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "required_tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "markdown"
  ]
}
Bundle

字段类型必填约束与说明
idstring是
versionstring是
kindstring否
sha256string是
markdownstring是Markdown正文,包含name/description元信息;知识可用结构化QA或原文。
resourcesobject否
required_toolsarray否

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "sha256": {
      "type": "string"
    },
    "markdown": {
      "type": "string",
      "description": "Markdown正文,包含name/description元信息;知识可用结构化QA或原文。"
    },
    "resources": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "required_tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "id",
    "version",
    "markdown",
    "sha256"
  ]
}
MCPWrite

字段类型必填约束与说明
mcp_idstring否
namestring是
urlstring是公网HTTPS:443 URL。
headersobject否
toolsarray是
enabledboolean否

完整 Schema

{
  "type": "object",
  "properties": {
    "mcp_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "description": "公网HTTPS:443 URL。"
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "writeOnly": true
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "enabled": {
      "type": "boolean"
    }
  },
  "required": [
    "name",
    "url",
    "tools"
  ]
}
MCPResource

不回显headers,当前也不回显enabled;更新时需自行保留所需写入配置。

字段类型必填约束与说明
mcp_idstring否
namestring否
urlstring否
toolsarray否

完整 Schema

{
  "type": "object",
  "properties": {
    "mcp_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [],
  "description": "不回显headers,当前也不回显enabled;更新时需自行保留所需写入配置。"
}
EndpointConfig

字段类型必填约束与说明
modelstring是
instructionsstring否省略继承模型提示词,空字符串清空。
greetingstring否开场白,最多2000字符。
voicestring否
asr_languagestring否
tts_languagestring否
silence_duration_msinteger否
idle_timeout_msinteger否0继承,显式值3000–60000ms;与ASR断句不同。
allow_mcp_toolsboolean否 default=false
enabledboolean否

完整 Schema

{
  "type": "object",
  "properties": {
    "model": {
      "type": "string"
    },
    "instructions": {
      "type": "string",
      "description": "省略继承模型提示词,空字符串清空。"
    },
    "greeting": {
      "type": "string",
      "description": "开场白,最多2000字符。",
      "maxLength": 2000
    },
    "voice": {
      "type": "string"
    },
    "asr_language": {
      "type": "string"
    },
    "tts_language": {
      "type": "string"
    },
    "silence_duration_ms": {
      "type": "integer"
    },
    "idle_timeout_ms": {
      "type": "integer",
      "description": "0继承,显式值3000–60000ms;与ASR断句不同。"
    },
    "allow_mcp_tools": {
      "type": "boolean",
      "default": false
    },
    "enabled": {
      "type": "boolean"
    }
  },
  "required": [
    "model"
  ]
}
CredentialRequest

字段类型必填约束与说明
modelstring是
instructionsstring否省略继承模型提示词,空字符串清空。
greetingstring否开场白,最多2000字符。
voicestring否
asr_languagestring否
tts_languagestring否
silence_duration_msinteger否
idle_timeout_msinteger否0继承,显式值3000–60000ms;与ASR断句不同。
allow_mcp_toolsboolean否 default=false
enabledboolean否
fromstring否客户端标签;平台为计费分配实际caller。

完整 Schema

{
  "type": "object",
  "properties": {
    "model": {
      "type": "string"
    },
    "instructions": {
      "type": "string",
      "description": "省略继承模型提示词,空字符串清空。"
    },
    "greeting": {
      "type": "string",
      "description": "开场白,最多2000字符。",
      "maxLength": 2000
    },
    "voice": {
      "type": "string"
    },
    "asr_language": {
      "type": "string"
    },
    "tts_language": {
      "type": "string"
    },
    "silence_duration_ms": {
      "type": "integer"
    },
    "idle_timeout_ms": {
      "type": "integer",
      "description": "0继承,显式值3000–60000ms;与ASR断句不同。"
    },
    "allow_mcp_tools": {
      "type": "boolean",
      "default": false
    },
    "enabled": {
      "type": "boolean"
    },
    "from": {
      "type": "string",
      "description": "客户端标签;平台为计费分配实际caller。"
    }
  },
  "required": [
    "model"
  ]
}
Credential

字段类型必填约束与说明
wsstring否
uristring否
targetstring否
auth_userstring否
passwordstring否短期凭据,不记录到日志。
expires_atstring否
session_idstring否
callerstring否
reserved_quotainteger否

完整 Schema

{
  "type": "object",
  "properties": {
    "ws": {
      "type": "string"
    },
    "uri": {
      "type": "string"
    },
    "target": {
      "type": "string"
    },
    "auth_user": {
      "type": "string"
    },
    "password": {
      "type": "string",
      "description": "短期凭据,不记录到日志。"
    },
    "expires_at": {
      "type": "string"
    },
    "session_id": {
      "type": "string"
    },
    "caller": {
      "type": "string"
    },
    "reserved_quota": {
      "type": "integer"
    }
  },
  "required": []
}
Phone

字段类型必填约束与说明
phone_idstring否号码的稳定标识;配置与解绑使用此值。
line_idstring否所属线路标识,同一线路可以有多个号码。
numberstring否
boundboolean否
modelstring否
instructionsstring否
greetingstring否
voicestring否
silence_duration_msinteger否
idle_timeout_msinteger否
allow_mcp_toolsboolean否
enabledboolean否
outbound_enabledboolean否当前号码是否具备外呼能力;独立于enabled呼入接听设置。实际拨号仍需通过模型权限与余额校验。
updated_atstring否

完整 Schema

{
  "type": "object",
  "properties": {
    "phone_id": {
      "type": "string",
      "description": "号码的稳定标识;配置与解绑使用此值。"
    },
    "line_id": {
      "type": "string",
      "description": "所属线路标识,同一线路可以有多个号码。"
    },
    "number": {
      "type": "string"
    },
    "bound": {
      "type": "boolean"
    },
    "model": {
      "type": "string"
    },
    "instructions": {
      "type": "string"
    },
    "greeting": {
      "type": "string"
    },
    "voice": {
      "type": "string"
    },
    "silence_duration_ms": {
      "type": "integer"
    },
    "idle_timeout_ms": {
      "type": "integer"
    },
    "allow_mcp_tools": {
      "type": "boolean"
    },
    "enabled": {
      "type": "boolean"
    },
    "outbound_enabled": {
      "type": "boolean",
      "description": "当前号码是否具备外呼能力;独立于enabled呼入接听设置。实际拨号仍需通过模型权限与余额校验。"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": []
}
OutboundRequest

字段类型必填约束与说明
modelstring是公共预定义模型或已发布自定义模型 ID。
phone_idstring是本账号已分配且具备外呼能力的号码 ID。
tostring是被叫电话号码,3–15 位数字,可有前导 +。
request_idstring是本账号内唯一;相同参数重试返回原通话,不重新拨打;冲突返回409。
greetingstring否开场白,UTF-8 最多2000字节。
contextstring否本通话的业务上下文,UTF-8 最多8000字节。
allow_mcp_toolsboolean否 default=false
ring_timeoutinteger否 default=40 minimum=5 maximum=120

完整 Schema

{
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "description": "公共预定义模型或已发布自定义模型 ID。",
      "maxLength": 128
    },
    "phone_id": {
      "type": "string",
      "description": "本账号已分配且具备外呼能力的号码 ID。"
    },
    "to": {
      "type": "string",
      "description": "被叫电话号码,3–15 位数字,可有前导 +。",
      "pattern": "^\\+?[0-9]{3,15}$"
    },
    "request_id": {
      "type": "string",
      "description": "本账号内唯一;相同参数重试返回原通话,不重新拨打;冲突返回409。",
      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,63}$"
    },
    "greeting": {
      "type": "string",
      "description": "开场白,UTF-8 最多2000字节。"
    },
    "context": {
      "type": "string",
      "description": "本通话的业务上下文,UTF-8 最多8000字节。"
    },
    "allow_mcp_tools": {
      "type": "boolean",
      "default": false
    },
    "ring_timeout": {
      "type": "integer",
      "minimum": 5,
      "maximum": 120,
      "default": 40
    }
  },
  "required": [
    "model",
    "phone_id",
    "to",
    "request_id"
  ],
  "additionalProperties": false
}
OutboundCall

单通外呼记录;不提供任务编排或自动重拨。时间为RFC3339。结束原因是线路返回的粗分类,不保证精确判断被叫状态。

字段类型必填约束与说明
call_idstring否
request_idstring否
modelstring否
phone_idstring否
fromstring否
tostring否
statusenum否 enum=["preparing", "dialing", "answered", "ended"]
hangup_reasonstring否
created_atstring否
updated_atstring否
answer_atstring否
end_atstring否

完整 Schema

{
  "type": "object",
  "properties": {
    "call_id": {
      "type": "string"
    },
    "request_id": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "phone_id": {
      "type": "string"
    },
    "from": {
      "type": "string"
    },
    "to": {
      "type": "string"
    },
    "status": {
      "enum": [
        "preparing",
        "dialing",
        "answered",
        "ended"
      ]
    },
    "hangup_reason": {
      "type": "string"
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "answer_at": {
      "type": "string"
    },
    "end_at": {
      "type": "string"
    }
  },
  "required": [],
  "description": "单通外呼记录;不提供任务编排或自动重拨。时间为RFC3339。结束原因是线路返回的粗分类,不保证精确判断被叫状态。"
}
Conversation

可选时间/转写/录音字段视通话状态返回;录音是临时签名URL。

字段类型必填约束与说明
call_idstring否
directionstring否
callerstring否
calleestring否
originstring否
start_atstring否
answer_at['string', 'null']否
end_at['string', 'null']否
hangup_bystring否
hangup_reasonstring否
transcript['array', 'null']否 items: TranscriptEntry
recordingobject否
session_idstring否
modelstring否
statusstring否
cursorstring否
itemsarray否 items: ConversationItem

完整 Schema

{
  "type": "object",
  "properties": {
    "call_id": {
      "type": "string"
    },
    "direction": {
      "type": "string"
    },
    "caller": {
      "type": "string"
    },
    "callee": {
      "type": "string"
    },
    "origin": {
      "type": "string"
    },
    "start_at": {
      "type": "string"
    },
    "answer_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "end_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "hangup_by": {
      "type": "string"
    },
    "hangup_reason": {
      "type": "string"
    },
    "transcript": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/components/schemas/TranscriptEntry"
      }
    },
    "recording": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "expires_at": {
          "type": "string"
        }
      },
      "required": []
    },
    "session_id": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "cursor": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ConversationItem"
      }
    }
  },
  "required": [],
  "description": "可选时间/转写/录音字段视通话状态返回;录音是临时签名URL。"
}
CaptureTrack

独立单声道 PCM16 WAV 分段,输出仅表示生成,不代表客户端已播放。

字段类型必填约束与说明
idstring否
directionenum否 enum=["input", "output"]
item_idstring否输出 item ID
buffer_idstring否输入录音分段的缓冲标识;不等同于转写 item_id,也不保证逐事件关联。
sample_rateinteger否
bytesinteger否
duration_msinteger否
start_atstring否
stateenum否 enum=["recording", "pending", "uploaded"]
urlstring否授权后签名URL;仅 uploaded 且签名成功时返回。
expires_atstring否

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "direction": {
      "enum": [
        "input",
        "output"
      ]
    },
    "item_id": {
      "type": "string",
      "description": "输出 item ID"
    },
    "buffer_id": {
      "type": "string",
      "description": "输入录音分段的缓冲标识;不等同于转写 item_id,也不保证逐事件关联。"
    },
    "sample_rate": {
      "type": "integer"
    },
    "bytes": {
      "type": "integer"
    },
    "duration_ms": {
      "type": "integer"
    },
    "start_at": {
      "type": "string"
    },
    "state": {
      "enum": [
        "recording",
        "pending",
        "uploaded"
      ]
    },
    "url": {
      "type": "string",
      "description": "授权后签名URL;仅 uploaded 且签名成功时返回。"
    },
    "expires_at": {
      "type": "string"
    }
  },
  "required": [],
  "description": "独立单声道 PCM16 WAV 分段,输出仅表示生成,不代表客户端已播放。"
}
CaptureStream

来源内顺序;不同来源不保证全序。complete 指本版本采集范围正常封存,录音上传状态另看 tracks。

字段类型必填约束与说明
idstring否
session_idstring否
sourcestring否
originstring否
stateenum否 enum=["collecting", "complete", "partial", "finalizing", "expired"]
reasonstring否
started_atstring否
updated_atstring否
endedboolean否
audio_enabledboolean否
retain_untilstring否
tracksarray否 items: CaptureTrack

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "session_id": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "origin": {
      "type": "string"
    },
    "state": {
      "enum": [
        "collecting",
        "complete",
        "partial",
        "finalizing",
        "expired"
      ]
    },
    "reason": {
      "type": "string"
    },
    "started_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    },
    "ended": {
      "type": "boolean"
    },
    "audio_enabled": {
      "type": "boolean"
    },
    "retain_until": {
      "type": "string"
    },
    "tracks": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/CaptureTrack"
      }
    }
  },
  "required": [],
  "description": "来源内顺序;不同来源不保证全序。complete 指本版本采集范围正常封存,录音上传状态另看 tracks。"
}
BillingSession

时间为Unix秒;quota为平台额度单位,不直接等于人民币。停止请求返回不代表结算完成。

字段类型必填约束与说明
session_idstring否
modelstring否
sourcestring否
call_idstring否
statusstring否
created_atinteger否
updated_atinteger否
expires_atinteger否
deadlineinteger否
text_inputinteger否
text_outputinteger否
audio_inputinteger否
audio_outputinteger否
quotainteger否
reserved_quotainteger否

完整 Schema

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "source": {
      "type": "string"
    },
    "call_id": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "created_at": {
      "type": "integer"
    },
    "updated_at": {
      "type": "integer"
    },
    "expires_at": {
      "type": "integer"
    },
    "deadline": {
      "type": "integer"
    },
    "text_input": {
      "type": "integer"
    },
    "text_output": {
      "type": "integer"
    },
    "audio_input": {
      "type": "integer"
    },
    "audio_output": {
      "type": "integer"
    },
    "quota": {
      "type": "integer"
    },
    "reserved_quota": {
      "type": "integer"
    }
  },
  "required": [],
  "description": "时间为Unix秒;quota为平台额度单位,不直接等于人民币。停止请求返回不代表结算完成。"
}
Audit

字段类型必填约束与说明
request_idstring否
key_idstring否
methodstring否
pathstring否
statusinteger否
latency_msinteger否
atstring否

完整 Schema

{
  "type": "object",
  "properties": {
    "request_id": {
      "type": "string"
    },
    "key_id": {
      "type": "string"
    },
    "method": {
      "type": "string"
    },
    "path": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "latency_ms": {
      "type": "integer"
    },
    "at": {
      "type": "string"
    }
  },
  "required": []
}
UsageRecord

字段类型必填约束与说明
session_idstring否
response_idstring否
modelstring否
statusstring否
timestring否
usageUsage否

完整 Schema

{
  "type": "object",
  "properties": {
    "session_id": {
      "type": "string"
    },
    "response_id": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "time": {
      "type": "string"
    },
    "usage": {
      "$ref": "#/components/schemas/Usage"
    }
  },
  "required": []
}
Voice

字段类型必填约束与说明
idstring否
namestring否
genderstring否

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "gender": {
      "type": "string"
    }
  },
  "required": []
}
VoiceModel

基础语音型号与可选语言、音色。空语言值使用模型默认;发布版本保留原调用 ID。

字段类型必填约束与说明
idstring否
namestring否
input_languagesarray否
output_languagesarray否
voicesarray否
default_voicestring否
priceVoicePrice否

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "input_languages": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "output_languages": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "voices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [],
        "description": "languages 省略或为空表示兼容该型号全部输出语言。"
      }
    },
    "default_voice": {
      "type": "string"
    },
    "price": {
      "$ref": "#/components/schemas/VoicePrice"
    }
  },
  "required": [],
  "description": "基础语音型号与可选语言、音色。空语言值使用模型默认;发布版本保留原调用 ID。"
}
Catalog

价格为每百万计费token的基础价格,最终计费还受账户分组等配置影响。

字段类型必填约束与说明
modelsarray否
agent_modelsarray否
voice_modelsarray否 items: VoiceModel
voicesarray否 items: Voice
default_voicestring否
pricesobject否

完整 Schema

{
  "type": "object",
  "properties": {
    "models": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "agent_models": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "voice_models": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/VoiceModel"
      }
    },
    "voices": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Voice"
      }
    },
    "default_voice": {
      "type": "string"
    },
    "prices": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "text_input": {
            "type": "number"
          },
          "text_output": {
            "type": "number"
          },
          "audio_input": {
            "type": "number"
          },
          "audio_output": {
            "type": "number"
          }
        },
        "required": []
      }
    }
  },
  "required": [],
  "description": "价格为每百万计费token的基础价格,最终计费还受账户分组等配置影响。"
}
TranscriptEntry

按会话来源返回转写正文与时间字段;content/text、timestamp/time 可能仅返回其中一种,不包含系统提示词。工具调用详情见 items。

字段类型必填约束与说明
idstring否
rolestring否
contentstring否
textstring否
timestampany否
timeany否

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "timestamp": {},
    "time": {}
  },
  "required": [],
  "description": "按会话来源返回转写正文与时间字段;content/text、timestamp/time 可能仅返回其中一种,不包含系统提示词。工具调用详情见 items。"
}
ConversationItem

正文与工具记录。incomplete为部分输出,truncated表示客户端截断;生成文本不代表已经播放。

字段类型必填约束与说明
idstring否
response_idstring否
typestring否
rolestring否
contentstring否
statusstring否
call_idstring否
namestring否
argumentsstring否
outputstring否
approval_request_idstring否
reasonstring否
approveboolean否
audio_end_msinteger否
duration_msinteger否

完整 Schema

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "response_id": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "role": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "call_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "arguments": {
      "type": "string"
    },
    "output": {
      "type": "string"
    },
    "approval_request_id": {
      "type": "string"
    },
    "reason": {
      "type": "string"
    },
    "approve": {
      "type": "boolean"
    },
    "audio_end_ms": {
      "type": "integer"
    },
    "duration_ms": {
      "type": "integer"
    }
  },
  "required": [],
  "description": "正文与工具记录。incomplete为部分输出,truncated表示客户端截断;生成文本不代表已经播放。"
}
ConversationEvent

字段类型必填约束与说明
event_idstring否Realtime沿用实时event_id;电话和网页使用稳定的来源与序号标识;旧记录可能省略。
stream_idstring否
sequenceinteger否
timestring否
directionstring否
typestring否
response_idstring否
dataobject否Realtime为经过披露映射的完整服务端事件;电话和网页为原生事件允许公开的字段。

完整 Schema

{
  "type": "object",
  "properties": {
    "event_id": {
      "type": "string",
      "description": "Realtime沿用实时event_id;电话和网页使用稳定的来源与序号标识;旧记录可能省略。"
    },
    "stream_id": {
      "type": "string"
    },
    "sequence": {
      "type": "integer"
    },
    "time": {
      "type": "string",
      "description": "",
      "format": "date-time"
    },
    "direction": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "response_id": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "additionalProperties": true,
      "description": "Realtime为经过披露映射的完整服务端事件;电话和网页为原生事件允许公开的字段。"
    }
  },
  "required": []
}
鉴权 · BearerAuth

使用平台 API Key;密钥保留在客户后端。

{
  "BearerAuth": {
    "type": "http",
    "scheme": "bearer"
  }
}