v1
latestOpenAPI 3.1.02026-07-2418848.0 KBPrompt → Diagram (AI)
Request body
The prompt. The input code or natural language which describes a diagram.
Select desired diagram type. Will automatically detect diagram type when unspecified. Note: "freeform-diagram" is element-based — it cannot be edited via inlineCodeEdit (use priorRequestId instead), and its responses do not include a "code" field.
Model tier. "premium" (default) uses a higher-quality model; "standard" uses a faster, lower-cost model. Defaults to "premium".
ID of a previous request to edit. When provided, the API will edit the diagram from that request.
ID of an AI preset to use as context for generation. Find contextId in the AI preset page (https://app.eraser.io/dashboard/ai-preset).
ID (workspaceId) of a template within a preset. Both contextId and templateId are required to use a template. Find ID by navigating to AI preset (https://app.eraser.io/dashboard/ai-preset) > Templates > Open a template
When true, returns the image as a file stream instead of a URL.
Deprecated. Use returnImageAsFile instead.
Select transparent (false) or solid (true) background. Defaults to false.
Select "light" or "dark" theme. Defaults to "light".
Image quality/resolution multiplier. Use 1 (low), 2 (medium), or 3 (high). Defaults to 2.
Deprecated. Use imageQuality instead.
Response
The result of the diagram generation
ID of the diagram generation request
URL of the generated diagram as a PNG image
URL to create an Eraser file to edit the generated diagram. Not returned when fileOptions.create is true.
URL to the created Eraser file. Only returned when fileOptions.create is true.
File paths from the Git repository context used to generate the diagram. Only returned when gitContexts is provided. Format: orgName/repoName:filePath