Parse.Run() method converts documents into structured JSON with text, tables, figures, layout, and formatting. r-1 is currently in preview and is the default for all new Parse pipelines. Parse returns content organized into chunks for LLM and RAG workflows.
The Go SDK examples on this page use V2 configuration names. r-1 is not available through the V2 API, so these requests use legacy Parse. To use r-1, convert the request to the V3 API. Review Parse r-1 and r-1 configuration compatibility before moving an existing configuration.
Basic Usage
Method Signatures
Synchronous Parse
Asynchronous Parse
RunJob method returns a JobID that you can use with client.Job.Get() to retrieve results.
Input Options
TheDocumentURL parameter accepts several formats:
Configuration Examples
Chunking
By default, Parse returns the entire document as one chunk. For RAG applications, use variable chunking:Table Output Format
Control how tables appear in the output:Page Range
Process only specific pages:Filter Blocks
Remove specific content types from output:Asynchronous Processing
For long-running operations, useParse.RunJob() to submit a job and poll for results:
Response Structure
Union Types
The Go SDK uses union types for responses that can have different structures. TheParseResponseResult can be either a ParseResponseResultFullResult (inline content) or a ParseResponseResultURLResult (URL to fetch content).
Always check the Type field first, then use AsUnion() to cast to the specific type:
Error Handling
Next Steps
- Learn about extracting specific fields from parsed documents
- Learn how Parse r-1 handles documents and customized agentic processing
- Explore response format details for complete structure
- Check out best practices for optimization