Create edits

Edits an existing Hyperframe composite or its layer stack (POST /v1/frame/edits): pass background_b64 and layers (or headline, layout, theme, terminal, instruction, or layer_patches) to redesign text, reposition panels, swap themes (light, glass, dark), or add custom card/HTML layers in ~15ms with zero diffusion cost; or set edit_background=true (with qwen-image-edit or iro) to redo the visual background while keeping all typography and UI layers intact.

POST /v1/frame/edits

Addresshttps://api.hanzo.ai/v1/frame/edits
MethodPOST
OperationaiFrameEdit
AuthAuthorization: Bearer $HANZO_API_KEY

Edits an existing Hyperframe composite or its layer stack (POST /v1/frame/edits): pass background_b64 and layers (or headline, layout, theme, terminal, instruction, or layer_patches) to redesign text, reposition panels, swap themes (light, glass, dark), or add custom card/HTML layers in ~15ms with zero diffusion cost; or set edit_background=true (with qwen-image-edit or iro) to redo the visual background while keeping all typography and UI layers intact.

Request

95 fields, body application/json (required).

FieldInTypeRequiredDescription
accentbodystring—Accent is the secondary muted headline line.
background_b64bodystring—BackgroundB64 is an existing text-free diffusion background (base64 PNG/JPEG) passed to /v1/frame/edits to re-composite text/layers without re-running diffusion.
copy_boxbodyaiFrameBox—
copy_box.heightbodynumber (double)—
copy_box.leftbodynumber (double)—
copy_box.topbodynumber (double)—
copy_box.widthbodynumber (double)—
edit_backgroundbodyboolean—EditBackground forces /v1/frame/edits to regenerate or edit the diffusion background via Model while preserving all text and UI layers.
eyebrowbodystring—Eyebrow is the mono eyebrow label above the headline (default "HANZO DEV").
headlinebodystring—Headline is the primary @hanzo/font Zen headline copy.
instructionbodystring—Instruction is an optional natural-language edit directive on /v1/frame/edits (e.g. Redesign text to "Zero-config Cloud." with glass theme and split-right layout).
layer_patchesbodyaiFrameLayer[]—LayerPatches applies partial updates (by layer id) or appends custom text/card/html layers.
layer_patches[].accentbodystring—
layer_patches[].boxbodyaiFrameBox—
layer_patches[].box.heightbodynumber (double)—
layer_patches[].box.leftbodynumber (double)—
layer_patches[].box.topbodynumber (double)—
layer_patches[].box.widthbodynumber (double)—
layer_patches[].colorbodystring—
layer_patches[].cssbodystring—
layer_patches[].eyebrowbodystring—
layer_patches[].fontbodystring—
layer_patches[].font_sizebodynumber (double)—
layer_patches[].headlinebodystring—
layer_patches[].htmlbodystring—
layer_patches[].idbodystring—
layer_patches[].layoutbodystring—
layer_patches[].modelbodystring—
layer_patches[].pillsbodystring[]—
layer_patches[].promptbodystring—
layer_patches[].subheadbodystring—
layer_patches[].terminalbodyaiFrameTerminal—
layer_patches[].terminal.badgebodystring—
layer_patches[].terminal.commandbodystring—
layer_patches[].terminal.diffbodystring[]—
layer_patches[].terminal.filebodystring—
layer_patches[].terminal.headerbodystring—
layer_patches[].terminal.statusbodystring—
layer_patches[].terminal.titlebodystring—
layer_patches[].themebodystring—
layer_patches[].typebodystring—
layer_patches[].visiblebodyboolean—
layer_patches[].z_indexbodyinteger (int64)—
layersbodyaiFrameLayer[]—Layers is the full composable layer stack from a prior frame response.
layers[].accentbodystring—
layers[].boxbodyaiFrameBox—
layers[].box.heightbodynumber (double)—
layers[].box.leftbodynumber (double)—
layers[].box.topbodynumber (double)—
layers[].box.widthbodynumber (double)—
layers[].colorbodystring—
layers[].cssbodystring—
layers[].eyebrowbodystring—
layers[].fontbodystring—
layers[].font_sizebodynumber (double)—
layers[].headlinebodystring—
layers[].htmlbodystring—
layers[].idbodystring—
layers[].layoutbodystring—
layers[].modelbodystring—
layers[].pillsbodystring[]—
layers[].promptbodystring—
layers[].subheadbodystring—
layers[].terminalbodyaiFrameTerminal—
layers[].terminal.badgebodystring—
layers[].terminal.commandbodystring—
layers[].terminal.diffbodystring[]—
layers[].terminal.filebodystring—
layers[].terminal.headerbodystring—
layers[].terminal.statusbodystring—
layers[].terminal.titlebodystring—
layers[].themebodystring—
layers[].typebodystring—
layers[].visiblebodyboolean—
layers[].z_indexbodyinteger (int64)—
layoutbodystring—Layout selects the copy layer placement: "split-left" (default), "split-right", "center", or "bottom-left".
modelbodystring—Model is the image SKU for the text-free diffusion background (default "iro"; also accepts "qwen-image", "qwen-image-edit", "z-image-turbo", "flux-3").
pillsbodystring[]—Pills are the mono badge pills rendered beneath the subhead.
promptbodystring—Prompt describes the visual scene.
sizebodystring—Size is the pixel dimension string, e.g. "1344x768" (default) or "1024x1024".
subheadbodystring—Subhead is the supporting paragraph copy below the headline.
terminalbodyaiFrameTerminal—
terminal.badgebodystring—
terminal.commandbodystring—
terminal.diffbodystring[]—
terminal.filebodystring—
terminal.headerbodystring—
terminal.statusbodystring—
terminal.titlebodystring—
terminal_boxbodyaiFrameBox—
terminal_box.heightbodynumber (double)—
terminal_box.leftbodynumber (double)—
terminal_box.topbodynumber (double)—
terminal_box.widthbodynumber (double)—
themebodystring—Theme selects the copy layer styling: "light" (default), "glass", or "dark".

Response

StatusBodyMeaning
200aiFrameOutok
defaultproblem-detailsrefused

200 body — 54 fields.

FieldInTypeAlwaysDescription
createdbodyinteger (int64)—
databodyaiFrameItem[]—
data[].b64_jsonbodystring—
data[].background_b64bodystring—
data[].htmlbodystring—
data[].layersbodyaiFrameLayer[]—
data[].layers[].accentbodystring—
data[].layers[].boxbodyaiFrameBox—
data[].layers[].box.heightbodynumber (double)—
data[].layers[].box.leftbodynumber (double)—
data[].layers[].box.topbodynumber (double)—
data[].layers[].box.widthbodynumber (double)—
data[].layers[].colorbodystring—
data[].layers[].cssbodystring—
data[].layers[].eyebrowbodystring—
data[].layers[].fontbodystring—
data[].layers[].font_sizebodynumber (double)—
data[].layers[].headlinebodystring—
data[].layers[].htmlbodystring—
data[].layers[].idbodystring—
data[].layers[].layoutbodystring—
data[].layers[].modelbodystring—
data[].layers[].pillsbodystring[]—
data[].layers[].promptbodystring—
data[].layers[].subheadbodystring—
data[].layers[].terminalbodyaiFrameTerminal—
data[].layers[].terminal.badgebodystring—
data[].layers[].terminal.commandbodystring—
data[].layers[].terminal.diffbodystring[]—
data[].layers[].terminal.filebodystring—
data[].layers[].terminal.headerbodystring—
data[].layers[].terminal.statusbodystring—
data[].layers[].terminal.titlebodystring—
data[].layers[].themebodystring—
data[].layers[].typebodystring—
data[].layers[].visiblebodyboolean—
data[].layers[].z_indexbodyinteger (int64)—
data[].layoutbodystring—
data[].terminal_boxbodyaiFrameBox—
data[].terminal_box.heightbodynumber (double)—
data[].terminal_box.leftbodynumber (double)—
data[].terminal_box.topbodynumber (double)—
data[].terminal_box.widthbodynumber (double)—
data[].themebodystring—
modebodystring—
modelbodystring—
receiptbodyaiReceipt—
receipt.classbodystring—Class is the model's class as billed: premium, ours or free (X-Hanzo-Usage-Class).
receipt.fallbackbodystring—Fallback is the model that answered in place of the one asked, in limited mode (X-Hanzo-Fallback).
receipt.paid_bybodystring—PaidBy is plan, credits or free (X-Hanzo-Paid-By); absent when the answer named no payer, as a free model's does.
receipt.reasonbodystring—Reason is the refusal code that sent the request to the fallback (X-Hanzo-Usage-Reason).
receipt.routedbodystring—Routed is the model auto resolved to (X-Routed-Model).
receipt.servedbodystring—Served is the model that answered (X-Hanzo-Served).
receipt.usagebodystring—Usage is where that class stands for the payer: ok, near or limited (X-Hanzo-Usage).

Failure carries the platform error shape — see Errors.

Examples

hanzo frame edits
import { Configuration, AiApi } from 'hanzoai';

const api = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.aiFrameEdit({ accent: "<accent>", background_b64: "<background_b64>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AiApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AiApi(client).ai_frame_edit(accent="<accent>", background_b64="<background_b64>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AiAPI.AiFrameEdit(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, ai_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = ai_api::ai_frame_edit(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AiApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AiApi(client).aiFrameEdit();

The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →

curl -X POST https://api.hanzo.ai/v1/frame/edits \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "accent": "<accent>",
       "background_b64": "<background_b64>"
     }'

Tool ai, op aiFrameEdit — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "ai",
         "arguments": {
           "op": "aiFrameEdit",
           "input": {
             "accent": "<accent>",
             "background_b64": "<background_b64>"
           }
         }
       }
     }'

AI API · All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.