> ## 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.

# Quickstart: make your first Stemfard math API call

> Learn how to authenticate, send your first matrix operation request, interpret the response, and control output verbosity using API levels.

This guide walks you through making your first request to the Stemfard API. By the end, you'll have sent a matrix addition request, read the structured response, and learned how to adjust the `api_level` parameter to get exactly the amount of detail your application needs.

<Steps>
  <Step title="Get your API key">
    Sign in to the [Stemfard dashboard](https://stemfard.com/dashboard) and navigate to **API Keys**. Copy your key — you'll pass it as a Bearer token in the `Authorization` header of every request.

    Keep your API key secure. Do not commit it to source control or expose it in client-side code.
  </Step>

  <Step title="Install a REST client or use curl">
    You can call the Stemfard API from any HTTP client. The examples below use curl, the JavaScript Fetch API, and the Python `requests` library. No additional SDK installation is required.
  </Step>

  <Step title="Make your first request">
    Send a POST request to the matrix addition endpoint. Replace `YOUR_API_KEY` with the key you copied from the dashboard.

    <CodeGroup>
      ```bash curl theme={null}
      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": [[5, 1, 6], [3, 4, 5], [6, 4, 8]],
          "b": [[-4, -2, 6], [4, 7, -3], [7, -3, 5]],
          "api_level": "standard",
          "result_name": "M"
        }'
      ```

      ```javascript fetch.js theme={null}
      const response = await fetch(
        'https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-arithmetic/add',
        {
          method: 'POST',
          headers: {
            'Authorization': 'Bearer YOUR_API_KEY',
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({
            a: [[5, 1, 6], [3, 4, 5], [6, 4, 8]],
            b: [[-4, -2, 6], [4, 7, -3], [7, -3, 5]],
            api_level: 'standard',
            result_name: 'M',
          }),
        }
      );

      const data = await response.json();
      console.log(data);
      ```

      ```python requests.py theme={null}
      import requests

      url = "https://api.stemfard.com/api/v1/mathematics/linear-algebra/matrix-operations/matrix-arithmetic/add"

      payload = {
          "a": [[5, 1, 6], [3, 4, 5], [6, 4, 8]],
          "b": [[-4, -2, 6], [4, 7, -3], [7, -3, 5]],
          "api_level": "standard",
          "result_name": "M",
      }

      headers = {
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
      }

      response = requests.post(url, json=payload, headers=headers)
      print(response.json())
      ```
    </CodeGroup>
  </Step>

  <Step title="Understand the response">
    A successful `standard` request returns a JSON object with the computed result and a solution step. Here is what the response looks like for the request above:

    ```json theme={null}
    {
      "metadata": {
        "result_name": "M",
        "operation": "add"
      },
      "taxonomy": {
        "topic": "Matrix Arithmetic",
        "subtopic": "Matrix Addition"
      },
      "result": {
        "M": [[1, -1, 12], [7, 11, 2], [13, 1, 13]]
      },
      "steps": [
        {
          "step": 1,
          "description": "Add corresponding elements of matrices A and B",
          "html": "<p>M = A + B</p>",
          "latex": "M = A + B"
        }
      ]
    }
    ```

    Key fields in the response:

    * **`metadata.result_name`** — The label assigned to the output matrix, set by your `result_name` parameter.
    * **`metadata.operation`** — The operation performed, useful for logging and display.
    * **`taxonomy`** — Classifies the computation by topic and subtopic for educational categorization.
    * **`result`** — Contains the computed matrix under the key you specified in `result_name`.
    * **`steps`** — An array of solution steps. Each step includes a plain-text `description`, an `html` representation, and a `latex` expression for rendering in educational interfaces.
  </Step>

  <Step title="Customize the response">
    The `api_level` parameter controls how much information the API returns. Use it to match the response to your application's needs:

    * **`lite`** — Returns only the computed result. Best for applications that just need the answer.
    * **`standard`** — Returns the result along with solution steps. Suitable for most educational use cases.
    * **`detailed`** — Returns the full educational response, including extended explanations, multiple output formats, and related learning pathways.

    To get just the answer without solution steps, set `api_level` to `"lite"`:

    ```json theme={null}
    {
      "a": [[5, 1, 6], [3, 4, 5], [6, 4, 8]],
      "b": [[-4, -2, 6], [4, 7, -3], [7, -3, 5]],
      "api_level": "lite",
      "result_name": "M"
    }
    ```

    To unlock full educational content including speech-ready explanations and learning pathways, use `"detailed"`:

    ```json theme={null}
    {
      "a": [[5, 1, 6], [3, 4, 5], [6, 4, 8]],
      "b": [[-4, -2, 6], [4, 7, -3], [7, -3, 5]],
      "api_level": "detailed",
      "result_name": "M"
    }
    ```

    <Note>
      For a full breakdown of what each API level returns, see [API levels](/concepts/api-levels).
    </Note>
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="API reference" icon="code" href="/api-reference/overview">
    Browse all available endpoints with full request parameters, response schemas, and live examples.
  </Card>

  <Card title="API levels" icon="sliders" href="/concepts/api-levels">
    Understand the difference between lite, standard, and detailed responses and when to use each.
  </Card>
</CardGroup>
