{"openapi":"3.1.0","info":{"title":"SVG Lab API","version":"1","summary":"SVG Lab's Design Engine over HTTP: projects, Design Engine operations, AI Generate, placeholder photos and finished files.","description":"Use when the task needs a real, editable vector file (logo, icon set, app screen, social graphic) rather than an SVG string pasted into chat. Keys belong to a workspace (svglab.app profile page, API keys): svl_live_ keys spend the account's credits; test_ keys are the sandbox (1000 test credits a month per workspace, watermarked svg and png, no AI Generate). A Design Engine call costs 1 credit; failed calls are never billed. Every error says what to change in fix.","contact":{"email":"support@svglab.app","url":"https://svglab.app/api-docs"},"termsOfService":"https://svglab.app/terms"},"servers":[{"url":"https://svglab.app/api/v1"}],"security":[{"bearer":[]}],"paths":{"/projects":{"get":{"operationId":"listProjects","summary":"List the workspace's projects (an end customer sees only its own). Free.","parameters":[{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"responses":{"200":{"description":"Projects, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"createProject","summary":"Start an empty project. 1 credit.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":160},"description":"Send the same key when you retry: a request already done returns its first answer (Idempotent-Replayed: true) and is never billed twice."},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"imagery":{"enum":["any","photo","mixed","drawn"],"description":"drawn: drawings only, photos refused."}}}}}},"responses":{"201":{"description":"The new project, with its link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/projects/{id}":{"get":{"operationId":"getProject","summary":"One project. describe=true also returns its artboards and shapes (1 credit, or 2 when the editor switches project).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"describe","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"artboard","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"responses":{"200":{"description":"The project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/projects/{id}/run":{"post":{"operationId":"runOperations","summary":"Run Design Engine operations in the project: the MCP's run tool. 1 credit a call (plus 1 when the editor switches project).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":160},"description":"Send the same key when you retry: a request already done returns its first answer (Idempotent-Replayed: true) and is never billed twice."},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"requestBody":{"required":true,"description":"Exactly one of code or ops.","content":{"application/json":{"schema":{"type":"object","properties":{"artboard":{"description":"Artboard index, id or name: operations that take an artboard use it when the script leaves it out.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":120}]},"code":{"type":"string","maxLength":60000,"description":"JavaScript: the body of an async function given sl. await sl.op(name, args) runs one operation; return a JSON value."},"ops":{"type":"array","maxItems":200,"items":{"$ref":"#/components/schemas/OpCall"},"description":"Instead of code: operations run in order; the reply's result lists each one's result."},"async":{"type":"boolean","description":"true answers 202 at once with a job; poll GET /api/v1/jobs/{id} or pass webhook_url."},"webhook_url":{"type":"string","format":"uri","description":"With async: a public https URL that gets the finished job, signed with SVGLab-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the key's webhook secret>."}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"result, created_ids, changed_ids, warnings, logs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"202":{"description":"Accepted as an async job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"},"504":{"$ref":"#/components/responses/Error"}}}},"/projects/{id}/look":{"post":{"operationId":"lookAtArtboard","summary":"Render an artboard with measured facts (overflow, overlap, contrast, frame edges): the MCP's look tool. 1 credit.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":160},"description":"Send the same key when you retry: a request already done returns its first answer (Idempotent-Replayed: true) and is never billed twice."},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"artboard":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":120}]},"artboards":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":120}]}},"flow":{"type":"boolean"},"region":{"description":"Crop this rectangle, artboard-local (0,0 is the artboard's top-left).","type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0}},"required":["x","y","width","height"],"additionalProperties":false},"scale":{"description":"Zoom, up to 4 (8 with region). Omit to let the preview pick.","type":"number","exclusiveMinimum":0,"maximum":8}},"additionalProperties":false}}}},"responses":{"200":{"description":"Facts, and png_base64.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/projects/{id}/photos":{"post":{"operationId":"placePhoto","summary":"Place a free placeholder photo by description, cropped into a box, with the photographer's credit kept in the file. Never a raw photo search. 1 credit.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":160},"description":"Send the same key when you retry: a request already done returns its first answer (Idempotent-Replayed: true) and is never billed twice."},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"fit":{"description":"Default cover.","type":"string","enum":["cover","contain"]},"corner_radius":{"type":"number","minimum":0},"scrim":{"description":"true for the default bottom wash, or an object. Use it under any text placed over the photo.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"color":{"description":"CSS colour of the wash, default #000000.","type":"string","maxLength":64},"opacity":{"description":"Opacity at the strong end, default 0.62.","type":"number","minimum":0,"maximum":1},"direction":{"description":"Which edge the wash darkens toward. Default bottom, for a caption at the foot of a hero.","type":"string","enum":["bottom","top","left","right"]},"start":{"description":"Where the wash begins, 0 to just under 1. Default 0.4, so the top of the photo stays clean.","type":"number","minimum":0,"maximum":0.95}},"additionalProperties":false}]},"artboard":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":120}]},"name":{"type":"string","maxLength":120},"query":{"type":"string","minLength":2,"maxLength":80,"description":"What the photo shows, e.g. \"barista pouring latte art close up\". SVG Lab picks a free, licence-free placeholder photo (Unsplash, then Pexels) and keeps the photographer's credit in the file."},"orientation":{"enum":["landscape","portrait","square"]},"index":{"type":"integer","minimum":0,"maximum":7,"description":"Which search result to use, default 0."},"source":{"enum":["unsplash","pexels"]}},"required":["x","y","width","height","query"],"additionalProperties":false}}}},"responses":{"201":{"description":"The placed image ids and credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/projects/{id}/assets":{"post":{"operationId":"placeAsset","summary":"Place your own image (data_url, url, or an asset_id from POST /api/v1/assets): the MCP's upload_asset tool. 1 credit.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":160},"description":"Send the same key when you retry: a request already done returns its first answer (Idempotent-Replayed: true) and is never billed twice."},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"Direct https link to a PNG, JPEG, WebP, GIF or SVG file (not a web page).","type":"string","maxLength":2048,"format":"uri"},"data_url":{"description":"data:image/png;base64,... (or image/svg+xml). Small files only; use asset_id for anything over a few KB.","type":"string","maxLength":5592470},"asset_id":{"description":"ast_... from POST /api/v1/assets or an earlier upload_asset reply. Expires after 24 h.","type":"string","pattern":"^ast_[a-z2-7]{16}$"},"as":{"description":"SVG only: shapes (default, editable) or image (one picture). Rasters are always images.","type":"string","enum":["auto","shapes","image"]},"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"fit":{"description":"Images only. Default cover.","type":"string","enum":["cover","contain"]},"corner_radius":{"description":"Images only.","type":"number","minimum":0},"scrim":{"description":"Images only: a gradient wash so text over the picture reads.","anyOf":[{"type":"boolean"},{"type":"object","properties":{"color":{"type":"string","maxLength":64},"opacity":{"type":"number","minimum":0,"maximum":1},"direction":{"type":"string","enum":["bottom","top","left","right"]},"start":{"type":"number","minimum":0,"maximum":0.95}},"additionalProperties":false}]},"artboard":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"string","maxLength":120}]},"name":{"type":"string","maxLength":120},"purpose":{"description":"artwork (default): place the user's file. pattern_tile: an SVG tile that repeats as the fill of shape_ids (patterns and textures only).","type":"string","enum":["artwork","pattern_tile"]},"shape_ids":{"description":"pattern_tile only: the shapes to fill with the repeating tile.","minItems":1,"maxItems":200,"type":"array","items":{"type":"string","maxLength":128}},"tile_size":{"description":"pattern_tile only: the tile's width in document units (height follows the SVG's aspect). Default: the SVG's own width, capped at 128.","type":"number","minimum":2,"maximum":128}},"additionalProperties":false}}}},"responses":{"201":{"description":"The placed image.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/projects/{id}/export":{"get":{"operationId":"exportProject","summary":"The finished file of one artboard. svg (editable, fonts embedded) and png: 1 credit; pdf and code: 1 credit. test_ keys: svg and png, watermarked.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Project id."},{"name":"format","in":"query","required":false,"schema":{"enum":["svg","png","pdf","code"]},"description":"Default svg."},{"name":"artboard","in":"query","required":false,"schema":{"type":"string"},"description":"Index or name; default the first."},{"name":"code_format","in":"query","required":false,"schema":{"enum":["html","react","swiftui","compose","flutter","svg"]},"description":"format=code: default html."},{"name":"scale","in":"query","required":false,"schema":{"type":"number","minimum":0.1,"maximum":4},"description":"format=png: default 2."},{"name":"outline_text","in":"query","required":false,"schema":{"type":"boolean"},"description":"format=svg: text as outlines."},{"name":"background","in":"query","required":false,"schema":{"type":"string"},"description":"format=svg: a background colour."},{"name":"response","in":"query","required":false,"schema":{"enum":["json"]},"description":"json returns JSON (svg text, png_base64 or download_url) instead of the file."},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"responses":{"200":{"description":"The file (image/svg+xml, image/png, application/pdf, application/zip), or JSON with response=json."},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/generate":{"post":{"operationId":"aiGenerate","summary":"AI Generate: a sentence or a picture in, SVG code out, marked as AI-generated in the file. 500 credits (700 on business plans); never billed when it fails. Live keys only. Takes 1 to 3 minutes: use async for webhooks.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":160},"description":"Send the same key when you retry: a request already done returns its first answer (Idempotent-Replayed: true) and is never billed twice."},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"string","maxLength":2000,"description":"A sentence describing the drawing."},"image":{"type":"string","description":"A PNG, JPEG, WEBP or GIF data URL (under 12 MB): drawn as SVG, alone or with prompt."},"project_id":{"type":"string","format":"uuid","description":"Also place the SVG on its own board of this project."},"artboard":{"type":"string","maxLength":120,"description":"The board's name, made if missing. Default: AI Generate · <time>."},"async":{"type":"boolean","description":"true answers 202 at once with a job; poll GET /api/v1/jobs/{id} or pass webhook_url."},"webhook_url":{"type":"string","format":"uri","description":"With async: a public https URL that gets the finished job, signed with SVGLab-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with the key's webhook secret>."}}}}}},"responses":{"200":{"description":"svg, generation_id, placed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"202":{"description":"Accepted as an async job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/jobs/{id}":{"get":{"operationId":"getJob","summary":"A job: queued, running, succeeded or failed, with its result. Free. Kept 7 days.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Job id."}],"responses":{"200":{"description":"The job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/usage":{"get":{"operationId":"getUsage","summary":"Receipts: calls, failures and credits by day, tool, key and end customer, plus today's cap use and the credits left. Free.","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":90}},{"name":"key","in":"query","required":false,"schema":{"enum":["this"]},"description":"Only this key."},{"name":"SVGLab-End-Customer","in":"header","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"},"description":"Partner keys only, and required on every partner call: your own opaque id for the end customer. Email addresses are refused."}],"responses":{"200":{"description":"Usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/guides":{"get":{"operationId":"listGuides","summary":"SVG Lab's design and drawing guides, one line each (the MCP's docs). 1 credit.","responses":{"200":{"description":"Guides.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/guides/{topic}":{"get":{"operationId":"getGuide","summary":"One guide, as the MCP serves it. 1 credit.","parameters":[{"name":"topic","in":"path","required":true,"schema":{"type":"string"},"description":"Guide id from GET /api/v1/guides."}],"responses":{"200":{"description":"The guide.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/ops":{"get":{"operationId":"listOperations","summary":"Every Design Engine operation run can call, one line each. 1 credit.","responses":{"200":{"description":"Operations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"401":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/ops/{name}":{"get":{"operationId":"getOperation","summary":"One operation's arguments, output and examples. 1 credit.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"Operation name."}],"responses":{"200":{"description":"The operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Result"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A workspace key: svl_live_... (live) or test_... (sandbox)."}},"responses":{"Error":{"description":"error names what happened, fix what to change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["ok","error","message","fix"],"properties":{"ok":{"const":false},"error":{"enum":["not_found","missing_key","invalid_key","key_revoked","team_workspace_not_ready","missing_scope","account_suspended","end_customer_id_required","end_customer_id_email","end_customer_id_invalid","end_customer_not_partner","end_customer_suspended","key_daily_cap","end_customer_daily_cap","sandbox_credits_used_up","sandbox_no_ai_generate","sandbox_export_format","credits_needed","rate_limited","bad_request","invalid_json","payload_too_large","project_not_found","operation_failed","editor_starting","still_running","idempotency_in_progress","idempotency_key_reused","idempotency_key_invalid","webhook_url_invalid","job_not_found","export_failed","ai_generate_failed","ai_generate_unavailable","limiter_unavailable","credits_unavailable","api_not_ready","unavailable"]},"message":{"type":"string"},"fix":{"type":"string"},"retry_after_s":{"type":"number"},"resets_at":{"type":"string","format":"date-time"}}},"Result":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"},"credits":{"type":"integer","description":"Credits this request cost."},"job":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}}}},"additionalProperties":true},"OpCall":{"type":"object","required":["op"],"additionalProperties":false,"properties":{"op":{"enum":["create_shape","create_shapes","create_text","create_path","pencil","edit_path","simplify_path","smooth_path","boolean_op","offset_path","transform","align","distribute","align_to_artboard","set_style","set_stroke","set_gradient","set_filter","set_pattern","clip_shapes","clip_to_artboard","text_on_path","set_text","duplicate","group","ungroup","name_group","reorder","resize","fit_to_box","fit_to_children","repeat","mirror","flip","scatter","add_texture","create_icon","create_layout","update_layout","design_tokens","define_styles","list_design_styles","measure_text","list_fonts","list_components","list_layouts","list_shapes","describe_document","inspect_path","inspect_layout","check_contrast","check_contacts","optical_center","snap_to_grid","normalize_spacing","normalize_radii","resolve_overflow","create_figure","create_limb","create_hand","create_line_of_action","create_organic","form_lines","add_artboard","set_artboard","list_artboards","set_active_artboard","fit_artboard","delete_shapes","make_symbol","place_symbol","list_symbols","detach_symbol","set_locked","define_helper","list_helpers","bind_slot"],"description":"GET /api/v1/ops/{name} gives its arguments."},"args":{"type":"object"}}},"Job":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"enum":["queued","running","succeeded","failed"]},"http_status":{"type":["integer","null"]},"result":{},"credits":{"type":"integer"},"created_at":{"type":"string"},"finished_at":{"type":["string","null"]}}},"JobAccepted":{"type":"object","properties":{"ok":{"const":true},"job":{"$ref":"#/components/schemas/Job"},"poll":{"type":"string"}}}}},"x-error-fixes":{"not_found":{"status":404,"fix":"Check the method and path against GET /api/v1/openapi.json."},"missing_key":{"status":401,"fix":"Send Authorization: Bearer <key>. Create a key on your SVG Lab profile page (svglab.app/profile, API keys)."},"invalid_key":{"status":401,"fix":"The key is unknown or was revoked. Create a key on your profile page and send it as Authorization: Bearer <key>."},"key_revoked":{"status":401,"fix":"Create a new key on your profile page; a revoked key never works again."},"team_workspace_not_ready":{"status":409,"fix":"Use a key of your personal workspace. Team workspaces get API keys when team projects open in the editor."},"missing_scope":{"status":403,"fix":"Create a key with the scope named in scope_needed."},"account_suspended":{"status":403,"fix":"Write to support@svglab.app."},"end_customer_id_required":{"status":400,"fix":"A partner key names the end customer on every call: send the header SVGLab-End-Customer with your own id for them."},"end_customer_id_email":{"status":400,"fix":"Send your own opaque id for the end customer (letters, digits and . _ : -), never an email address."},"end_customer_id_invalid":{"status":400,"fix":"Use 1 to 64 letters, digits and . _ : - for the end customer id, starting with a letter or digit."},"end_customer_not_partner":{"status":400,"fix":"Only partner keys name an end customer. Drop the SVGLab-End-Customer header, or use a partner key."},"end_customer_suspended":{"status":403,"fix":"The partner account can lift the suspension on its profile page."},"key_daily_cap":{"status":429,"fix":"Wait until resets_at, or raise this key's daily credit cap on your profile page."},"end_customer_daily_cap":{"status":429,"fix":"Wait until resets_at, or raise this end customer's daily credit cap on your profile page."},"sandbox_credits_used_up":{"status":429,"fix":"Wait until resets_at, or use a live key."},"sandbox_no_ai_generate":{"status":403,"fix":"AI Generate needs a live key; test_ keys run the Design Engine only."},"sandbox_export_format":{"status":403,"fix":"test_ keys export watermarked svg and png; use a live key for pdf and code."},"credits_needed":{"status":402,"fix":"Add credits with a plan or a top-up at https://svglab.app/billing."},"rate_limited":{"status":429,"fix":"Wait retry_after_s seconds and send the call again."},"bad_request":{"status":400,"fix":"Fix the field the message names; GET /api/v1/openapi.json lists every field."},"invalid_json":{"status":400,"fix":"Send a JSON object body with Content-Type: application/json."},"payload_too_large":{"status":413,"fix":"Send a body under 16 MB; an image for AI Generate must be under 12 MB."},"project_not_found":{"status":404,"fix":"Use a project id from GET /api/v1/projects, or the id POST /api/v1/projects returned."},"operation_failed":{"status":422,"fix":"Read message: it names what to change. Nothing after the failing operation ran."},"editor_starting":{"status":503,"fix":"The server editor is still opening. Send the same call again after retry_after_s."},"still_running":{"status":504,"fix":"The call is still finishing in the editor. Check with GET /api/v1/projects/{id}?describe=true before you repeat it."},"idempotency_in_progress":{"status":409,"fix":"A request with this Idempotency-Key is still running. Poll GET /api/v1/jobs/{job_id}."},"idempotency_key_reused":{"status":422,"fix":"This Idempotency-Key was used for a different request. Use a new key for a new request."},"idempotency_key_invalid":{"status":400,"fix":"Use 1 to 160 visible ASCII characters for Idempotency-Key."},"webhook_url_invalid":{"status":400,"fix":"Use a public https URL on port 443 for webhook_url."},"job_not_found":{"status":404,"fix":"Use the job id a POST returned; jobs are kept for 7 days."},"export_failed":{"status":502,"fix":"Nothing was charged. Send the export again; for pdf, export fewer artboards at once."},"ai_generate_failed":{"status":502,"fix":"Nothing was charged. Send it again, or simplify the prompt."},"ai_generate_unavailable":{"status":503,"fix":"Nothing was charged. Try again in a few minutes."},"limiter_unavailable":{"status":503,"fix":"Nothing was run or charged. Try again in a minute."},"credits_unavailable":{"status":503,"fix":"Nothing was run or charged. Try again in a minute."},"api_not_ready":{"status":503,"fix":"The API is being switched on. Try again later."},"unavailable":{"status":503,"fix":"Nothing was charged. Try again in a minute."}}}