Enabling steps
Steps are tied to theapi_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 thesteps_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.
Including background theory
Setsteps_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.Rendering each format
- HTML
- LaTeX
- Speech
The If you want to apply custom styles, wrap the injected content in a styled parent:
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.Controlling decimal precision in steps
By default, intermediate values in steps use the same precision as the final result. Setapply_decimals_in_steps: true together with a decimals value to round intermediate calculations in the step output as well: