AI21 Labs
  1. 释义 API
AI21 Labs
  • J2 完整 API
    • J2 完整 API
    • J2 完整版
      POST
  • 自定义 J-2 模型
    • 数据集 API
      • 数据集 API
      • 获取数据集列表
      • 获取数据集
      • 删除数据集
    • 自定义模型 API
      • 自定义模型 API
      • 自定义模型训练
      • 获取自定义模型列表
      • 获取自定义模型
      • 自定义模型完整训练
      • 更新默认轮次
  • 特定任务模型
    • 释义 API
      • 释义 API
      • 释义
        POST
    • 语法错误修正 API
      • 语法错误修正 API
      • 语法错误更正
    • 文本改进 API
      • 文本改进 API
      • 文本改进
    • 总结 API
      • 总结 API
      • 总结
    • 按段总结 API
      • 按段总结
      • 按段总结
    • 文本分割 API
      • 文本分割 API
      • 文本分割
    • 语境化问答 API
      • 语境化问答 API
      • 管理文档库
        • 将文档上传到图书馆
        • 检索文档列表
        • 通过 ID 检索文档
        • 更新文档参数
        • 删除文档
      • 单文档语境化问答
      • 文档库语境化问答
    • 语义搜索 API
      • 语义搜索 API
      • 语义搜索
    • 嵌入式 API
      • 嵌入式
  • SDK
    • Python SDK
    • Python SDK
  • 其他
    • 分词 API
      • 分词
  1. 释义 API

释义

开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
https://api.ai21.com/studio/v1/paraphrase
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.ai21.com/studio/v1/paraphrase' \
--header 'Content-Type: application/json' \
--data-raw '{
    "text": "string",
    "style": "string",
    "startIndex": 0,
    "endIndex": 0
}'
响应示例响应示例
{
  "id": "862829b2-29be-c86d-370e-db2f7f5dbf5b",
  "suggestions": [
    {
      "text": "One life is enough if you live it right."
    },
    {
      "text": "When you do it right, you only live once."
    },
    {
      "text": "Once is all you have, but if you do it right, once is enough."
    },
    {
      "text": "When you live right, you only need to live once."
    },
    {
      "text": "One life is enough if you live it right, but if you don't do it right, one life is not enough."
    },
    {
      "text": "The only chance you have to live is once, but if you live well, a once is enough."
    },
    {
      "text": "The only way to live is right, so if you do it right, once is enough."
    },
    {
      "text": "Once is enough if you live it right, but if you do it wrong, you'll regret it later."
    },
    {
      "text": "In life, you only live once, but if you do it right, once should be plenty."
    },
    {
      "text": "It takes only one life to live a fulfilling life, but if you do it right, one life is enough."
    }
  ]
}

请求参数

Body 参数application/json
text
string 
必需
要释义的输入文本。 文本长度不应超过 500 个字符。
style
string 
可选
控制长度和音调。在这里阅读更多内容 默认:general
startIndex
integer 
可选
该参数指定给定文本中释义过程的起始位置。它是可选的,默认值为 0。
endIndex
integer 
可选
该参数指定要释义的最后一个字符的位置,包括其后面的字符。如果未提供该参数,则默认值设置为给定文本的长度。
示例

返回响应

🟢200成功
application/json
Body
id
string 
必需
suggestions
array [object {1}] 
必需
text
string 
必需
上一页
释义 API
下一页
语法错误修正 API
Built with