Models from photos
Create a 3D model of a product from photos, review it, and add it to the library, through the REST API or an MCP agent.
Generate from photos turns product photos into a starting 3D model. The REST API and the MCP connector run the same generation as Add model → Generate in the app, and a generation started here appears there.
Access
REST requests use your workspace API key in X-API-Key. Paths below are relative to https://api.glossi.io/api/v1. MCP tools take the same arguments by name. Errors use the standard shape, { "error": { "code": "...", "message": "..." } }.
| REST | MCP tool |
|---|---|
GET /model-generations/offer | get_model_generation_offer |
POST /model-generations | generate_model_from_photos |
GET /model-generations | list_model_generations |
GET /model-generations/:id | wait_for_model_generation |
POST /model-generations/:id/approve | approve_generated_model |
POST /model-generations/:id/decline | decline_generated_model |
1. Read the offer
curl 'https://api.glossi.io/api/v1/model-generations/offer' \
-H "X-API-Key: $GLOSSI_API_KEY"{
"available": true,
"programId": "8f0c…",
"mode": "USAGE",
"payment": "Uses the workspace's usage when the generation starts. Adding the result to the library costs nothing more.",
"price": null,
"generationMinutesMax": 30,
"typicalGenerationMinutes": 18,
"reviewDays": 30,
"discards": { "max": 2, "left": 2, "next": "FREE", "freesAt": null }
}mode is how your workspace pays for generated models:
| Mode | What it means |
|---|---|
USAGE | Uses your plan's usage when the generation starts. Approving costs nothing more. |
FREE | Included for your workspace. |
CARD | price is charged to the workspace's saved card when an owner or admin approves the result. |
INVOICE | price goes on your organization's monthly invoice when someone with purchase access approves it. |
A failed generation is never charged. Declining a result keeps the usage it spent, and on CARD and INVOICE workspaces each decline uses one of the free discards in discards.
2. Start a generation
Send 1 to 6 photos of the product, front first. Use public links in referenceImageUrls, or upload local files with POST /materials/generate/reference-upload and pass the returned keys in referenceKeys. PNG, JPEG, and WEBP work; large photos are scaled down to fit.
curl -X POST 'https://api.glossi.io/api/v1/model-generations' \
-H "X-API-Key: $GLOSSI_API_KEY" -H 'Content-Type: application/json' \
-d '{
"programId": "8f0c…",
"name": "Water bottle",
"referenceImageUrls": ["https://example.com/bottle-front.jpg", "https://example.com/bottle-side.jpg"],
"units": "mm",
"notes": "210 mm tall, the cap unscrews"
}'The response is 202 with a generationId and an idempotencyKey. Send the same idempotencyKey to retry safely; it never starts twice. A programId from an older offer is refused, so read the offer again if the price changed.
3. Review the result
Poll GET /model-generations/:id until status leaves GENERATING:
| Status | Next step |
|---|---|
GENERATING | Poll again. progress shows the current phase. |
FAILED | error says why. Nothing was charged. |
READY_FOR_REVIEW | preview.views has short-lived images of the model; approval has the terms. Approve or decline. |
DECLINED, EXPIRED | Nothing more to do. A result not reviewed within reviewDays expires. |
NEEDS_PAYMENT_ACTION, PROCESSING_PAYMENT | Card result approved but not paid yet; the bank may need the user to confirm in Glossi. Nothing is added until it is paid. |
ADDING_TO_LIBRARY | Approved; the model is being converted. |
IN_LIBRARY | modelId is ready to use in a project. |
4. Approve or decline
curl -X POST 'https://api.glossi.io/api/v1/model-generations/GENERATION_ID/approve' \
-H "X-API-Key: $GLOSSI_API_KEY" -H 'Content-Type: application/json' -d '{}'When approval.price is set, send { "confirmTotalMinor": <approval.price.totalMinor> } to agree to that exact price. If the card needs your bank's confirmation, payment.status is REQUIRES_ACTION; finish it in Add model in Glossi. Then poll until IN_LIBRARY.
POST /model-generations/:id/decline throws a result away.
Production files
Generate numbered factory production files, keep their views current, and set the inks, decoration methods, and Pantones they print, through the REST API or an MCP agent.
Model prep
Split a model into parts, label its parts and finishes, unwrap its UVs and assign materials, then keep or discard the result, through the REST API or an MCP agent.