list_models,
get_model, get_job_status, get_credit_balance) and the two model-management
tools (create_model, update_model). The other nine cost
credits from your organization’s pool, at the same rates as the
app and REST API.
A tool call rejected for a missing scope returns a structured tool error (not a
crash) naming the scope it needs. Keys are created with all scopes by default;
an admin can narrow or widen a key in Settings → API Keys.
Parameters
list_models(category?)
list_models(category?)
category(optional) — filter to one ofstyle,object,person,setting.
id, name, category,
and a presigned thumbnail_url. Use the ids or names as style_id /
object_ids / person_ids / setting_ids in generate_image and
generate_video — a name resolves to a model visible to you.get_model(model_id)
get_model(model_id)
model_id(required) — the model’s id.
create_model(name, category, images, …)
create_model(name, category, images, …)
name(required) — the model name.category(required) — one ofstyle,object,person,setting.images(required) — 1–10 reference images. Each is either a publichttpsURL or an inline base64 data URI (data:image/png;base64,…) —image/jpeg,image/png, orimage/webp, ≤ 10 MB each.instruction(optional) — the model’s always-applied guidance (≤ 8000 chars), injected as mandatory (“MUST FOLLOW”) direction into every generation that composes the model. See Model Training.webhook_url(optional) — anhttpsURL notified once when training reaches a terminal status.
{ id, status: "pending", estimated_credits }
immediately; poll get_job_status(kind="model", id=…) (which also needs the
models.read scope) until completed or failed, then use the model id in
generate_image / generate_video.
Free — model creation deducts no credits. Large-file presigned uploads are
REST-only (not exposed over MCP) — use
POST /models/prepare for those.update_model(model_id, …)
update_model(model_id, …)
model_id(required) — the model to update.name(optional) — a new model name.default_prompt(optional) — a new default prompt.instruction(optional) — the model’s always-applied guidance (≤ 8000 chars). Send an empty string to clear it.
name, default_prompt, or instruction; omitted
fields are left unchanged. Synchronous — returns the full updated model
immediately (same shape as get_model). Free.generate_image(prompt, …)
generate_image(prompt, …)
prompt(required) — the text prompt.style_id,object_ids,person_ids,setting_ids(optional) — trained model ids or names fromlist_modelsto compose (a name resolves to a model visible to you).color_palette(optional) — a color palette to apply, given as its name or id (same as the trained-model refs).num_outputs(1–4, default1),aspect_ratio(default"1:1"),resolution(default"1K";1K/2K/4K).
aspect_ratio accepts 1:1 (default), 2:3, 3:2, 3:4, 4:3, 4:5,
5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, and 8:1.Async — returns { id, status: "pending", estimated_credits }
immediately. Cost: 5 × num_outputs × resolution (1K ×1, 2K ×2, 4K ×4),
deducted at submit.edit_image(prompt, …)
edit_image(prompt, …)
prompt(required) — how to edit the image.- Exactly one of
image_id(an image in your Samsa context) orimage_url(a public https URL). style_id,object_ids,person_ids,setting_ids(optional) — trained model ids or names fromlist_modelsto reuse for on-brand edits (a name resolves to a model visible to you), at parity withgenerate_image.color_palette(optional) — a color palette to apply, given as its name or id.engine(optional) —nano_banana_pro(default),gemini, orkontext. Supplying any trained-model ref or a color palette forcesnano_banana_pro.
{ id, status: "pending", estimated_credits }. Cost: 5
credits per output (nano_banana_pro scales with resolution: 1K ×1, 2K
×2, 4K ×4), deducted at submit.img2img(prompt, images, …)
img2img(prompt, images, …)
prompt(required) — how to transform the sources.images(required) — 1–14 sources; each item is either{ image_id }or{ image_url }(an https URL). Source order is preserved. No base64 over MCP — see Image inputs.engine(optional) —nano_banana_pro(default) ornano_banana_2.aspect_ratio(optional) — validated against the engine’s list (nano_banana_2additionally allows4:1,1:4,8:1,1:8); omitted preserves the source shape.resolution(1Kdefault,2K,4K),num_outputs(default1).
get_job_status(kind="img2img", id=…). Cost:
5 × num_outputs × resolution (1K ×1, 2K ×2, 4K ×4). Scope
images.edit.create_variations(image_id | image_url, …)
create_variations(image_id | image_url, …)
- One of
image_idorimage_url(required). target(optional) — what may change:everything(default),person,object,scene.creativity(optional) —subtleorcreative(default).variation_instructions/preservation_instructions(optional) — free text, ≤ 2000 chars each.num_outputs(1–4, default1).
resolution
argument). Async — poll get_job_status(kind="image_variation", id=…).
Cost: 5 × num_outputs × source resolution (1K ×1, 2K ×2, 4K ×4; a
source with no recoverable dimensions prices at 1K). Scope
images.transform.resize_image(aspect_ratio, image_id | image_url, …)
resize_image(aspect_ratio, image_id | image_url, …)
aspect_ratio(required) — one of21:9,16:9,3:2,4:3,5:4,1:1,4:5,3:4,2:3,9:16.- One of
image_idorimage_url(required). resolution(1Kdefault,2K,4K),num_outputs(1–4, default1).prompt(optional) — guidance for the newly exposed area.placement(optional) —{ gravity, scale }positioning the source on the canvas (gravityone ofcenter[default],top,bottom,left,right,top_left,top_right,bottom_left,bottom_right;scalein(0, 1]).
prompt is given, it returns
the flattened image and refunds the unused outputs. Async — poll
get_job_status(kind="image_resize", id=…). Cost: 5 × num_outputs × resolution. Scope images.transform.upscale_image(target_resolution, image_id | image_url, …)
upscale_image(target_resolution, image_id | image_url, …)
target_resolution(required) —2K,4K,6K,8K,10K,12K,14K,16K,20K,24K,28K,32K,38K(classes above16Karecrystal-only).- One of
image_idorimage_url(required). model(optional) —seedvr,crystal(default),magnific-creative,magnific-precision.options(optional) — per-model, strictly validated:options.magnific_creative(prompt,optimized_for,creativity/hdr/resemblance/fractalityin −10..10,engine) oroptions.magnific_precision(sharpen/smart_grain/ultra_detailin 0..100,flavor).seedvr/crystaltake no options.
get_job_status(kind="image_upscale", id=…). Cost: the resolution tier ×
the model multiplier (Magnific ×3); crystal above 12K prices by output
megapixels — see pricing. Scope images.transform.remove_background(image_id | image_url)
remove_background(image_id | image_url)
- One of
image_idorimage_url(required).
get_job_status(kind="image_background_removal", id=…). Cost: 1 credit on
a miss; 0 on a cache hit — an owned image_id that already has a
background-removed result returns { status: "completed", estimated_credits: 0 }
right away. Scope images.transform.vectorize_image(svg_acceptance, image_id | image_url)
vectorize_image(svg_acceptance, image_id | image_url)
svg_acceptance(required) — must be the literal booleantrue.- One of
image_idorimage_url(required).
422 svg_acceptance_required and nothing is
charged. Delivery also requires your organization to have accepted the current
ToS/AUP (verified server-side); if not, the call is rejected
403 svg_phase1_scope_out_required with no charge. Async — poll
get_job_status(kind="image_vectorize", id=…). Cost: 5 on a miss; 0 on
a cache hit. Scope images.transform.generate_video(mode, …)
generate_video(mode, …)
mode(required) — one of:image_to_video— animate a start frame. Requires exactly one ofimage_id/image_url; optionalend_image_urlon end-frame-capable engines;promptoptional.text_to_video— requiresprompt.text_to_video_styled— requirespromptandstyle_id;object_ids/person_ids/setting_idsoptional, plus an optionalcolor_palette(name or id).
engine(defaultveo_3_1_lite),duration(default: the engine’s shortest supported duration, in seconds),aspect_ratio(default"16:9"; also9:16,1:1).
{ id, status: "pending", estimated_credits }. Cost:
5 / second × engine × resolution × audio multipliers; styled mode adds a
flat 10 for the intermediate image. See pricing.get_job_status(kind, id)
get_job_status(kind, id)
kind(required) — one ofimage_generation,image_edit,img2img,image_variation,image_resize,image_upscale,image_background_removal,image_vectorize,video, ormodel. Use the kind the submitting tool told you to poll.id(required) — the job or model id a submit tool returned.
pending → processing → completed / failed) and,
once completed, presigned result URLs valid for 24 hours. Requires the scope
of the submitting tool (models.read for kind: "model").For a completed raster image job — every image kind except
image_vectorize — the response also includes a downscaled inline preview,
so MCP clients can render it directly, alongside the link to the
full-resolution asset. image_vectorize returns an SVG (no raster preview): use
the presigned URL. The preview is a reduced-resolution copy for quick display;
fetch the link for the original.get_credit_balance()
get_credit_balance()
No parameters. Returns what this connection can spend (
available and
spendable_plan_credits) alongside the organization-wide plan_credits and
topup_credits, the current billing period, and scope — the budget regime the
connection draws from. available can be lower than plan_credits when the
organization reserves plan credits for teams, which is why a job can be refused for
insufficient credits while the organization still shows a balance. See
GET /credits for the full field semantics.
