- Account
- Direct Generation
- Workflows
- Workflow Builder
- Workflow Runs
Check credits and estimate cost before kicking off expensive jobs.
get_balance
Check the user’s current Magica credit balance. Returns the raw microcredit value plus a human-readable string.
get_pricing
Get the cost structure for a model, or compute the exact credit cost for a sample input. Purely informational — credits are charged automatically by
execute_tool.The primary one-shot path for image, video, audio, TTS, lipsync, and transcription. Use these instead of building a workflow for single-step generation.
search_tools
Browse the model catalog grouped by category (text-to-image, text-to-video, image-to-video, lipsync, TTS, music, sound effects, transcription, …). Returns model IDs.
get_model_schema
Get the full input parameter schema for a model — types, defaults, conditional fields, ranges. Required before calling
execute_tool with an unfamiliar model.execute_tool
Run a generation or utility tool. Routes via
tool_name: generate, batch_execute, merge_videos, extract_audio, and more. The single one-shot generation tool.get_run_status
Long-poll a run by ID. Returns the final result or a still-running response to call again. Replaces the older
get_run / get_model_run.upload_file
Upload an image / video / audio / raw file to permanent Magica storage. Accepts
url, data_uri, or base64. Returns a stable URL + metadata.get_generations
Browse the user’s recent media-library items (generated assets + uploads). Paginated — uses a ‘Load more’ widget rather than refetching.
Typical flow:
search_tools → get_model_schema(modelId) → execute_tool({ tool_name: "generate", input: { modelId, … } }) → (if needed) get_run_status(runId).Manage saved workflows and browse pre-built templates.
list_system_workflows
Browse pre-built workflow templates. Filter by category: image, video, audio, utility, llm.
list_workflows
List the user’s saved workflows with optional search and pagination. Returns id, name, updatedAt.
get_workflow
Get full details of a workflow including nodes, edges, description, and timestamps.
create_workflow
Create a new workflow with Request and Response scaffold nodes. Optionally add request input fields.
update_workflow
Rename or update a workflow’s metadata. Does not modify nodes or edges.
delete_workflow
Permanently delete a workflow by ID. This action cannot be undone.
Programmatically build and edit workflow graphs.See Building Workflows for step-by-step examples.
list_node_types
List available node types with their input/output ports, data types, categories, and modes. Use to discover what nodes can be added.
add_node
Add a workflow step. Supports column/row positioning and initial input values. Returns the new node ID and its ports.
update_node
Update input values on an existing node without removing it or its edges.
connect_nodes
Create a validated edge between two nodes. Checks type compatibility, prevents cycles, enforces single-input rules.
disconnect_nodes
Remove an edge between two nodes by edge ID or source/target pair.
delete_node
Remove a node from a workflow. All connected edges are cleaned up automatically. Cannot delete scaffold nodes (Request, Response).
Start, monitor, and cancel workflow runs.See Runs & Execution for request-node handling, polling patterns, and the run result shape.
start_run
Start a workflow run by ID or name. Searches user workflows first, falls back to system workflows. Validates Request Node fields automatically.
list_runs
List workflow runs with optional filters (workflow, status, search) and cursor or page-based pagination.
cancel_run
Cancel a running or queued workflow run. Refunds unused estimated credits.
To check the status or result of a workflow run, use
get_run_status from the Direct Generation tab — it handles both workflow runs and one-shot generations.