Docs

Operate Mini AI Studio like a production system.

A practical guide to building reusable Pro workflows, preparing templates, controlling GPU runtime, and integrating recipe-based session creation.

Start

Quick start

01

Create a session

Open Pro Studio, choose Blank workflow or a workflow template, then name the session so it is easy to find later.

02

Add inputs

Use Text, Upload Photo, Upload Video, or Upload Audio nodes as stable sources. Keep reusable source material in the session instead of rebuilding it.

03

Connect typed sockets

Drag from an output socket to a compatible input socket. Image, video, audio, text, media, and GPU trigger sockets use separate colors so incompatible links are visible before you run.

04

Run and refine

Run the whole workflow for the first pass. After that, rerun a single node when only one step needs a different prompt, seed, or media input.

05

Save the recipe

Group the nodes that form a repeatable branch, then use loops or templates when the same structure should be reused across variants.

Concepts

Core concepts

Session

A saved workspace containing the graph, node settings, media, viewport, tabs, sharing state, and execution history.

Node

A unit of work: upload, prompt, generation, utility processing, loop control, comment, or GPU runtime control.

Socket

A typed input or output. Connections describe what value moves from one node to another and which backend field receives it.

GPU Control

The runtime gate for GPU-heavy nodes. GPU nodes are auto-wired to it so users can see and control paid runtime explicitly.

Gallery

Generated and uploaded media that can be previewed, reused, downloaded, or selected as input for another workflow.

Recipe

A server-side workflow template that creates a session from validated inputs. Recipes are ideal for onboarding and repeatable production flows.

Nodes

Working with nodes

Nodes should be treated as reusable production steps. Keep source inputs explicit, connect only compatible socket types, and make important model parameters visible in the Inspector so a teammate can understand the workflow later.

Text Refiner

Use presets for image, video, music, lyrics, translation, summarization, rewriting, keywords, or custom instructions. The system prompt and negative prompt are editable so teams can tune behavior without changing backend code.

Image and video generation

Connect source media and text, then tune exact template controls such as seed, steps, CFG, denoise, resolution, FPS, and negative prompts.

Upload nodes

Upload nodes resize around their content, support selected/random outputs, and can feed any compatible downstream node.

Utility nodes

Frame extract, trim, split, mux, and text overlay nodes keep final assembly inside the workflow instead of forcing external tools.

Comments and groups

Use comments for production notes and groups for branches that move together, rerun together, or become loop targets.

Loops

Loops and variants

Use Loop when a branch already works and you want structured variants: camera angles, languages, products, seeds, durations, prompts, or model controls. Select a group, add iterations, then override only the fields that should change for each pass.

  • Loop rows store overrides per node, so one node's seed or prompt does not leak into another node.
  • Dynamic Camera derives the exact backend prompt from azimuth, elevation, and distance for every iteration.
  • Disabled iterations are ignored during execution, which lets teams keep draft variants without deleting them.
  • Rerun the loop node to apply loop settings; rerun an individual member only when you intentionally want an isolated run.
Auth

API keys

Users can manage personal API keys from /profile in the API Key tab. API keys use the mas_ prefix and authenticate as the key owner, so recipes, sessions, billing, media, and sharing permissions behave exactly like the web account.

GET/api/v2/account/api-key

Read whether API access is enabled and show the current safe key prefix.

PUT/api/v2/account/api-key

Enable or disable the current user's API key.

POST/api/v2/account/api-key/regenerate

Issue a new mas_ key. The full secret is returned once and must be copied immediately.

API

Recipes API

Recipes create ready-made workflow sessions from validated input. They are the right integration point for templates, onboarding flows, and external systems that should open a prepared canvas for the user.

GET/api/v2/recipes

List available workflow recipes with metadata and input schemas.

GET/api/v2/recipes/{id}

Inspect one recipe: name, description, version, inputs, and JSON Schema.

POST/api/v2/recipes/{id}/run

Create a session from a recipe. Set execute=false to open the prepared workflow without running it.

Create from recipe
POST /api/v2/recipes/image_magic/run
Authorization: Bearer <token>
Content-Type: application/json

{
  "session_name": "Product hero variants",
  "execute": false,
  "inputs": {
    "source_image_url": "https://example.com/product.png",
    "edit_prompt": "premium studio lighting on a dark reflective surface",
    "negative_prompt": "blur, watermark, distorted logo",
    "seed": 0
  }
}
Response
{
  "session_id": "72494ed2-73ad-4baa-9bf3-5f09a3efde7a"
}

Use execute: false when the user should inspect or edit the workflow first. Use execute: true only when all required inputs are final and the account is ready for GPU runtime.

Bundled recipes

prompt_to_avatar

Create avatar from prompt

Generate a character or brand avatar from text.

image_magic

Edit image by instruction

Start from an image and describe the change.

prompt_to_video

Animate image

Turn a still image into a short motion clip.

video_add_vfx

Add video effects

Apply atmosphere, VFX, or scene changes to a video.

image_upscaler

Upscale image

Increase image resolution and detail.

image_in_paint

Inpaint image

Retouch, replace, or fill part of an image.

face_swap

Image face swap

Swap a face into a still image.

video_face_swap

Video face swap

Apply a face reference across a video.

video_face_swap_precise

Precise video face swap

Use a higher-control face swap workflow.

music_generator

Generate music

Create music from style notes, mood, tempo, and lyrics.

text_overlay

Add text overlay

Place titles, captions, or labels onto image/video.

media_split

Separate video and audio

Split a video into separate visual and audio tracks.

media_mux

Add audio to video

Combine a video track with audio.

frame_extract

Extract video frame

Pull a clean still from a video.

video_trim

Trim video

Cut a video to the exact segment needed.

prompt_refine

Refine text prompt

Improve rough prompts for creative generation.

depth_extractor

Create depth map

Generate a depth reference from an image.

pose_extractor

Create pose reference

Extract a pose guide from an image.

dynamic_camera_rendering

Change camera angle

Recreate an image from a new camera angle.

SDK

Go SDK

The Go SDK is a small stdlib-only client for the Mini AI Studio /api/v2 API. Use it for server-side integrations, automation jobs, recipe-based onboarding, and internal tools that need to create sessions, run workflows, poll progress, and read outputs.

go.mod
require miniaistudio-go-sdk v0.0.0

replace miniaistudio-go-sdk => ./miniaistudio
Create a session from a recipe
ctx := context.Background()
c := &miniaistudio.Client{APIKey: os.Getenv("MINIAI_API_KEY")}

created, err := c.CreateSessionFromRecipe(ctx, "prompt_to_avatar", map[string]any{
    "prompt": "a cinematic avatar portrait",
}, "Avatar workflow")
if err != nil {
    log.Fatal(err)
}

fmt.Println(created.SessionID)
Run, poll, and read outputs
run, err := c.RunRecipe(ctx, "prompt_to_avatar", miniaistudio.RunRecipeRequest{
    Inputs:  map[string]any{"prompt": "a portrait"},
    Execute: true,
})
if err != nil {
    log.Fatal(err)
}

raw, err := c.PollSession(ctx, run.SessionID, 2*time.Second, done)
outputs, err := miniaistudio.ParseExecutionOutputs(raw)
images := outputs.FlattenImages()
Authentication

Set Client.APIKey for user API keys such as mas_..., or Client.Token for a login JWT. Session-scoped methods send X-Session-ID automatically where required.

Recipes

ListRecipes, GetRecipe, CreateSessionFromRecipe, RunRecipe

Sessions

NewSession, PutStudioFlow, GetSession, PollSession

Execution

ExecuteFull, StopSession, CancelNodeExecution

Outputs

ParseExecutionOutputs, GetSessionExecution, FlattenImages, FlattenVideos, FlattenAudios

Uploads

UploadStudioFile, AbsoluteURL

LoRAs

ListLoRAs, ResolveLoRAChain, ResolveLoRAChainByFilename

Billing

GetBalance

GPU

Ping, GetGPUSchedulerHealth, GetGPUStatus, StartGPU, StopGPU

API

Media API

Media endpoints expose the same generated and uploaded assets shown in My Gallery and the dashboard gallery picker. Use media ids for downloads rather than raw URLs so access checks stay server-side.

GET/api/v2/media

List generated and uploaded media grouped by session. Supports media_type, pagination, date range, and include_shared=true.

GET/api/v2/media/sessions/{session_id}

List all media for one accessible session.

POST/api/v2/media/download-zip

Download selected media by id as a zip archive. The ids array must be non-empty.

Teams

Sharing API

Sharing is role-based. Viewers can inspect, runners can execute, and editors can modify the graph. Owners can set monthly or total credit limits for collaborators before inviting them.

POST/api/v2/session/{id}/share

Invite a collaborator by email with viewer, runner, or editor access and optional credit limits.

GET/api/v2/session/{id}/shares

List accepted and pending collaborators for a session.

PATCH/api/v2/session/share/{shareId}

Change role or credit-limit settings for an existing share.

DELETE/api/v2/session/share/{shareId}

Revoke a collaborator's access.

GET/api/v2/invitations

List invitations for the signed-in user.

POST/api/v2/invitations/{shareId}/accept

Accept an invitation and gain access to the shared session.

API

Execution API

Execution endpoints operate on the active session. Send X-Session-ID and the authenticated bearer token. Backend errors include a stable code field so clients can localize messages without parsing English text.

POST/api/v2/session/execute

Run the active session. Body: { mode: "full" } or { mode: "from_node", target_node_id }.

POST/api/v2/session/nodes/{nodeId}/rerun?isolated=true

Rerun one node without rebuilding unrelated branches.

POST/api/v2/session/nodes/{nodeId}/cancel

Cancel a queued or running node.

POST/api/v2/session/stop

Stop workflow execution and leave saved session state intact.

Billing

GPU billing

GPU-heavy nodes require runtime. Mini AI Studio tracks active GPU sessions, elapsed paid time, task count, expiry, and estimated refund if the user stops early.

GET/api/v2/billing/balance

Read available, reserved, and total credits.

POST/api/v2/billing/payment-intent

Create a Stripe checkout session for credit top-up.

GET/api/v2/billing/usage-history

List GPU-minute usage records.

GET/api/v2/billing/gpu-active

Read the active smart-billing session, elapsed time, and refund estimate.

GET/api/v2/gpu/status

Read GPU readiness, state, and task acceptance status.

POST/api/v2/gpu/start

Request GPU startup for generation workloads.

POST/api/v2/gpu/stop

Request graceful or immediate GPU shutdown.

  • Start GPU from the GPU Control node or let a GPU workflow request it during execution.
  • Use the billing page for balance, GPU session history, invoices, and checkout top-ups.
  • For large production runs, contact sales before running so capacity, runtime, and workflow shape can be planned.
Errors

Error codes

API errors include a stable code field when possible. Client applications should translate from that code and avoid parsing English message text.

UNAUTHORIZED / AUTHORIZATION_HEADER_REQUIRED

The request is missing a valid bearer token.

FORBIDDEN

The user is authenticated but the current role cannot perform the action.

SCHEMA_VALIDATION / INVALID_INPUTS

Recipe inputs failed validation. Check the recipe input_schema.

MISSING_SESSION_ID

A session-scoped endpoint needs X-Session-ID or a session cookie.

SESSION_NOT_FOUND

The session does not exist or the current user does not have access.

INSUFFICIENT_BALANCE / BILLING_UNAVAILABLE

Credits or billing service state prevents GPU execution.

CREDIT_LIMIT

A shared-user credit limit blocks the run.

NO_ACCESSIBLE_MEDIA / NO_IDS

Media download ids are missing or inaccessible.

Support

Troubleshooting

Node will not run

Check required sockets, missing uploads, empty prompts, GPU readiness, and account balance. The Inspector lists connected and missing inputs.

Output is not what you expected

Inspect the exact node settings, negative prompt, selected media index, and whether a loop override changed the run.

Recipe creation failed

Read the backend error code, validate the recipe input schema, and confirm required URLs or text inputs are present.

Billing error

Open Billing to confirm available balance and active GPU sessions. If the project is large, contact sales for capacity planning.