Skip to content

Use the text suggestion API

Send complete extracted text from one known-supported document per record and present both returned types for a person's decision.

Request

POST one JSON envelope to your SageMaker endpoint with ContentType="application/json". The public request example contains the complete fictional text used for the recorded response.

{"instances":[{"id":"review-1","text":"Your complete extracted source text","filename":"optional-metadata.txt"}]}

text is required. id and filename are optional bounded metadata and are never model features, paths or URLs to fetch. Supplied IDs must be unique. The envelope contains 1–32 records. An invalid or over-budget record rejects the entire envelope.

Response

The actual recorded AWS response preserves the caller ID and returns exactly two distinct suggestions, with ranks 1 and 2. There is no selected decision or probability.

Every prediction includes selection_required=true, needs_review=true, truncated=false, whole_document_coverage=unknown, unknown_mixed_detection=not_provided, validation_basis=generated_only and zero independent acceptance rows. Token and analyzed code-point counts describe the input that was actually admitted.

Show the original source beside both suggestions. Require a deliberate choice or rejection before downstream processing. Selecting a label in your application does not change the model or its evaluation labels.

JSON Lines and Batch Transform

Each line is one complete instances envelope. Use the three-language input and actual batch output to inspect the shape.

Setting Value
Instance One ml.c5.xlarge
ContentType / Accept application/jsonlines
SplitType / AssembleWith Line / Line
BatchStrategy SingleRecord
MaxConcurrentTransforms 1
MaxPayloadInMB 1
Invocation timeout / retries 60 seconds / 0

The runtime still enforces its smaller 256 KiB/32-record envelope bounds. MultiRecord is unsupported. Use private, task-owned S3 locations and inspect each output. A completed job does not establish document-type accuracy.

Correct rejected requests

Model HTTP status Action
400 Correct the complete malformed envelope or duplicate IDs
413 Reduce envelope size/count while preserving complete documents
415 Use the declared JSON or single-envelope JSON Lines format
422 Complete text exceeds the full token budget; use another designed workflow
429 Retry with bounded backoff; only one inference runs at a time
500 Surface the service failure for review and retry boundedly

SageMaker may wrap a model rejection as a ModelError; inspect its original status. Do not copy document text into support logs. Limits and evaluation explain the supported input boundary.

Last updated November 16, 2026 · Suggest an improvement