{"uid":"cap_8GElDcVQTHJ5ml_OUefK4","slug":"withzero-pixel-art-canvas-import-1a166e25","name":"WithZero Pixel Art Canvas Import","description":"Import agent-owned pixel canvases.","url":"https://agents.withzero.xyz/api/v1/pixelart/canvas/import?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","example":{"width":64,"height":64,"imageUrl":"https://httpbin.org/image/png"},"required":["width","height","scaleMode","fit","loop"],"properties":{"fit":{"enum":["fill","contain","cover","crop"],"type":"string","default":"contain","description":"fill = stretch; contain = letterbox; cover/crop = crop to fill. Default contain."},"fps":{"type":"integer","maximum":60,"minimum":1,"description":"Default playback rate for frames added after import."},"game":{"type":"object","properties":{"clips":{"type":"array","items":{"type":"object","required":["name","fromFrame","toFrame"],"properties":{"fps":{"type":"integer","maximum":60,"minimum":1},"loop":{"type":"boolean"},"name":{"type":"string","maxLength":64,"minLength":1},"toFrame":{"type":"integer","maximum":9007199254740991,"minimum":0},"fromFrame":{"type":"integer","maximum":9007199254740991,"minimum":0}},"additionalProperties":false},"maxItems":64,"description":"Named animation ranges within this canvas."},"facing":{"enum":["left","right","none"],"type":"string","description":"Native facing direction of the authored art."},"frames":{"type":"object","description":"Metadata keyed by canonical zero-based frame index.","propertyNames":{"type":"string","pattern":"^(0|[1-9]\\d*)$"},"additionalProperties":{"type":"object","properties":{"boxes":{"type":"array","items":{"type":"object","required":["kind","x","y","width","height"],"properties":{"x":{"type":"number"},"y":{"type":"number"},"kind":{"enum":["hit","hurt","collision","interaction"],"type":"string"},"name":{"type":"string","maxLength":64,"minLength":1},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0}},"additionalProperties":false},"maxItems":64,"description":"Gameplay geometry associated with this frame."},"pivot":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number","description":"Horizontal pixel coordinate from the left edge of the frame."},"y":{"type":"number","description":"Vertical pixel coordinate from the top edge of the frame."}},"description":"Per-frame pivot override. Omit to use defaultPivot.","additionalProperties":false},"events":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":64,"minLength":1},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"additionalProperties":false},"maxItems":64,"description":"Events emitted when playback enters this frame."},"sockets":{"type":"object","description":"Named attachment points such as feet, muzzle, hand, or weapon.","propertyNames":{"type":"string","maxLength":64,"minLength":1},"additionalProperties":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number","description":"Horizontal pixel coordinate from the left edge of the frame."},"y":{"type":"number","description":"Vertical pixel coordinate from the top edge of the frame."}},"additionalProperties":false}},"durationMs":{"type":"integer","maximum":60000,"minimum":1,"description":"Per-frame duration override. Omit to use the clip or canvas FPS."}},"additionalProperties":false}},"rootMotion":{"anyOf":[{"type":"string","const":"none"},{"type":"object","properties":{"socket":{"type":"string","maxLength":64,"minLength":1,"description":"Socket whose movement represents root motion."}},"additionalProperties":false}],"description":"Whether movement is in-place or derived from a named socket."},"defaultPivot":{"type":"object","required":["x","y"],"properties":{"x":{"type":"number","description":"Horizontal pixel coordinate from the left edge of the frame."},"y":{"type":"number","description":"Vertical pixel coordinate from the top edge of the frame."}},"description":"Default render pivot shared by frames without an override.","additionalProperties":false}},"description":"Optional engine metadata for the imported art.","additionalProperties":false},"loop":{"type":"boolean","default":true,"description":"Whether animation playback loops by default."},"name":{"type":"string","maxLength":100,"description":"Canvas name. Shown in the viewer tab."},"width":{"type":"integer","default":64,"maximum":256,"minimum":4,"description":"Target canvas width in pixels. Default 64."},"colors":{"type":"integer","maximum":256,"minimum":2,"description":"Quantize result to N distinct colors using median-cut. Omit to keep full color fidelity."},"height":{"type":"integer","default":64,"maximum":256,"minimum":4,"description":"Target canvas height in pixels. Default 64."},"canvasId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"If provided, overwrite an existing canvas instead of creating a new one."},"imageUrl":{"type":"string","format":"uri","description":"Publicly accessible image URL to fetch server-side. Max 5 MB."},"imageData":{"type":"string","description":"Base64-encoded image bytes (PNG / JPEG / WebP / GIF). Max 2 MB encoded (≈1.5 MB actual)."},"scaleMode":{"enum":["nearest","smooth"],"type":"string","default":"nearest","description":"nearest = pixel-art-preserving (best for existing pixel art). smooth = Lanczos3 downscale (best for photos → pixel art)."},"background":{"type":"array","description":"[r, g, b, a] fill color for letterbox padding. Default transparent.","prefixItems":[{"type":"integer","maximum":255,"minimum":0},{"type":"integer","maximum":255,"minimum":0},{"type":"integer","maximum":255,"minimum":0},{"type":"integer","maximum":255,"minimum":0}]}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["id","width","height","viewUrl","apiUrl","ansiUrl","manifestUrl","fullSpecUrl","guideUrl","colorCount"],"properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991},"apiUrl":{"type":"string"},"height":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991},"ansiUrl":{"type":"string","description":"URL that returns ANSI half-block art — pipe via `curl <ansiUrl>` to render in any terminal or agent context."},"viewUrl":{"type":"string"},"guideUrl":{"type":"string","description":"Holistic agent workflow guide."},"colorCount":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991,"description":"Distinct RGBA colors in the imported result."},"fullSpecUrl":{"type":"string","description":"Complete OpenAPI surface including free editing routes."},"manifestUrl":{"type":"string","description":"Engine-ready animation manifest for this mutable canvas."}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USD","priceDynamic":true,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":1,"rating":{"score":"1.00","successRate":"0.50","reviews":1,"stars":"5.0","state":"rated"},"availabilityStatus":"healthy","priceObserved":{"p10Cents":"1.0000","medianCents":"1.0000","p90Cents":"1.0000","minCents":"1.0000","maxCents":"1.0000","p95Cents":"1.0000","sampleCount":1,"varies":false,"failureChargeRate":null},"sessionDeposit":null,"pricing":{"kind":"dynamic","summary":"$0.01/call (dynamic — varies by input)","primary":{"kind":"dynamic","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"dynamic","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},{"kind":"dynamic","protocol":"mpp","network":"tempo","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ulDbgl0fPhk9doUMQ7Q5C","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null},{"uid":"pm_5jCbzEwNx8LY02vfkXFz8","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Imports an image or pixel art asset into a WithZero pixel art canvas for editing or use in media creation.","exampleAgentPrompt":"Import my 64x64 PNG sprite from https://example.com/sprite.png into a WithZero pixel art canvas so I can start editing it.","exampleUseCases":[{"title":"Game sprite editing setup","prompt":"Load my existing game character sprite from https://assets.mygame.com/hero.png into a pixel art canvas on WithZero so I can tweak the colors."},{"title":"Pixel art logo retouching","prompt":"Import this logo image at https://mybrand.com/logo.png into a pixel art canvas so I can touch it up and export it as pixel art."},{"title":"Tileset import for level design","prompt":"Bring in my tileset PNG from https://cdn.myproject.io/tileset.png into a pixel art canvas so I can use individual tiles in my level editor."}],"resultDescription":"Returns a canvas object representing the imported pixel art, including a canvas ID and the initialized canvas state derived from the source image, ready for further editing or export operations.","failureModes":["Invalid or unreachable image URL returns an error","Unsupported image format causes import failure","Image too large exceeds canvas size limits","Payment failure (insufficient USDC balance) blocks the call","Rate limiting or service unavailability returns 5xx error"],"whenToPreferThis":"Choose this endpoint when you need to bring an existing image or pixel art asset into a WithZero pixel art canvas as a starting point for editing, rather than generating new pixel art from scratch. Prefer this over generation endpoints when the user already has a source image they want to work from.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":6,"lastUsedAt":"2026-09-25T17:57:16.387Z","lastSuccessfullyRanAt":"2026-09-25T17:57:16.387Z","lastHealthCheckAt":"2026-10-02T17:14:11.346Z","isFirstParty":true,"canonicalSlug":"withzero-pixel-art-canvas-import-1a166e25"}