Skip to main content
Stemfard can return detailed step-by-step solutions alongside every result, breaking down the underlying mathematics into clear, sequenced explanations. This is especially valuable for educational applications where showing the work matters as much as the answer itself. You control the level of detail and the output format, so the same API call can power anything from a visual math renderer to a screen reader.

Enabling steps

Steps are tied to the api_level parameter. Setting it to "lite" returns only the result with no solution detail. Use "standard" or "detailed" to include steps. Set api_level in your request body:

Choosing an output format

Use the steps_output_formats field to specify which format (or formats) you want the steps returned in. You can request any combination of "html", "latex", and "speech" in a single call.
You can request all three formats in a single API call by passing "steps_output_formats": ["html", "latex", "speech"]. This avoids making multiple requests and lets you store all representations on the first fetch.

Including background theory

Set steps_bg: true to include background theory alongside the solution steps. This provides conceptual context — definitions, theorems, and relevant properties — that helps students understand why each step is valid, not just what to do.

Complete example

The following request computes the matrix product of two 2×2 matrices and asks for steps in all three output formats with background theory included.
Sample response

Rendering each format

The steps.html value is a ready-to-render HTML string. Inject it directly into a container element in your web application. Sanitize the string if it originates from user-controlled input, but for API-generated content this is safe to use as-is.
If you want to apply custom styles, wrap the injected content in a styled parent:

Controlling decimal precision in steps

By default, intermediate values in steps use the same precision as the final result. Set apply_decimals_in_steps: true together with a decimals value to round intermediate calculations in the step output as well: