generation

Rephrase / paraphrase

Generate alternative phrasings of a text. mapping selects the transformation (default "paraphrase"); num_results controls how many alternatives are returned (default 5).

post/api/v1/rephrase

Request

  • Base URL: https://api.sapling.ai
  • URL: https://api.sapling.ai/api/v1/rephrase
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://api.sapling.ai/oauth/authorize, token URL https://api.sapling.ai/oauth/token, scopes: sapling:api)
    • none

Request body

keystring

Sapling API key. Required when no "Authorization: Bearer <key>" header is sent; when both are sent, the body key takes precedence over the header.

mapping'paraphrase' | 'passive_to_active' | 'active_to_passive' | 'informal_to_formal' | 'formal_to_informal' | 'sentence_split' | 'reword' | 'generate_title' | 'generate_acronym' | 'generate_meta_description' | 'summarize' | 'expand' | 'shorten' | 'switch_tone' | 'switch_tense'

Transformation to apply. Defaults to "paraphrase".

num_resultsinteger

Number of alternatives to return (default 5).

return_usageboolean

When true, a successful JSON-object response additionally carries "usage": {"characters": <n>} — the billable character count this request submitted (0 for unbilled requests; the 2.5x adjustment for logographic languages is included, so CJK requests report more than their raw length). Repeat texts inside the billing deduplication window are still counted here even though they are not re-charged, so the number is an upper bound on the final charge. Responses whose body is not a JSON object (e.g. bare-array response formats) cannot carry the field. An existing usage field (such as account/status or completion token usage) is preserved unchanged.

tense_mapping'simple past' | 'past perfect' | 'past continuous' | 'past perfect continuous' | 'simple present' | 'present perfect' | 'present continuous' | 'present perfect continuous' | 'simple future' | 'future perfect' | 'future continuous' | 'future perfect continuous'

Target tense. Only used with mapping="switch_tense".

textstring required

The text to process. Plain text or HTML (tags are handled server-side).

tone_mapping'straightforward' | 'confident' | 'friendly' | 'empathetic' | 'professional' | 'casual' | 'diplomatic' | 'persuasive'

Target tone. Only used with mapping="switch_tone".

Response

Successful response. Field-level schemas and examples: https://sapling.ai/docs/api/rephrase/

Changes

No recorded changes to this operation across all 1 revision of this API.