AI 改写AI Rewrite

保持原意的前提下重新表述文本,支持多维度改写,适用于内容去重、文案创作等场景。Rephrase text while preserving original meaning. Multi-dimensional rewrite for content deduplication and copywriting.

快速概览

Quick Overview

AI 改写 API 可在保持原文语义的前提下,按照指定的模式、风格和目标受众对文本进行重新创作。支持同语言改写和跨语言改写,适用于内容去重、SEO 优化、学术降重、社交媒体文案创作等多种场景。可根据实际需求生成 1~5 个不同版本的改写结果。The AI Rewrite API rephrases text while preserving semantic meaning, with customizable mode, tone, and target audience. Supports same-language and cross-language rewriting, ideal for content deduplication, SEO optimization, academic paraphrasing, and social media copywriting. Can generate 1–5 distinct rewritten variations per request.

认证方式

Authentication

所有 API 请求需在 HTTP Header 中携带 Access Token 进行身份认证:All API requests must include an Access Token in the HTTP Header for authentication:

Authorization: Bearer YOUR_ACCESS_TOKEN

请前往 控制台 获取您的 Access Token。Get your Access Token from the Dashboard.

请求头

Request Headers

HeaderHeaderValue必填Required说明Description
AuthorizationBearer {token}requiredBearer 认证令牌Bearer authentication token
Content-Typeapplication/jsonrequired请求体格式为 JSONRequest body format is JSON

请求端点

Endpoint

POST/v1/rewrite

改写模式参考

Rewrite Mode Reference

模式Modemode说明Description典型场景Use Case
同义改写Paraphraseparaphrase保持原意和长度,换用不同表达方式Keep meaning & length, rephrase with different expressionsSEO 内容去重、学术降重SEO dedup, academic paraphrasing
简化Simplifysimplify降低阅读难度,用简单词汇和短句表达Lower reading level, use simple words & short sentences科普文章、儿童读物Popular science, children's books
扩展Expandexpand丰富细节,补充说明和例证Enrich with details, add explanations and examples白皮书、教程、产品介绍Whitepapers, tutorials, product descriptions
摘要Summarizesummarize精炼核心信息,去除冗余细节Distill core message, remove redundant details摘要生成、标题优化Abstract generation, title optimization
创意改写Creativecreative突破原有结构,以新颖角度重述Break original structure, retell from a fresh angle广告文案、社交媒体、故事改写Ad copy, social media, story rewriting
正式化Formalizeformalize转为正式/商务文体风格Convert to formal/business style商业报告、官方声明Business reports, official statements
口语化Casualcasual转为轻松随意的口语风格Convert to relaxed conversational style聊天对话、短视频脚本Chat messages, short video scripts

请求参数

Request Parameters

参数Parameter类型Type必填Required说明Description
textstringrequired待改写文本,最大 50,000 字符Text to rewrite, max 50,000 characters
modestringoptional改写模式,默认 paraphraseRewrite mode; default paraphrase
source_langstringoptional源语言代码,如 zh/en/ja;不填则自动检测Source language code, e.g. zh/en/ja; auto-detect if omitted
target_langstringoptional目标语言代码,不填则同语改写Target language code; omit for same-language rewrite
variationsintegeroptional生成变体数量:1~5,默认 1Number of variations: 1~5; default 1
tonestringoptional语气风格:neutral / professional / friendly / enthusiastic / urgentTone: neutral / professional / friendly / enthusiastic / urgent
target_audiencestringoptional目标受众:general / expert / beginner / teenagerTarget audience: general / expert / beginner / teenager
preserve_keywordsstring[]optional必须保留的关键词列表,最多 20 个Keywords that must be preserved; max 20
avoid_keywordsstring[]optional需要避免使用的词语列表,最多 20 个Words to avoid in output; max 20

请求示例

Request Examples

curl -X POST https://api.itranslator.cc/v1/rewrite \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "这是一款功能强大的软件,可以帮助您提高工作效率。",
    "mode": "paraphrase",
    "variations": 3,
    "preserve_keywords": ["工作效率"]
  }'

响应字段

Response Fields

字段Field类型Type说明Description
originalstring原始文本Original text
variationsstring[]改写结果列表,0 为最优结果Rewrite result list; index 0 is best result
modestring实际使用的改写模式Rewrite mode used
source_langstring检测到的源语言代码Detected source language code
target_langstring目标语言代码(无跨语言则为 null)Target language code; null if same-language
similarity_scoresnumber[]各变体与原文本的语义相似度 (0~100)Semantic similarity scores vs original (0~100)
token_usageobjectToken 用量信息:prompt_tokens, completion_tokensToken usage: prompt_tokens, completion_tokens
语义相似度说明
  • similarity_scores 越高表示改写结果越贴近原文,但重写程度越小。可通过调节 modetone 参数来平衡。
  • Higher similarity_scores mean closer to original but less rewriting. Adjust via mode and tone.
  • variations[0] 始终是按综合质量排序后的最佳结果。
  • variations[0] is always the best result ranked by overall quality.

响应示例(同义改写)

Response Example (Paraphrase)

{
  "original": "这是一款功能强大的软件,可以帮助您提高工作效率。",
  "variations": [
    "凭借强大的功能,该软件能显著提升您的工作效率。",
    "这款软件功能强大,助力您高效完成工作任务。",
    "提升工作效率,这款功能丰富的软件是您的理想选择。"
  ],
  "mode": "paraphrase",
  "source_lang": "zh",
  "target_lang": null,
  "similarity_scores": [91, 87, 82],
  "token_usage": { "prompt_tokens": 28, "completion_tokens": 126 }
}

响应示例(简化模式)

Response Example (Simplify)

{
  "original": "人工智能技术的迅猛发展正在深刻地改变各行各业的运作模式,从医疗诊断到金融风控,从智能制造到智慧城市,AI的应用边界不断拓展。",
  "variations": [
    "人工智能技术发展很快,正在改变很多行业的工作方式,比如医疗、金融、制造和城市管理。",
    "AI技术快速进步,越来越多地应用在医疗、金融、制造和城市建设中。"
  ],
  "mode": "simplify",
  "source_lang": "zh",
  "target_lang": null,
  "similarity_scores": [85, 82],
  "token_usage": { "prompt_tokens": 42, "completion_tokens": 98 }
}

响应示例(跨语言创意改写)

Response Example (Cross-Language Creative)

{
  "original": "我们的产品采用最新技术,性能卓越,价格合理。",
  "variations": [
    "Experience cutting-edge technology at an unbeatable price — our product redefines performance.",
    "Power meets affordability: our product brings you the latest tech without breaking the bank.",
    "Why settle for less? Get top-tier performance with the latest technology, priced just right."
  ],
  "mode": "creative",
  "source_lang": "zh",
  "target_lang": "en",
  "similarity_scores": [78, 73, 70],
  "token_usage": { "prompt_tokens": 22, "completion_tokens": 156 }
}

错误码

Error Codes

HTTP Code错误码Error Code说明Description
2000成功Success
4001001参数错误,请检查必填参数和参数格式Invalid parameter; check required fields and format
4001002不支持的语言代码Unsupported language code
4001003不支持的改写模式,请参考模式参考表Unsupported rewrite mode; see mode reference table
4001004variations 超出范围(需为 1~5 之间的整数)variations out of range (must be integer 1~5)
4001005preserve_keywords 或 avoid_keywords 超过数量限制(最多 20 个)preserve_keywords or avoid_keywords exceeds limit (max 20)
4012001认证失败,Token 无效或已过期Authentication failed; invalid or expired token
4032003无权限访问该资源Access denied; insufficient permissions
4133001请求文本超出长度限制(最大 50,000 字符)Text exceeds maximum length (50,000 chars)
4294001请求频率超限,请稍后重试Rate limit exceeded; please retry later
4294002日调用次数超限,请升级套餐Daily quota exceeded; upgrade your plan
5005001服务器内部错误,请重试或联系技术支持Internal server error; retry or contact support

最佳实践

Best Practices

  1. 选择合适的模式:内容去重用 paraphrase,降低阅读难度用 simplify,广告文案用 creative
  2. Choose the right mode: Use paraphrase for dedup, simplify for readability, creative for ad copy.
  3. 生成多个变体:设置 variations 为 3~5,可从中选择最佳版本再手动微调。
  4. Generate multiple variations: Set variations to 3–5, pick the best one and manually fine-tune.
  5. 保留关键术语:对于品牌名、产品名、专业术语等,使用 preserve_keywords 确保不被改写。
  6. Preserve key terms: Use preserve_keywords for brand names, product names, and technical terms.
  7. 控制语气适配场景:正式文档用 professional,社交媒体用 friendlyenthusiastic
  8. Match tone to context: Use professional for formal docs, friendly/enthusiastic for social media.
  9. 设置目标受众:根据读者背景选择 expert(专业术语保留)、beginner(降低复杂度)等。
  10. Set target audience: Select expert (keep jargon) or beginner (simplify) based on reader background.
  11. 批量处理时控制并发:避免同时对同一段文本发起大量改写请求,建议串行或限制并发数在 5 以内。
  12. Control concurrency for batch jobs: Avoid flooding the API; limit concurrent requests to 5 per batch.

使用场景

Use Cases

场景Scenario推荐参数Recommended Params说明Notes
SEO 内容去重SEO Content Dedupmode=paraphrase, variations=3~5为同一主题生成多版本文章,避免搜索引擎判定重复内容Generate multiple versions of the same topic to avoid duplicate content penalties
学术论文降重Academic Plagiarism Reductionmode=paraphrase, tone=professional, preserve_keywords=[术语]改写文献综述段落,保留专业术语,降低查重率Rewrite literature review sections, keep technical terms, reduce similarity score
营销文案创作Marketing Copywritingmode=creative, tone=enthusiastic, variations=5同一卖点生成多种风格的广告文案用于 A/B 测试Generate multiple ad copies for the same selling point for A/B testing
技术文档简化Technical Doc Simplificationmode=simplify, audience=beginner将复杂技术文档改写为适合非技术人员阅读的版本Rewrite complex technical docs for non-technical audiences
跨语言内容本地化Cross-Language Localizationmode=paraphrase, target_lang=en, tone=friendly将中文内容改写为符合英语母语者习惯的表达方式Rewrite Chinese content to natural English expressions for native speakers
产品描述批量生成Bulk Product Descriptionsmode=expand, variations=3, preserve_keywords=[产品名]基于简短描述扩展为详细的产品说明文案Expand short descriptions into detailed product copy
使用说明
  • 所有 API 请求均使用 HTTPS,建议开启 HTTP Keep-Alive 以提高性能。
  • All API requests use HTTPS; enable HTTP Keep-Alive for better performance.
  • 请勿在客户端代码中暴露 Access Token,建议通过后端代理调用。
  • Do not expose your Access Token in client-side code; use a backend proxy.
  • 推荐设置合理的超时时间(30 秒),并实现指数退避重试策略。
  • Set a reasonable timeout (30s) and implement exponential backoff for retries.
  • 改写结果可能存在细微语义偏差,建议在使用前进行人工审校,特别是正式文件和法律文书。
  • Rewrite results may have subtle semantic shifts; human review is recommended, especially for formal and legal documents.