Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docsa.stemfard.com/llms.txt

Use this file to discover all available pages before exploring further.

The Stemfard API is a JSON-based REST API that gives you programmatic access to intelligent mathematics computations for STEM education. Every request targets a specific mathematical operation, and every response returns structured results that can include step-by-step explanations, background theory, and learning pathway links. You send a POST request with a JSON body, and you receive a JSON response.

Base URL

All API requests are made to:
https://api.stemfard.com
The current API version is v1. All endpoint paths begin with /api/v1/.

Authentication

You authenticate by including your API key in the Authorization header of every request.
Authorization: Bearer <your-api-key>
Keep your API key secret. Do not expose it in client-side code or public repositories. If your key is compromised, rotate it immediately from your account dashboard.

Request format

All endpoints accept POST requests with a Content-Type: application/json body. There are no query parameters — all inputs are passed in the request body as a JSON object.
POST /api/v1/mathematics/linear-algebra/matrix-operations/matrix-arithmetic/add
Content-Type: application/json
Authorization: Bearer <your-api-key>

Response format

Responses are always JSON objects. A successful response returns HTTP 200 with a result object whose structure depends on the endpoint and the api_level you request. See the errors reference for non-200 status codes.

Minimal complete example

The following example adds two matrices and returns a detailed response with steps.
curl --request POST \
  --url https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-arithmetic/add \
  --header 'Authorization: Bearer <your-api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "a": [[1, 2], [3, 4]],
    "b": [[5, 6], [7, 8]],
    "result_name": "sum",
    "api_level": "standard"
  }'

Common request parameters

Every math endpoint accepts the following shared parameters in the request body, in addition to any operation-specific fields.
result_name
string
default:"ans"
The name assigned to the computed result in the response object.
api_level
string
default:"detailed"
Controls response verbosity. Accepted values: "lite", "standard", "detailed".
steps_bg
boolean
default:"true"
When true, includes background theory alongside each solution step.
steps_output_formats
string[]
default:"[\"\"]"
Format for rendered step content. Accepted values: "html", "latex", "speech". Pass an empty string for plain text.
decimals
integer | null
default:"null"
Number of decimal places to round results to. Pass null to return full precision.
apply_decimals_in_steps
boolean
default:"false"
When true, applies decimals rounding to intermediate step values as well as the final result.
request_params
boolean
default:"true"
When true, includes a normalized copy of the request parameters in the response.
learning_pathways
boolean
default:"true"
When true, includes links to curated learning resources relevant to the operation.
When true, includes links to related Stemfard API endpoints in the response.
properties
boolean
default:"true"
When true, includes a description of the result object’s properties in the response.
The api_level parameter is the fastest way to control response size. Use "lite" when you only need the computed result and want to minimize payload size. Use "standard" for results with steps but without background theory. Use "detailed" (the default) for the richest response, including theory, learning pathways, and related endpoint links — ideal for educational interfaces.

Endpoint groups

The API is organized into endpoint groups by mathematical domain. Each group contains a combined endpoint (which accepts a type or operation parameter to select the specific computation) and individual focused endpoints for each operation.
GroupDescriptionReference
Matrix arithmeticAdd, subtract, multiply, divide, and raise matrices element-wise, plus standard matrix multiplicationmatrix-arithmetic
Matrix dimensionsQuery the number of rows, number of columns, or full shape of a matrixmatrix-dimensions
Matrix statisticsCompute min, max, sum, mean, median, variance, and standard deviation across rows, columns, or the full matrixmatrix-statistics

Error handling

When a request fails, the API returns a non-200 HTTP status code with a JSON error body. See the errors reference for the full list of status codes and the validation error response schema.