proofreading

Grammar and spelling check

Check text for grammar, spelling, and style issues. Returns a list of suggested edits, each with the sentence, character span (start/end), replacement text, and an error type. Set auto_apply=true to also receive applied_text: the input with all suggested edits already applied (useful to return a corrected document in one call). Set include_error_categories=false to skip error classification and get only the corrections and offsets back (faster and lighter when you only need to apply fixes). Supports many languages via the lang parameter. If the result carries a degraded object it is partial: some sentences may be missing some or all of their corrections (the edits returned are still valid); call again for a complete result.

post/api/v1/edits

Request

  • Base URL: https://api.sapling.ai
  • URL: https://api.sapling.ai/api/v1/edits
  • 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

auto_applyboolean

If true, the response includes applied_text with all edits applied to the input.

include_error_categoriesboolean

Defaults to true. If false, edits omit error_type, general_error_type and classifier-generated descriptions; corrections, offsets, IDs and applied_text are unchanged.

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.

langstring

ISO 639-1 language code of the text (e.g. "en", "de", "fr"). Defaults to "en".

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.

session_idstring

Optional stable identifier for the document or conversation being checked. Reuse the same value when re-checking the same document.

textstring required

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

variety'us-variety' | 'gb-variety' | 'au-variety' | 'ca-variety' | 's-variety' | 't-variety' | 'null-variety'

English variety to enforce, e.g. "us-variety" or "gb-variety". Optional.

Response

Successful response. Field-level schemas and examples: https://sapling.ai/docs/api/edits-overview/ With noformat=true (the SDK response shape) the body is a bare array of edit objects instead. A partial result (some corrections may be missing) adds a degraded object; retry for a complete result.

Changes

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