Skip to content

Render API

Base URL: https://api.dajiaoai.com

The API accepts a project payload conforming to the Dino Geometry file protocol, renders a specified slide, and returns the exported file URL and metadata.

Overview

DescriptionPathMethod
Export PNG/api/renderPOST
Export SVG/api/render-svgPOST
Export TikZ/TeX/api/render-tikzPOST

See Authentication for auth and API Billing for billing.

Request headers

Optionally provide:

  • x-request-id: business request ID. If omitted, a UUID is generated automatically.

Request body

All three endpoints share the following JSON fields:

FieldTypeRequiredDescription
contentFileContentLatestyesProject payload to render. See Dino Geometry file protocol.
slideIndexnumbernoSlide index to render, 1-based, defaults to 1.
size.widthnumbernoLogical canvas width, positive integer, default 1024.
size.heightnumbernoLogical canvas height, positive integer, default 1024.
camera.offset.xnumbernoOverride render camera center x.
camera.offset.ynumbernoOverride render camera center y.
camera.scalenumbernoOverride render camera scale.

/api/render additionally supports pixelRatio (default 1); the other two endpoints do not.

Size limits

For /api/render, the physical dimensions are calculated as follows and must not exceed 2048 x 2048:

text
physicalWidth  = round(width * pixelRatio)
physicalHeight = round(height * pixelRatio)

Export PNG POST /api/render

bash
curl -X POST https://api.dajiaoai.com/api/render \
  -H "Authorization: Bearer djo_xxx" \
  -H "Content-Type: application/json" \
  -H "x-request-id: render-demo-001" \
  -d '{
    "slideIndex": 1,
    "size": { "width": 768, "height": 768 },
    "pixelRatio": 2,
    "camera": { "offset": { "x": 0, "y": 0 }, "scale": 1 },
    "content": {
      "metadata": { "version": "11" },
      "messages": [],
      "slides": [{ "definitions": [], "uvarMap": [], "styleSheet": {}, "doc": [] }]
    }
  }'

Returns 200 OK:

json
{
  "success": true,
  "url": "https://dl.easeplay.vip/dajiao-open/dev/mcp/customer-id/session-id/4fa2bc.png",
  "filename": "4fa2bc.png",
  "slideIndex": 1,
  "width": 768,
  "height": 768,
  "pixelRatio": 2,
  "physicalWidth": 1536,
  "physicalHeight": 1536,
  "mimeType": "image/png",
  "size": 24831
}

Export SVG POST /api/render-svg

bash
curl -X POST https://api.dajiaoai.com/api/render-svg \
  -H "Authorization: Bearer djo_xxx" \
  -H "Content-Type: application/json" \
  -H "x-request-id: render-svg-demo-001" \
  -d '{
    "slideIndex": 1,
    "size": { "width": 768, "height": 768 },
    "camera": { "offset": { "x": 0, "y": 0 }, "scale": 1 },
    "content": {
      "metadata": { "version": "11" },
      "messages": [],
      "slides": [{ "definitions": [], "uvarMap": [], "styleSheet": {}, "doc": [] }]
    }
  }'

Returns 200 OK:

json
{
  "success": true,
  "url": "https://dl.easeplay.vip/dajiao-open/dev/mcp/customer-id/session-id/4fa2bc.svg",
  "filename": "4fa2bc.svg",
  "slideIndex": 1,
  "width": 768,
  "height": 768,
  "mimeType": "image/svg+xml",
  "size": 18234
}

Export TikZ POST /api/render-tikz

bash
curl -X POST https://api.dajiaoai.com/api/render-tikz \
  -H "Authorization: Bearer djo_xxx" \
  -H "Content-Type: application/json" \
  -H "x-request-id: render-tikz-demo-001" \
  -d '{
    "slideIndex": 1,
    "size": { "width": 768, "height": 768 },
    "camera": { "offset": { "x": 0, "y": 0 }, "scale": 1 },
    "content": {
      "metadata": { "version": "11" },
      "messages": [],
      "slides": [{ "definitions": [], "uvarMap": [], "styleSheet": {}, "doc": [] }]
    }
  }'

Returns 200 OK:

json
{
  "success": true,
  "url": "https://dl.easeplay.vip/dajiao-open/dev/mcp/customer-id/session-id/4fa2bc.tex",
  "filename": "4fa2bc.tex",
  "slideIndex": 1,
  "width": 768,
  "height": 768,
  "mimeType": "text/plain",
  "size": 9631
}

Error responses

StatusCause
400Invalid parameters or content does not conform to the Dino Geometry file protocol
401Invalid API key

Billing

  • Billing type: render
  • Cost per call: see API Billing
  • Charge rule: deducted on successful execution