image

Generate Diagram Preview

Generate clean diagram previews for provided diagrams.

This endpoint is designed for ephemeral UI flows such as the transcription preview modal and teacher exam diagram generation. It accepts either diagram image URLs or a figure description (or both), calls generate_diagram, and returns the rendered image alongside the generated matplotlib code.

post/image/generate-diagram-preview

Request body

image_urlsstring[] nullable
instructionsstring nullable
exercise_contentstring nullable
figure_descriptionstring nullable
current_codestring nullable
current_diagram_urlstring nullable

Response

Successful Response

statusstring required
messagestring required

Changes

No recorded changes to this endpoint across all 3 revisions of this API.