Skip to main content
Stemfard can return step-by-step solutions in multiple formats so you can render them however your application requires. Whether you are building a web UI that needs HTML markup, a document system that requires LaTeX typesetting, or an accessibility feature that feeds output to a text-to-speech engine, you control the format through the steps_output_formats request parameter.

Requesting output formats

Set steps_output_formats to an array of one or more format strings in your request body. The steps array in the response will then include content rendered in each format you specified.
You can request multiple formats in a single call by passing more than one value in the array — for example, "steps_output_formats": ["html", "latex"]. The API returns all requested formats together, so you only need one round-trip regardless of how many formats your application uses.

The three formats

The html format wraps mathematical expressions and step text in standard HTML markup. Use this when you are rendering solutions directly into a web page without a dedicated math typesetting library.Request:
cURL
Example step output:
html step output

Combining multiple formats

You can include any combination of html, latex, and speech in a single request. Each step in the response will contain the expression rendered in every format you requested.
cURL (all three formats)
multi-format step output

Including background theory

Set steps_bg: true in your request to include background theory notes alongside each step. These notes explain the mathematical rule or concept being applied, which is useful for learners who need more context than the step expression alone provides.
cURL (with background theory)
When steps_bg is enabled, each step object includes an additional background field:
step with background theory
steps_bg requires api_level to be "standard" or "detailed", since lite responses do not include a steps array.

Parameter reference

Type: string[]Default: [""] (no formatted output)An array of format identifiers controlling how step expressions are rendered. Accepted values are "html", "latex", and "speech". Pass an empty array or omit the parameter to receive steps without a specific output format applied.
Type: booleanDefault: trueWhen true, each step object includes a background field containing an explanation of the mathematical concept or rule used in that step. Requires api_level: "standard" or api_level: "detailed".