For AI agents: this page is also available as Markdown at https://docs.refabric.com/task-api-reference/production-prep.md, and the index of every page is https://docs.refabric.com/llms.txt.

Production prep

Takes what production needs from an image: its materials, colours or print, a larger copy, or a vector file.

Tasks

Quick start

image.extract_materials

import os
import time
import requests

headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}

job = requests.post(
    "https://api.refabric.com/v1/tasks/image.extract_materials",
    headers=headers,
    json={
        "image": "art:9f3c01",
    },
).json()
print(job["job_id"])

while True:
    status = requests.get(job["status_url"], headers=headers).json()
    if status["lifecycle"] == "terminal":
        break
    time.sleep(5)

print(requests.get(job["result_url"], headers=headers).json())