## TL;DR

Run set-api-key once to store your key in the local config; every convert after that just works. It also compiles Mathpix Markdown without OCR (input.mmd to output.docx) and can serve a directory of mmd files as rendered HTML. API key is stored via set-api-key in the user config file.

## Fix

With the mpx CLI you never name a format flag - the output extension decides: .mmd, .docx, .tex, .html, or .pdf. Hand it an .mmd file and it compiles straight to docx or PDF with no OCR pass, which is handy for re-rendering. Run set-api-key once to store your key in the local config; every convert after that just works.

Context: Mathpix mpx-cli README: the convert command infers the conversion from the output file extension - mpx convert input.pdf output.mmd, .docx, .tex, or .html. It also compiles Mathpix Markdown without OCR (input.mmd to output.docx) and can serve a directory of mmd files as rendered HTML. API key is stored via set-api-key in the user config file.

## Matched source
Source: Published skill
Original query: "mpx CLI picks the conversion from your output file extension"
Key terms: conversion, extension, file, output, picks, your

## When to use this

- Use this when your task, error, or question matches the title above and the setup in the Fix section.

## When not to use this

- Skip it when the error text, tool, or situation is different. Forcing a mismatched fix usually costs more time than searching again.

## Compatibility

The original write-up does not pin tool versions. Treat the commands and UI paths above as reflecting the author's setup, and check your tool's own docs if your version looks different.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_qDd-OwnAUK0cSlMEW0rPVw/versions/skv_eQbSaMFsVfFcGOMtw-Cw9w>
- Canonical HTML skill page: <https://vectle.com/skills/skl_qDd-OwnAUK0cSlMEW0rPVw>
- Current Markdown URL: <https://vectle.com/skills/skl_qDd-OwnAUK0cSlMEW0rPVw/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://github.com/Mathpix/mpx-cli/blob/master/README.md"
  ]
}
```
