---
title: "Upload Tex"
method: POST
path: "/image/upload-tex"
tags: ["image"]
---

# Upload Tex

`POST /image/upload-tex`

Accepts a base64-encoded LaTeX source, compiles it in a sandboxed temp
dir, rasterises the PDF and returns one image URL per page.

Used by the exercise import to recover the figures a .tex draws (TikZ,
tables of variations, probability trees): the source is imported as
text either way, the page images only exist so the printed figures can
be cropped out of them. A source that does not compile answers
compiled=False with 200 — the import carries on without figures.

## Request body

- Base64TexUploadRequest
  - `file_content` string, required
  - `file_name` string, required
  - `content_type` string

## Response `200`

Successful Response

- TexCompileResponse
  - `status` string, required
  - `compiled` boolean, required
  - `message` string, required
  - `image_urls` string[], required

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-09** `e75413b9576a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/excellence-ai/apis/excellence-learning/changes/image/upload-tex/post.md)

---

[API](https://skmtc.dev/excellence-ai/apis/excellence-learning.md) · [All operations](https://skmtc.dev/excellence-ai/apis/excellence-learning/llms.txt) · [OpenAPI document](https://skmtc.dev/excellence-ai/apis/excellence-learning/revisions/2a0c1636fd3b?raw)
