> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modelslab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Image

> Fetch Queued Images API fetches queued images from stable diffusion.

<Note>
  This endpoint does not generate new images, it returns already generated/queued images.
</Note>

## Request

Send a `POST` request to below endpoint to return the corresponding queued images.

```curl curl theme={null}
--request POST 'https://modelslab.com/api/v6/realtime/fetch/{id}' \
```

## Body

```json json theme={null}
{ 
    "key": "your_api_key"
}
```


## OpenAPI

````yaml POST /realtime/fetch/{id}
openapi: 3.1.0
info:
  title: ModelsLab Real-Time Stable Diffusion API
  description: >-
    A comprehensive API for real-time AI-driven image generation, including
    text-to-image, image-to-image, inpainting, and fetching queued results.
  license:
    name: MIT
  version: 6.0.0
servers:
  - url: https://modelslab.com/api/v6
    description: Real-Time Stable Diffusion API v6 server
security: []
paths:
  /realtime/fetch/{id}:
    post:
      summary: Fetch queued images (Real-Time)
      description: >-
        Fetches queued images from real-time stable diffusion processing.
        Usually, more complex image generation requests take more time and are
        queued. This endpoint allows retrieving results for already processed or
        currently processing requests.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: >-
            The ID returned with the image URL in the response upon its
            generation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RealtimeFetchRequest'
      responses:
        '200':
          description: Fetched image response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: >-
                      #/components/schemas/RealtimeImageGenerationSuccessResponse
                  - $ref: >-
                      #/components/schemas/RealtimeImageGenerationProcessingResponse
                  - $ref: '#/components/schemas/RealtimeImageGenerationErrorResponse'
        '400':
          $ref: '#/components/responses/StandardErrorResponse'
        '401':
          $ref: '#/components/responses/StandardErrorResponse'
        '404':
          $ref: '#/components/responses/StandardErrorResponse'
        '500':
          $ref: '#/components/responses/StandardErrorResponse'
components:
  schemas:
    RealtimeFetchRequest:
      type: object
      required:
        - key
      properties:
        key:
          type: string
          description: Your API Key used for request authorization.
    RealtimeImageGenerationSuccessResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
          description: Status of the image generation.
        generationTime:
          type: number
          description: Time taken to generate the image in seconds.
        id:
          type: integer
          description: Unique identifier for the image generation request.
        output:
          type: array
          items:
            type: string
            format: uri
          description: Array of generated image URLs.
        proxy_links:
          type: array
          items:
            type: string
            format: uri
          description: Array of proxy image URLs.
        meta:
          type: object
          description: Metadata about the image generation including all parameters used.
          additionalProperties: true
        nsfw_content_detected:
          type: boolean
          description: Indicates if NSFW content was detected in the generated image.
    RealtimeImageGenerationProcessingResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - processing
          description: Status of the image generation.
        tip:
          type: string
          description: Information about faster processing options.
        eta:
          type: number
          description: Estimated time for completion in seconds.
        message:
          type: string
          description: Processing status message.
        fetch_result:
          type: string
          format: uri
          description: URL to fetch the result when processing.
        id:
          type: integer
          description: Unique identifier for the image generation request.
        output:
          type: array
          items:
            type: string
          description: Empty array during processing.
        meta:
          type: object
          description: Metadata about the image generation including all parameters used.
          additionalProperties: true
        future_links:
          type: array
          items:
            type: string
            format: uri
          description: Array of future image URLs for queued requests.
    RealtimeImageGenerationErrorResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
          description: Error message description.
  responses:
    StandardErrorResponse:
      description: >-
        Bad request (invalid parameters), unauthorized (invalid API key), or
        internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RealtimeImageGenerationErrorResponse'

````