{"uid":"cap_XaVA5zKl8UUddGMFJf5LE","slug":"pixelart-withzero-xyz-create-pixel-art-canvas-e3bff145","name":"Create Pixel Art Canvas","description":"Create a new pixel art canvas. Returns editing, manifest, full-spec, guide, and interactive-view URLs. Optionally pre-load base64 RGBA pixels. Full agent guide: https://pixelart.withzero.xyz/llms.txt","url":"https://pixelart.withzero.xyz/api/v1/canvas","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["loop"],"properties":{"fps":{"type":"integer","maximum":60,"minimum":1,"description":"Playback rate for animation consumers."},"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: pivots, facing, root motion, clips, sockets, boxes, and events.","additionalProperties":false},"loop":{"type":"boolean","default":true,"description":"Whether playback loops (false = play once)."},"name":{"type":"string","maxLength":100,"description":"Human-readable label for this canvas."},"width":{"type":"integer","default":64,"maximum":256,"minimum":8,"description":"Canvas width in pixels (8–256). Default: 64."},"height":{"type":"integer","default":64,"maximum":256,"minimum":8,"description":"Canvas height in pixels (8–256). Default: 64."},"initData":{"type":"string","maxLength":349528,"minLength":1,"description":"Base64-encoded RGBA pixel data to initialise the canvas. Must be exactly width × height × 4 bytes after decoding. Omit to start with a transparent (empty) canvas."}},"additionalProperties":false},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["id","width","height","viewUrl","apiUrl","ansiUrl","manifestUrl","fullSpecUrl","guideUrl"],"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)$","description":"Canvas UUID — use in all subsequent API calls."},"width":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991},"apiUrl":{"type":"string","description":"Base API URL for this canvas."},"height":{"type":"integer","maximum":9007199254740991,"minimum":-9007199254740991},"ansiUrl":{"type":"string","description":"URL that returns ANSI half-block art of the canvas. Pipe via `curl <ansiUrl>` to render in any terminal or agent context."},"viewUrl":{"type":"string","description":"URL to the interactive pixel editor pre-loaded with this canvas."},"guideUrl":{"type":"string","description":"Holistic agent workflow guide."},"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":[],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"mpp","network":"tempo","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_mQc8NTS0iay7x3_R0dkcM","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":"pixelart.canvas.create:1"}],"brandName":"pixelart.withzero.xyz","brandSlug":"pixelart-withzero-xyz-mpp","brandBaseUrl":"https://pixelart.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Creates a new blank (or pre-loaded) pixel art canvas and returns a UUID canvas ID plus a live interactive editor URL for use with subsequent draw, fill, and export endpoints.","exampleAgentPrompt":"Create a new 64x64 pixel art canvas called 'SpaceShip Sprite' so I can start drawing on it programmatically — I want a blank transparent canvas and the editor link to share.","exampleUseCases":[{"title":"Initialize sprite sheet for game development","prompt":"Set up a 128x128 pixel canvas I can use to create a character sprite sheet with transparency, and give me the live editor link so I can preview while my agent draws the individual sprites programmatically."},{"title":"Start animated pixel art sequence","prompt":"Create a new 32x32 transparent pixel canvas for an animation loop I'm building — I need the canvas ID to draw each frame and the ANSI terminal view to preview it as I go."},{"title":"Build collaborative pixel art grid","prompt":"Initialize a 256x256 blank pixel art canvas so my team can contribute sprites and patterns to it via the API — I want the interactive editor URL to review everyone's contributions in real-time."}],"resultDescription":"Returns a JSON object containing: a UUID canvas ID (used in all subsequent draw, fill, shape, and export API calls), the canvas dimensions (width and height), a viewUrl pointing to the interactive live editor pre-loaded with this canvas, an apiUrl as the base for further API operations on this canvas, and an ansiUrl for rendering the canvas as ANSI half-block art in a terminal or agent context.","failureModes":["Width or height out of range (must be 8–256): returns 400 with validation error","initData length mismatch — base64-decoded bytes do not equal width × height × 4: returns 400","initData is not valid base64: returns 400 with parse error","Name exceeds 100 characters: returns 400","Service unavailable or internal error: returns 5xx"],"whenToPreferThis":"Use this endpoint as the mandatory first step whenever you need to create a new pixel art canvas from scratch. It is the entry point for the entire pixel art workflow — you must call this before any draw, fill, shape, or export operations. Choose this over the image-to-pixel-art conversion endpoint when you want a blank canvas rather than converting an existing image.","instructions":"# Create Canvas — ENTRY POINT for drawing pixel art from scratch\n\n## Workflow\nThis mints the canvas {id} every other pixelart endpoint needs:\n- Start from scratch: POST /api/v1/canvas — returns {id, viewUrl}\n- Start from an image: POST /api/v1/canvas/import — also returns {id, viewUrl}\n- Draw (need {id}): POST /api/v1/canvas/{id}/pixels (per-pixel), /shapes (rect/circle/line), /fill (paint bucket)\n- See it: open viewUrl (live interactive editor)\n- Export animation: GET /api/v1/canvas/{id}/export.gif (binary GIF)\n\n## Contract\n- Edits accumulate across calls on the same {id} — draw incrementally.\n- To start from an existing image instead, use /canvas/import (the other entry point).","reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:33:11.356Z","isFirstParty":true}