For application code
Python SDK
Select garment resources, compose jobs, inspect results, and decide the next step in your own code.
from beforewear import Client
bw = Client()Explore the Python SDK ↗SDK & MCP
Let users ask for a result while your application or agent directs the garment workflow. Python and MCP provide the operations and feedback needed to execute the steps behind your interface.
Developer preview: the SDK and local MCP use an in-memory stub. They demonstrate contracts and state transitions, not connected physics or hosted processing.
Request developer access ↗For application code
Select garment resources, compose jobs, inspect results, and decide the next step in your own code.
from beforewear import Client
bw = Client()Explore the Python SDK ↗For AI agents
Expose garment operations as agent tools through the Model Context Protocol. The agent can call jobs, inspect refusals, and revise the inputs.
python -m beforewear.mcpExplore MCP tools ↗Both interfaces use the same resource and job model. These examples run locally from a provided SDK checkout; hosted MCP is planned.
An example workflow
The client selects resources, creates a garment state, and applies artwork to a child state. The mockup request refers to that specific result.
Examples run from a Beforewear SDK checkout. SDK access, managed pilots, and production integrations are gated. Request access to establish the delivery path for your workflow.
Walk through this example ↗from beforewear import Client
bw = Client()
product = bw.products.get("aop-hoodie")
body = bw.bodies.select(
sex="male", size="M", pose="native_straight"
)
material = bw.materials.get("fleece_250gsm")
run = bw.projects.create(
product=product.id,
body=body.id,
material=material.id,
).drape(device="gpu")
printed = bw.graphics.apply(
run.id, artwork={"front": "front.png"}
)
mockup = bw.mockups.render(printed.id, kind="ghost")Use a SKU from your catalog in place of aop-hoodie. The current SDK returns fixture states and output paths through an in-memory stub. It does not generate these images yet.
Workflow / 01
For POD, custom merch, and product catalogs. Work from a known garment and vary its presentation without rebuilding unchanged geometry.
Read the workflow ↗Starting input
Product + Body + Material + artwork
Workflow / 02
For apparel tools and internal agent workflows. Keep construction inspectable and use structured gate failures to drive revision. A tech pack can also branch directly from the 2D inputs.
Read the workflow ↗Starting input
Pattern + Construction + Body + Material
Workflow / 03
For merchandising and visualization systems. The contract defines on-avatar, ghost, flat, and on-model stills. Motion has its own simulate-then-encode branch.
Read the workflow ↗Starting input
Draped or presented Run + requested output
The agent has a boundary
Author the inputsAgents work with Pattern and Construction. Provenance identifies observed, derived, human-declared, and agent-declared information.
Inspect the failureGateError returns a phase, gate, counts, witnesses, and a hint. A failed gate becomes a specific revision task.
Continue from the resultRevise the source inputs, rerun the job, and inspect the new state. The harness keeps this feedback loop explicit.
Gated access
Start with an idea or existing garment.
Tell us what you want to create.