---
title: "Retrieve AI request"
method: GET
path: "/api/ai-requests/{requestId}"
---

# Retrieve AI request

`GET /api/ai-requests/{requestId}`

## Path parameters

- `requestId` string, required

## Query parameters

- `returnFile` 'true' | 'false'

## Response `200`

The AI request details or PNG image file

- object
  - `id` string — ID of the AI request
  - `inputs` union[] — Array of inputs used for the AI request
    - union
      - object — An AI request with just a simple text prompt
        - `type` 'text'
        - `text` string — The input text or prompt
      - object — An AI request with file attachments (images, PDFs)
        - `type` 'attachment'
        - `storageId` string — Storage ID of the attachment
        - `filename` string — Name of the attached file
        - `mimeType` string — MIME type of the attachment
      - object — An AI request with a pre-configured reference library as context
        - `type` 'context'
        - `contextId` string — ID of the reference library context
      - object — An AI request with a Git repository context
        - `type` 'repository'
        - `repository` string — Name of the repository
        - `organization` string — Name of the organization or owner
        - `provider` string — Git provider (e.g., github, gitlab)
  - `outputs` object[] — Array of generated diagram outputs
    - `type` 'diagram'
    - `diagramType` 'sequence-diagram' | 'entity-relationship-diagram' | 'cloud-architecture-diagram' | 'flowchart-diagram' | 'bpmn-diagram', nullable — Type of the generated diagram
    - `code` string — The generated Eraser DSL code for the diagram
    - `diagramTitle` string — Title of the generated diagram
    - `imageUrl` string — URL of the generated diagram as a PNG image
  - `mode` 'standard' | 'premium' — AI mode used for generation

## Other responses

- `400` — The request is missing required parameters
- `403` — Insufficient permissions to access this AI request
- `404` — AI request not found or PNG file not available
- `500` — Server error

---

[API](https://skmtc.net/eraser/apis/render.md) · [All operations](https://skmtc.net/eraser/apis/render/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/eraser/render/versions/c31350b435dc/schema)
