{"openapi":"3.1.0","info":{"title":"AI Architectures API","version":"1.0.0","summary":"Virtual staging, listing photo edits, sketch-to-render, remodel previews, floor plan redraws and sketch/brief to CAD (DXF, DWG, PDF), as one REST API.","description":"Async REST API for real-estate photographers, house-plan sellers, prefab builders and proptech platforms. Create a job, then poll it or receive a signed webhook. White-label: outputs carry no third-party branding. Billing in credits from your account (100 credits per 2K image; CAD by real usage, typically 300-1500 credits). Sandbox keys (sk_test_) return sample outputs for free.","contact":{"name":"API support","email":"support@ai-architectures.com","url":"https://ai-architectures.com/developers"},"termsOfService":"https://ai-architectures.com/developers#terms","x-logo":{"url":"https://ai-architectures.com/android-chrome-512x512.png"}},"servers":[{"url":"https://api.20.vision","description":"Production (live and sandbox keys)"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Real estate","description":"Virtual staging and listing photo edits"},{"name":"Architecture","description":"Renders from sketches and remodel previews"},{"name":"Floor plans & CAD","description":"Floor plan redraws (image) and CAD drawings (DXF, DWG, PDF)"},{"name":"Jobs","description":"Job status and files"},{"name":"Webhooks","description":"Endpoints that receive job.succeeded and job.failed"},{"name":"Account","description":"Credits, limits and pricing"}],"paths":{"/v1/virtual-staging":{"post":{"tags":["Real estate"],"summary":"Virtually stage a room photo","description":"Furnishes an empty (or furnished) room photo in a style while keeping walls, windows, floor and camera exactly as photographed. ~30 s.","operationId":"createVirtualStaging","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Wait"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"Public https URL of the input photo or sketch (JPEG, PNG, WebP, HEIC; max 15 MB)."},"image":{"type":"string","description":"The input image as base64 or a data URL, instead of image_url."},"resolution":{"type":"string","enum":["2k","4k"],"default":"2k","description":"Output size. 2k = 100 credits, 4k = 1000 credits."},"aspect_ratio":{"type":"string","enum":["auto","1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"default":"auto","description":"auto keeps the input photo's proportions."},"style":{"type":"string","default":"modern","description":"One of modern, scandinavian, transitional, farmhouse, coastal, mid_century_modern, luxury_contemporary, industrial, bohemian, japandi, or your own style description (max 200 characters)."},"room_type":{"type":"string","description":"e.g. living room, bedroom, home office (max 60)."},"notes":{"type":"string","description":"Extra instructions (max 500)."},"webhook_url":{"type":"string","format":"uri","description":"Optional https URL that receives job.succeeded / job.failed for this job (in addition to your webhook endpoints). Signed like all webhooks."},"metadata":{"type":"object","additionalProperties":true,"description":"Your own key/values (max 2000 chars as JSON), returned with the job and in webhooks."},"simulate":{"type":"string","enum":["success","failed","insufficient_credits"],"description":"Sandbox keys (sk_test_) only: force an outcome to test your error handling."}},"required":[]},"example":{"image_url":"https://example.com/listing/empty-living-room.jpg","style":"scandinavian","room_type":"living room"}}}},"responses":{"200":{"description":"Job already finished (with ?wait= or an idempotent replay of a finished job).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"202":{"description":"Job accepted. Poll GET /v1/jobs/{job_id} or wait for the webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credits (code insufficient_credits) or key limit reached (key_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key reused with a different request (idempotency_conflict)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/photo-edits":{"post":{"tags":["Real estate"],"summary":"Edit a listing photo","description":"Listing photo fixes that keep the property unchanged: remove furniture, declutter, brighten, window glare, day to twilight, blue sky, green lawn, lot lines on drone photos.","operationId":"createPhotoEdit","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Wait"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"Public https URL of the input photo or sketch (JPEG, PNG, WebP, HEIC; max 15 MB)."},"image":{"type":"string","description":"The input image as base64 or a data URL, instead of image_url."},"resolution":{"type":"string","enum":["2k","4k"],"default":"2k","description":"Output size. 2k = 100 credits, 4k = 1000 credits."},"aspect_ratio":{"type":"string","enum":["auto","1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"default":"auto","description":"auto keeps the input photo's proportions."},"task":{"type":"string","enum":["remove_furniture","declutter","brighten","window_glare","day_to_twilight","blue_sky","green_lawn","lot_lines"]},"notes":{"type":"string","description":"Extra instructions (max 500); for lot_lines say which lot."},"webhook_url":{"type":"string","format":"uri","description":"Optional https URL that receives job.succeeded / job.failed for this job (in addition to your webhook endpoints). Signed like all webhooks."},"metadata":{"type":"object","additionalProperties":true,"description":"Your own key/values (max 2000 chars as JSON), returned with the job and in webhooks."},"simulate":{"type":"string","enum":["success","failed","insufficient_credits"],"description":"Sandbox keys (sk_test_) only: force an outcome to test your error handling."}},"required":["task"]},"example":{"image_url":"https://example.com/listing/front.jpg","task":"day_to_twilight"}}}},"responses":{"200":{"description":"Job already finished (with ?wait= or an idempotent replay of a finished job).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"202":{"description":"Job accepted. Poll GET /v1/jobs/{job_id} or wait for the webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credits (code insufficient_credits) or key limit reached (key_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key reused with a different request (idempotency_conflict)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/renders":{"post":{"tags":["Architecture"],"summary":"Render a sketch","description":"Turns an architectural sketch, elevation, massing model or CAD view into a photoreal (or watercolor, line-work, massing) image, keeping form, openings and viewpoint.","operationId":"createRender","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Wait"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"Public https URL of the input photo or sketch (JPEG, PNG, WebP, HEIC; max 15 MB)."},"image":{"type":"string","description":"The input image as base64 or a data URL, instead of image_url."},"resolution":{"type":"string","enum":["2k","4k"],"default":"2k","description":"Output size. 2k = 100 credits, 4k = 1000 credits."},"aspect_ratio":{"type":"string","enum":["auto","1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"default":"auto","description":"auto keeps the input photo's proportions."},"style":{"type":"string","enum":["photoreal","watercolor","clean_linework","massing_model"],"default":"photoreal"},"lighting":{"type":"string","enum":["day","golden_hour","evening","interior"],"default":"day"},"notes":{"type":"string","description":"Materials, context, mood (max 300)."},"webhook_url":{"type":"string","format":"uri","description":"Optional https URL that receives job.succeeded / job.failed for this job (in addition to your webhook endpoints). Signed like all webhooks."},"metadata":{"type":"object","additionalProperties":true,"description":"Your own key/values (max 2000 chars as JSON), returned with the job and in webhooks."},"simulate":{"type":"string","enum":["success","failed","insufficient_credits"],"description":"Sandbox keys (sk_test_) only: force an outcome to test your error handling."}},"required":[]},"example":{"image_url":"https://example.com/sketches/house-elevation.png","style":"photoreal","lighting":"golden_hour","notes":"white stucco, black window frames"}}}},"responses":{"200":{"description":"Job already finished (with ?wait= or an idempotent replay of a finished job).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"202":{"description":"Job accepted. Poll GET /v1/jobs/{job_id} or wait for the webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credits (code insufficient_credits) or key limit reached (key_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key reused with a different request (idempotency_conflict)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/remodels":{"post":{"tags":["Architecture"],"summary":"Preview a remodel on a photo","description":"Changes one thing on a photo of a real building (new siding, a pergola, an open kitchen, a different roof) and keeps everything else.","operationId":"createRemodel","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Wait"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"Public https URL of the input photo or sketch (JPEG, PNG, WebP, HEIC; max 15 MB)."},"image":{"type":"string","description":"The input image as base64 or a data URL, instead of image_url."},"resolution":{"type":"string","enum":["2k","4k"],"default":"2k","description":"Output size. 2k = 100 credits, 4k = 1000 credits."},"aspect_ratio":{"type":"string","enum":["auto","1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"default":"auto","description":"auto keeps the input photo's proportions."},"instructions":{"type":"string","description":"What to change (3-2000 characters)."},"webhook_url":{"type":"string","format":"uri","description":"Optional https URL that receives job.succeeded / job.failed for this job (in addition to your webhook endpoints). Signed like all webhooks."},"metadata":{"type":"object","additionalProperties":true,"description":"Your own key/values (max 2000 chars as JSON), returned with the job and in webhooks."},"simulate":{"type":"string","enum":["success","failed","insufficient_credits"],"description":"Sandbox keys (sk_test_) only: force an outcome to test your error handling."}},"required":["instructions"]},"example":{"image_url":"https://example.com/customer/backyard.jpg","instructions":"Add a black aluminium pergola over the patio"}}}},"responses":{"200":{"description":"Job already finished (with ?wait= or an idempotent replay of a finished job).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"202":{"description":"Job accepted. Poll GET /v1/jobs/{job_id} or wait for the webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credits (code insufficient_credits) or key limit reached (key_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key reused with a different request (idempotency_conflict)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/floor-plans/redraw":{"post":{"tags":["Floor plans & CAD"],"summary":"Redraw a floor plan as a clean 2D plan image","description":"Redraws a hand sketch, photo or scan of a floor plan as a clean, labeled 2D plan image (black walls on white, doors, windows, room names, written dimensions). For measured CAD files use POST /v1/cad.","operationId":"createFloorPlanRedraw","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Wait"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"Public https URL of the input photo or sketch (JPEG, PNG, WebP, HEIC; max 15 MB)."},"image":{"type":"string","description":"The input image as base64 or a data URL, instead of image_url."},"resolution":{"type":"string","enum":["2k","4k"],"default":"2k","description":"Output size. 2k = 100 credits, 4k = 1000 credits."},"aspect_ratio":{"type":"string","enum":["auto","1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9"],"default":"auto","description":"auto keeps the input photo's proportions."},"notes":{"type":"string","description":"e.g. label rooms in German (max 500)."},"webhook_url":{"type":"string","format":"uri","description":"Optional https URL that receives job.succeeded / job.failed for this job (in addition to your webhook endpoints). Signed like all webhooks."},"metadata":{"type":"object","additionalProperties":true,"description":"Your own key/values (max 2000 chars as JSON), returned with the job and in webhooks."},"simulate":{"type":"string","enum":["success","failed","insufficient_credits"],"description":"Sandbox keys (sk_test_) only: force an outcome to test your error handling."}},"required":[]},"example":{"image_url":"https://example.com/scans/old-plan.jpg"}}}},"responses":{"200":{"description":"Job already finished (with ?wait= or an idempotent replay of a finished job).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"202":{"description":"Job accepted. Poll GET /v1/jobs/{job_id} or wait for the webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credits (code insufficient_credits) or key limit reached (key_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key reused with a different request (idempotency_conflict)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cad":{"post":{"tags":["Floor plans & CAD"],"summary":"Draw a CAD floor plan (DXF, DWG, PDF) from a brief, sketch or photo","description":"An AI drafter draws a dimensioned, layered CAD floor plan from a text brief and/or a sketch, photo or scan of a plan. Output: DXF (layered), DWG, A3 PDF sheet and PNG. Usually 2-6 minutes. Credits = real usage (minimum 300, at most 2500 per job; 600 must be available to start).","operationId":"createCad","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Wait"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"brief":{"type":"string","description":"Description of the building (max 4000). Required unless an image is sent."},"image_url":{"type":"string","format":"uri","description":"Public https URL of the input photo or sketch (JPEG, PNG, WebP, HEIC; max 15 MB)."},"image":{"type":"string","description":"The input image as base64 or a data URL, instead of image_url."},"units":{"type":"string","enum":["m","ft"],"default":"m"},"webhook_url":{"type":"string","format":"uri","description":"Optional https URL that receives job.succeeded / job.failed for this job (in addition to your webhook endpoints). Signed like all webhooks."},"metadata":{"type":"object","additionalProperties":true,"description":"Your own key/values (max 2000 chars as JSON), returned with the job and in webhooks."},"simulate":{"type":"string","enum":["success","failed","insufficient_credits"],"description":"Sandbox keys (sk_test_) only: force an outcome to test your error handling."}},"required":[]},"example":{"brief":"3-bedroom single-storey house, 12 x 9 m, open kitchen and living room facing south, 2 bathrooms","units":"m"}}}},"responses":{"200":{"description":"Job already finished (with ?wait= or an idempotent replay of a finished job).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"202":{"description":"Job accepted. Poll GET /v1/jobs/{job_id} or wait for the webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credits (code insufficient_credits) or key limit reached (key_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key reused with a different request (idempotency_conflict)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/cad/{job_id}/revise":{"post":{"tags":["Floor plans & CAD"],"summary":"Revise a CAD drawing by instruction","description":"A new version of a finished CAD job (\"make the kitchen 1 m wider\", \"add a garage on the left\"). Lets your customers customize a plan by chat. Credits = real usage (min 60, max 1200).","operationId":"reviseCad","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Wait"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"instructions":{"type":"string","description":"The change (3-4000 characters)."},"webhook_url":{"type":"string","format":"uri","description":"Optional https URL that receives job.succeeded / job.failed for this job (in addition to your webhook endpoints). Signed like all webhooks."},"metadata":{"type":"object","additionalProperties":true,"description":"Your own key/values (max 2000 chars as JSON), returned with the job and in webhooks."},"simulate":{"type":"string","enum":["success","failed","insufficient_credits"],"description":"Sandbox keys (sk_test_) only: force an outcome to test your error handling."}},"required":["instructions"]},"example":{"instructions":"Add a 6 x 6 m double garage on the east side"}}}},"responses":{"200":{"description":"Job already finished (with ?wait= or an idempotent replay of a finished job).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"202":{"description":"Job accepted. Poll GET /v1/jobs/{job_id} or wait for the webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Not enough credits (code insufficient_credits) or key limit reached (key_limit_reached)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key reused with a different request (idempotency_conflict)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs":{"get":{"tags":["Jobs"],"summary":"List jobs","operationId":"listJobs","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"status","in":"query","schema":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]}},{"name":"type","in":"query","schema":{"$ref":"#/components/schemas/JobType"}},{"name":"starting_after","in":"query","schema":{"type":"string"},"description":"Job id: list older jobs (pagination)."}],"responses":{"200":{"description":"Jobs, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"has_more":{"type":"boolean"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}":{"get":{"tags":["Jobs"],"summary":"Get a job","operationId":"getJob","description":"Status, credits charged and (when succeeded) signed download links valid for 24 hours. Fetch again for fresh links.","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"headers":{"Location":{"schema":{"type":"string"},"description":"URL of the job"},"Idempotent-Replayed":{"schema":{"type":"string"},"description":"\"true\" when an Idempotency-Key replayed an earlier job"}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files/{job_id}/{name}":{"get":{"tags":["Jobs"],"summary":"Download a result file","operationId":"getFile","security":[{"bearerAuth":[]},{}],"description":"Images: result.jpg, result.png, result.webp, preview.jpg. CAD: plan.dxf, plan.dwg, plan.pdf, plan.png. Authenticate with your key, or use the signed URL from the job (expires and signature query parameters).","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","enum":["result.jpg","result.png","result.webp","preview.jpg","plan.dxf","plan.dwg","plan.pdf","plan.png"]}},{"name":"expires","in":"query","schema":{"type":"integer"}},{"name":"signature","in":"query","schema":{"type":"string"}},{"name":"download","in":"query","schema":{"type":"string","enum":["0","1"]},"description":"0 = inline instead of attachment"}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{},"image/png":{},"image/webp":{},"application/dxf":{},"application/acad":{},"application/pdf":{}}},"403":{"description":"Link expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Not ready, or superseded by a newer CAD version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/account":{"get":{"tags":["Account"],"summary":"Credits, key and limits","operationId":"getAccount","responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints (and the signing secret)","operationId":"listWebhooks","responses":{"200":{"description":"Endpoints of this key's mode"}}},"post":{"tags":["Webhooks"],"summary":"Add a webhook endpoint","operationId":"createWebhook","description":"Receives job.succeeded and job.failed for every job of this mode (live or test). Used by Zapier/Make REST hooks too.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"description":{"type":"string"}}}}}},"responses":{"201":{"description":"Created (includes signing_secret)"},"400":{"description":"Invalid URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"delete":{"tags":["Webhooks"],"summary":"Remove a webhook endpoint","operationId":"deleteWebhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a webhook.test event","operationId":"testWebhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Delivery result"}}}}},"webhooks":{"jobFinished":{"post":{"summary":"job.succeeded / job.failed","description":"Signed per the Standard Webhooks spec: headers webhook-id, webhook-timestamp, webhook-signature = \"v1,\" + base64(HMAC-SHA256(base64decode(secret without \"whsec_\"), \"{webhook-id}.{webhook-timestamp}.{body}\")). Retried after 5 s, 30 s and 2 min on network errors, 5xx, 408 and 429. Answer 2xx quickly.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_... / sk_test_...","description":"Create keys at https://ai-architectures.com/developers/dashboard. sk_test_ keys are a free sandbox with sample outputs."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Retry safely: the same key with the same body returns the original job instead of creating (and charging) a new one."},"Wait":{"name":"wait","in":"query","schema":{"type":"integer","minimum":0,"maximum":120},"description":"Hold the response up to N seconds and return the finished job if it completes in time (also: Prefer: wait=N)."}},"schemas":{"JobType":{"type":"string","enum":["virtual_staging","photo_edit","render","remodel","floor_plan_redraw","cad","cad_revise"]},"Job":{"type":"object","properties":{"id":{"type":"string","example":"job_5f2c0a9e1b7d4c3a8e6f0b12"},"object":{"const":"job"},"type":{"$ref":"#/components/schemas/JobType"},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"mode":{"type":"string","enum":["live","test"]},"livemode":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"credits_charged":{"type":"integer","description":"Credits deducted for this job (0 for failed jobs and sandbox)."},"credits_estimate":{"type":"integer","description":"Sandbox only: what the job would cost live."},"input":{"type":"object","additionalProperties":true},"output":{"type":["object","null"],"properties":{"images":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"formats":{"type":"object","properties":{"jpg":{"type":"string"},"png":{"type":"string"},"webp":{"type":"string"}}},"preview_url":{"type":"string"},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]}}}},"files":{"type":"object","properties":{"dxf":{"type":"string"},"dwg":{"type":"string"},"pdf":{"type":"string"},"png":{"type":"string"}}},"version":{"type":"integer"},"title":{"type":["string","null"]},"units":{"type":["string","null"]},"sandbox":{"type":"boolean"},"links_expire_at":{"type":"string","format":"date-time"}}},"error":{"type":["object","null"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"metadata":{"type":["object","null"]},"links":{"type":"object","properties":{"self":{"type":"string"}}}}},"Account":{"type":"object","properties":{"account_id":{"type":"integer"},"mode":{"type":"string"},"credits_balance":{"type":"integer"},"key":{"type":"object"},"limits":{"type":"object"},"pricing_credits":{"type":"object"}}},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","example":"evt_..."},"type":{"type":"string","enum":["job.succeeded","job.failed","webhook.test"]},"created_at":{"type":"string","format":"date-time"},"livemode":{"type":"boolean"},"data":{"$ref":"#/components/schemas/Job"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"insufficient_credits"},"message":{"type":"string"},"status":{"type":"integer"}}}}}}}}