NexGen Cloud Image Generation API

Text-to-image and image-to-image generation. Submit a generation or edit request, then poll the task endpoint to retrieve the resulting image. Use a presigned upload URL to supply a source image for edits.

GitHub OpenAPI
Business capability
Generative Media AE-110.20

Operations 4

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /images/generations Generate an image from a text prompt · Generate image from text #
Ask an LLM
“How do I turn a text description into an image with a text-to-image model?”
“Can I generate several images from one prompt and set the guidance scale?”
Tell an agent
Generate an image from the prompt {prompt} using model {model}.
Create {num_images} images of {prompt} with guidance scale {guidance_scale} on {model}.
POST /images/edits Edit an image with a text prompt · Generate image from image #
Ask an LLM
“How do I change an existing image by describing edits to it?”
“Can I apply a negative prompt when editing an image with a prompt?”
Tell an agent
Edit the image at {image_url} with the prompt {prompt} using model {model}.
Apply {prompt} to {image_url} with {model}, excluding {negative_prompt}.
GET /images/signed-url Get a URL to upload an image · Get image upload URL #
Ask an LLM
“Where do I upload a source image before editing it?”
“What does the image upload URL return for an image edit job?”
Tell an agent
Get an upload URL for a source image.
Give me a presigned S3 URL to upload the image I'll edit later.
GET /images/tasks/{job_id} Check an image generation or edit job · Get image result #
Ask an LLM
“Has my generated image finished yet?”
“Where do I get the images once an edit job completes?”
Tell an agent
Check the status of image job {job_id}.
Poll generation job {job_id} until the images are ready.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nexgen-cloud:nexgen-cloud-image-generation-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nexgen-cloud-image-generation-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: AI Studio Image Generation API
  version: '0.1'
  description: 'The AI Studio API is a REST API for the full lifecycle of custom AI models on Hyperstack AI Studio: curate and generate training datasets, fine-tune foundation models on your data, evaluate training results, deploy models, and run inference.'
servers:
- url: https://console.hyperstack.cloud/ai/api/v1
security:
- apiKey: []
tags:
- name: Image Generation
  description: Text-to-image and image-to-image generation. Submit a generation or edit request, then poll the task endpoint to retrieve the resulting image. Use a presigned upload URL to supply a source image for edits.
paths:
  /images/generations:
    post:
      tags:
      - Image Generation
      operationId: generateImageFromText
      summary: Generate image from text
      description: 'Generates one or more images from a text prompt using a text-to-image model. This operation is asynchronous: the response returns a `job_id` with status `queued`. Poll Get image result until the status is `completed` to retrieve the generated images.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequestSchema'
            example:
              model: FLUX.1-schnell
              prompt: A red ceramic coffee mug on a wooden table, soft morning light
              num_images: 1
              image_size: square_hd
      responses:
        '200':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageJobAcceptedSchema'
              example:
                job_id: 256
                status: queued
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '422':
          description: Validation Error
  /images/edits:
    post:
      tags:
      - Image Generation
      operationId: generateImageFromImage
      summary: Generate image from image
      description: 'Generates an edited image from a source image and a text prompt using an image-to-image model. Supply the source image with `image_url` (an uploaded S3 filename from Get image upload URL, or a reachable URL). This operation is asynchronous: the response returns a `job_id` with status `queued`. Poll Get image result until the status is `completed` to retrieve the result. Requires an image-to-image model; text-to-image models return a `modality.incompatible` error.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageEditRequestSchema'
            example:
              model: FLUX.1-Kontext-dev
              prompt: Make the background a clear blue sky
              image_url: a1b2c3d4-e5f6-7890-abcd-ef1234567890
              num_images: 1
      responses:
        '200':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageJobAcceptedSchema'
              example:
                job_id: 257
                status: queued
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '422':
          description: Validation Error
  /images/signed-url:
    get:
      tags:
      - Image Generation
      operationId: getImageUploadUrl
      summary: Get image upload URL
      description: Returns a presigned S3 URL for uploading a source image. Upload the image bytes with an HTTP PUT to `signed_url`, then pass the returned `filename` as `image_url` in Generate image from image.
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageUploadUrlSchema'
              example:
                signed_url: https://ca1-dev.s3.nexgencloud.io/prod-image-bucket-ca1/a1b2c3d4-e5f6-7890-abcd-ef1234567890?X-Amz-Signature=...
                filename: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '422':
          description: Validation Error
  /images/tasks/{job_id}:
    get:
      tags:
      - Image Generation
      operationId: getImageResult
      summary: Get image result
      description: Returns the status and progress of an image generation or edit job. While the job runs, `status` is `queued` or `in_progress` with a `progress` percentage. Once `status` is `completed`, the `result` object contains the generated images. Poll this endpoint after submitting a request to Generate image from text or Generate image from image.
      parameters:
      - in: path
        name: job_id
        required: true
        schema:
          type: integer
        description: The `job_id` returned by [Generate image from text](https://docs.hyperstack.cloud/docs/ai-studio-api-reference/generate-image-from-text) or [Generate image from image](https://docs.hyperstack.cloud/docs/ai-studio-api-reference/generate-image-from-image).
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageTaskStatusSchema'
              example:
                status: completed
                result:
                  created: '2026-01-15T09:30:00.000000'
                  data:
                  - url: https://ca1-dev.s3.nexgencloud.io/prod-image-bucket-ca1/a1b2c3d4-e5f6-7890-abcd-ef1234567890.png
                    b64_json: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '422':
          description: Validation Error
components:
  schemas:
    ImageUploadUrlSchema:
      type: object
      required:
      - signed_url
      - filename
      properties:
        signed_url:
          type: string
          description: Presigned S3 URL. Upload the image bytes with an HTTP PUT to this URL.
        filename:
          type: string
          description: S3 key for the uploaded image. Pass this as `image_url` in [Generate image from image](https://docs.hyperstack.cloud/docs/ai-studio-api-reference/generate-image-from-image).
      title: ImageUploadUrlSchema
    ImageJobAcceptedSchema:
      type: object
      properties:
        job_id:
          type: integer
          description: Identifier of the asynchronous image job. Poll [Get image result](https://docs.hyperstack.cloud/docs/ai-studio-api-reference/get-image-result) to retrieve the result.
        status:
          type: string
          description: Initial job status, such as `queued`.
      title: ImageJobAcceptedSchema
    ImageTaskStatusSchema:
      type: object
      properties:
        status:
          type: string
          description: 'Job status: `queued` (accepted, not yet started), `in_progress` (generating, see `progress`), `completed` (result available in `result`), or `failed` (generation error).'
        progress:
          type: integer
          default: null
          description: Completion percentage from 0 to 100. Present while the job is in progress.
        result:
          allOf:
          - $ref: '#/components/schemas/ImageTaskResultSchema'
          default: null
          description: Generation result. Present once `status` is `completed`.
      title: ImageTaskStatusSchema
    ImageTaskResultSchema:
      type: object
      properties:
        created:
          type: string
          description: Timestamp when the result was produced.
        data:
          type: array
          items:
            $ref: '#/components/schemas/ImageData'
          description: Generated images.
      title: ImageTaskResultSchema
    ImageGenerationRequestSchema:
      type: object
      required:
      - model
      - prompt
      properties:
        model:
          type: string
          description: ID of the text-to-image model to use, such as `FLUX.1-schnell`. Use the `model_name` from [List base models](https://docs.hyperstack.cloud/docs/ai-studio-api-reference/get-base-models); the model must support the `text-to-image` modality.
        prompt:
          type: string
          description: Text description of the image to generate.
        negative_prompt:
          type: string
          default: null
          description: Text describing what to exclude from the generated image.
        image_size:
          type: string
          default: square_hd
          description: Output image size, as an aspect-ratio preset or an explicit `WIDTHxHEIGHT` value.
          x-enumDescriptions:
            '`square_hd`': Square output, high resolution.
            '`square`': Square output (1:1).
            '`portrait_4_3`': Portrait output, 3:4 aspect ratio.
            '`portrait_16_9`': Portrait output, 9:16 aspect ratio.
            '`landscape_4_3`': Landscape output, 4:3 aspect ratio.
            '`landscape_16_9`': Landscape output, 16:9 aspect ratio.
        num_images:
          type: integer
          default: 1
          description: Number of images to generate.
        num_inference_steps:
          type: integer
          default: null
          description: Number of denoising steps. Higher values can improve quality at the cost of speed.
        guidance_scale:
          type: number
          default: null
          description: How closely the result follows the prompt. Higher values follow the prompt more strictly.
        seed:
          type: integer
          default: null
          description: Random seed for reproducible results.
        scheduler:
          type: string
          default: null
          description: Sampler or scheduler to use, when supported by the model.
        output_format:
          type: string
          enum:
          - png
          - jpeg
          - webp
          default: null
          description: Format of the returned image.
          x-enumDescriptions:
            '`png`': Returns a lossless PNG image.
            '`jpeg`': Returns a smaller, lossy JPEG image.
            '`webp`': Returns a compact WebP image.
        preset:
          type: string
          default: null
          description: Named quality or style preset, when supported by the model.
      title: ImageGenerationRequestSchema
    ImageEditRequestSchema:
      type: object
      required:
      - model
      - prompt
      properties:
        model:
          type: string
          description: ID of the image-to-image model to use, such as `FLUX.1-Kontext-dev`. Use the `model_name` from [List base models](https://docs.hyperstack.cloud/docs/ai-studio-api-reference/get-base-models); the model must support the `image-to-image` modality.
        prompt:
          type: string
          description: Text description of the edit to apply to the source image.
        image_url:
          type: string
          default: null
          description: URL or S3 filename of the source image to edit. Pass the `filename` returned by [Get image upload URL](https://docs.hyperstack.cloud/docs/ai-studio-api-reference/get-image-upload-url) after uploading, or a publicly reachable image URL.
        image_urls:
          type: array
          items:
            type: string
          default: null
          description: Multiple source images to edit, as URLs or S3 filenames returned by [Get image upload URL](https://docs.hyperstack.cloud/docs/ai-studio-api-reference/get-image-upload-url). Use instead of `image_url` when the model accepts several inputs.
        negative_prompt:
          type: string
          default: null
          description: Text describing what to exclude from the result.
        image_size:
          type: string
          default: square_hd
          description: Output image size, as an aspect-ratio preset or an explicit `WIDTHxHEIGHT` value.
          x-enumDescriptions:
            '`square_hd`': Square output, high resolution.
            '`square`': Square output (1:1).
            '`portrait_4_3`': Portrait output, 3:4 aspect ratio.
            '`portrait_16_9`': Portrait output, 9:16 aspect ratio.
            '`landscape_4_3`': Landscape output, 4:3 aspect ratio.
            '`landscape_16_9`': Landscape output, 16:9 aspect ratio.
        num_images:
          type: integer
          default: 1
          description: Number of images to generate.
        num_inference_steps:
          type: integer
          default: null
          description: Number of denoising steps. Higher values can improve quality at the cost of speed.
        guidance_scale:
          type: number
          default: null
          description: How closely the result follows the prompt. Higher values follow the prompt more strictly.
        output_format:
          type: string
          enum:
          - png
          - jpeg
          - webp
          default: null
          description: Format of the returned image.
          x-enumDescriptions:
            '`png`': Returns a lossless PNG image.
            '`jpeg`': Returns a smaller, lossy JPEG image.
            '`webp`': Returns a compact WebP image.
        preset:
          type: string
          default: null
          description: Named quality or style preset, when supported by the model.
      title: ImageEditRequestSchema
    ImageData:
      type: object
      properties:
        url:
          type: string
          default: null
          description: URL of the generated image. Populated when the output is returned as a URL.
        b64_json:
          type: string
          default: null
          description: Base64-encoded image. Populated instead of `url` when base64 output is requested.
      title: ImageData
    ErrorSchema:
      properties:
        code:
          default: null
          type: integer
          description: HTTP status code associated with the error.
        message:
          type: string
          default: null
          description: Human-readable description of the error.
        status:
          type: string
          default: null
          description: Indicates the result of the operation. Typically `"error"` for failed requests.
      title: ErrorSchema
      type: object
  securitySchemes:
    apiKey:
      type: apiKey
      name: api_key
      in: header
      description: 'API-key authentication. Pass your API key as the `api_key` header value (e.g., `api_key: YOUR_API_KEY`, no prefix). [Generate a key in the Hyperstack console](https://console.hyperstack.cloud/api-keys). The key is personal to your user account and works across every environment and region in your organization.'
x-provenance:
  method: harvested
  publisher: NexGen Cloud
  source: https://docs.hyperstack.cloud/openapi/ai-studio.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)