SDK task catalog and parameters

Both Python and the CLI can list the tools available to your account. Use the catalog returned by the server when you choose a task or show a list of tools to users.

Vmake Labs SDK v2.0.3 saves the group ID (gid) returned by the config request to ~/.cache/mtai/gid.json and reuses it in later requests.

List the task catalog

In Python, read tool entries from the returned entries.

from action_api_sdk import SkillClient

for tool in SkillClient().get_task_catalog()["entries"]:
    print(tool["material_id"], tool["name"])

In a terminal, you can filter the catalog by media type.

action-api-sdk catalog
action-api-sdk catalog --media-type video

In the V2 catalog returned by the CLI, tasks is the list of tools and count is the number of entries returned. Each entry has these fields:

FieldPurpose
material_idThe ID to pass to --task when running a task, such as SKM0006
name, descriptionIdentify the tool and what it does
media_typeMedia type, such as image or video
input_mediaPresent when the tool sets input limits, such as min_count and max_count
params_schemaPresent when the tool publishes a schema for its parameters

In Python, each item in entries also includes the task path (task), task type (task_type), default parameters (params), and, when the server provides one, the input profile (profile).

Set task parameters

run-task uses the parameters provided by the server. To change them, pass the fields to override as a JSON object to --params. For example, image watermark removal can return a result URL:

action-api-sdk run-task --task SKM0006 --input "./input.jpg" \
  --params '{"parameter":{"rsp_media_type":"url"}}'

Your overrides are deep-merged into the server defaults. To override the server-provided input profile, pass a JSON object to --profile. In Python, pass the same structures to the params and profile arguments of run_task.

When the catalog includes params_schema, the SDK checks the merged parameters before it downloads or uploads media or consumes quota. Schema defaults are not filled in for you, parameter.repost_url cannot be set, and parameter.rsp_media_type is not checked. Failures return invalid_task_parameters with a detail message. See Python SDK and CLI errors.

Get allowed values for a field

If a field in params_schema has options_source, query its full list of allowed values before you choose one. Pass the field as a JSON Pointer from the root of params. This does not upload media or consume quota.

action-api-sdk params-field-options --task "<material_id>" --field-path /parameter/material_id
from action_api_sdk import SkillClient

print(SkillClient().get_params_field_options("<material_id>", "/parameter/material_id"))

Pass multiple inputs

A tool without input_media takes exactly one input. When input_media allows more, repeat --input in order, or pass a list to image_path in Python. With min_count: 0 you can omit the input, and max_count: null means no upper limit. The SDK checks only the count. The server checks media types and content.

action-api-sdk run-task --task "<material_id>" \
  --input ./first.jpg --input ./second.jpg

The SDK uploads every input before it consumes quota once and submits the task once. In Python, a list item can also be an object with source, media_type, and profile, which helps when a URL has no file extension. The top-level profile argument applies only to the first input.

For tool-specific fields and limits, see each tool page. For the full HTTP config response, endpoint, and field definitions, see Get config.