What is Stru Mathcad API?
The Stru Mathcad API enables programmatic generation and manipulation of Mathcad Prime (.mcdx) documents. Automate calculation package creation, standardize engineering documentation, and integrate Mathcad into your workflows without manual file creation. Base URL:https://api.stru.ai/v1
Authentication: Bearer token (API key from app.stru.ai)
Core Concepts
Document Generation
Create Mathcad Prime (.mcdx) files from scratch programmatically. Build complete calculation documents element by element.
Element-Based Building
Add text blocks, variables, formulas, images, and metadata to build rich, professional documents.
Async Jobs
All document operations run asynchronously. Submit a job, receive a job ID, then poll for the generated file download URL.
AI-Enhanced Formatting
Optional AI-powered layout optimization adjusts element positioning for professional presentation.
Key Features
- Document Automation: Generate complete .mcdx files programmatically without opening Mathcad
- Element Control: Add text, variables, formulas, images with precise control
- Template Standard: Create company-standard calculation templates dynamically
- PDF Generation: Convert generated .mcdx documents to PDFs for distribution
- Legacy Conversion: Convert old .xmcd files to modern .mcdx format
- Document Reading: Parse existing .mcdx files to extract structure and formulas
- Secure Downloads: Generated files available via time-limited signed URLs (24-hour retention)
Supported File Formats
Mathcad Prime (.mcdx) - Primary Format
Mathcad Prime (.mcdx) - Primary Format
Fully Supported - The API operates exclusively with the modern Mathcad Prime .mcdx format.
- Create new .mcdx documents
- Read/parse existing .mcdx files
- Modify and update .mcdx documents
- Generate PDFs from .mcdx files
Mathcad 15 (.xmcd) - Legacy Conversion Only
Mathcad 15 (.xmcd) - Legacy Conversion Only
Limited Support - Legacy .xmcd files can be converted to .mcdx format via the
/convert endpoint.- One-way conversion: .xmcd → .mcdx
- No direct editing of .xmcd files
- Conversion is best-effort (some complex elements may require manual adjustment)
Mathcad Classic (.mcd) - Not Supported
Mathcad Classic (.mcd) - Not Supported
Not Supported - Binary .mcd files from Mathcad 14 and earlier are not supported.Workaround: Open in Mathcad 15 and save as .xmcd, then use the conversion endpoint.
Quick Start
1
Get Your API Key
Sign in to app.stru.ai and generate an API key from your dashboard.
2
Create a Document Job
Submit a job to create a new Mathcad document.Response:
3
Poll for Completion
Check the job status until complete.When complete:
4
Download the File
Use the signed URL to download your generated .mcdx file.
Document Elements
Build rich documents by combining these element types:Text Blocks
Add headers, descriptions, and documentation
Variables
Define input values with units
Formulas
Add calculations and equations
Images
Embed diagrams and photos
Common Workflows
1. Automated Report Generation
1. Automated Report Generation
Create complete, multi-page Mathcad reports directly from structural analysis software output.Workflow:
- Run analysis in ETABS/SAP2000/etc.
- Extract results (forces, deflections, utilization ratios)
- Use Mathcad API to generate .mcdx with:
- Project header (text)
- Input parameters (variables)
- Code checks (formulas)
- Result tables (formatted text)
- Generate PDF for submittal package
2. Dynamic Template Creation
2. Dynamic Template Creation
Generate company-standard calculation templates programmatically based on project parameters.Workflow:
- User selects project type (building, bridge, retaining wall)
- API generates .mcdx template with:
- Standard company header
- Relevant code references
- Pre-configured variables
- Applicable formulas
- Engineer opens in Mathcad and fills in values
3. Digital Calculation Packages
3. Digital Calculation Packages
Assemble project calculations from various sources into a single, consistent .mcdx file.Workflow:
- Collect calculation data from multiple sources
- Standardize format and layout
- Generate unified .mcdx document
- Add table of contents and metadata
- Export to PDF for archival
4. Code-to-Calculation Pipeline
4. Code-to-Calculation Pipeline
Integrate with Search API to create documented calculations that reference specific code sections.Workflow:
- Search API finds relevant code clause (e.g., “ACI 318-19 Section 10.5.3”)
- Extract requirements and formulas
- Mathcad API generates .mcdx that:
- References the code section (text)
- Shows the requirement (quoted text)
- Performs the check (formula)
- Displays result (variable)
API Operations
| Operation | Endpoint | Description |
|---|---|---|
| Create Document | POST /v1/mathcad/jobs | Generate a new .mcdx file |
| Add Elements | POST /v1/mathcad/{doc_id}/elements | Add content to existing document |
| Read Document | POST /v1/mathcad/jobs (operation: read) | Parse .mcdx to extract structure |
| Generate PDF | POST /v1/mathcad/jobs (operation: pdf) | Convert .mcdx to PDF |
| Convert Legacy | POST /v1/mathcad/convert | Convert .xmcd to .mcdx |
Best Practices
Organize Elements Logically
Organize Elements Logically
Structure your document with clear sections using text headers.
Use Descriptive Variable Names
Use Descriptive Variable Names
Make formulas readable with clear variable naming.Good:
beam_length, moment_capacity, steel_yield_strengthBad: l, m, fyAdd Descriptions
Add Descriptions
Include
description fields to document what each element represents.Enable AI Formatting for Complex Docs
Enable AI Formatting for Complex Docs
For documents with many elements, use the AI formatting option to optimize layout.
Download Files Promptly
Download Files Promptly
Generated files expire after 24 hours. Download and store them in your system.
Rate Limits & Quotas
| Tier | Requests/Minute | Max Elements/Doc | File Retention |
|---|---|---|---|
| Free | 10 | 50 | 1 hour |
| Pro | 60 | 500 | 24 hours |
| Enterprise | Custom | Unlimited | Custom |
Rate limits apply per API key. Document generation jobs typically take 5-15 seconds depending on complexity.
File Retention & Downloads
Important: Generated files are stored temporarily and automatically deleted after the retention period.
- Files are available via signed URLs with 24-hour expiration (Pro tier)
- URLs are valid for one-time download or multiple downloads within the expiration window
- After expiration, files are permanently deleted from storage
- Always download and store files in your system immediately after generation
Integration with Other Stru APIs
The Mathcad API works seamlessly with other Stru services:1
Search for Code Requirements
Use Search API to find relevant building code sections
2
Generate Calculation
Use Mathcad API to create documented calculation referencing the code
3
Create Summary Report
Use Excel API to build a summary table of all calculations