# Meshy 7 API Riferimento API completo per i modelli di generazione 3D Meshy 7. ## Varianti del modello | Modello | Descrizione | | -------------------------- | -------------------------------------------------- | | `meshy-v7-text-to-3d` | Genera un modello 3D da una descrizione testuale | | `meshy-v7-image-to-3d` | Genera un modello 3D da una singola immagine | | `meshy-v7-multiview-to-3d` | Genera un modello 3D da più immagini di riferimento | ## Endpoint ```text POST /api/v1/3d/task GET /api/v1/3d/{task_id} ``` ## Meshy 7: da testo a 3D ### Parametri obbligatori | Parametro | Tipo | Descrizione | | ------------ | ------ | -------------------------------------------- | | `model_name` | string | Deve essere `meshy-v7-text-to-3d` | | `prompt` | string | Descrizione testuale del modello 3D da generare. 1–600 caratteri | ### Parametri facoltativi | Parametro | Tipo | Descrizione | | ------------------ | ------- | ---------------------------------------------------------------------- | | `topology` | string | Topologia dopo la rigenerazione della mesh: `triangle` o `quad`. Valore predefinito: `triangle` | | `target_polycount` | integer | Numero di poligoni desiderato dopo la rigenerazione della mesh. Intervallo: 100–300000. Valore predefinito: 30000 | | `remesh` | boolean | Indica se rigenerare la mesh. Valore predefinito: `true` | | `symmetry_mode` | string | Modalità di simmetria: `off`, `auto` o `on`. Valore predefinito: `auto` | | `pose_mode` | string | Posa umanoide: `a-pose` o `t-pose`. Per impostazione predefinita non è specificata alcuna posa | | `pbr` | boolean | Indica se generare texture dei materiali PBR. Valore predefinito: `false` | | `texture_prompt` | string | Descrizione testuale usata per guidare la generazione delle texture. Massimo 600 caratteri | | `texture_image` | string | URL dell’immagine di riferimento usata per guidare la generazione delle texture | | `seed` | integer | Seme casuale. Valore predefinito: `-1`, che genera un risultato casuale | ### Esempio di richiesta ```javascript const response = await fetch('https://api.flaq.ai/api/v1/3d/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'meshy-v7-text-to-3d', prompt: 'A stylized red panda explorer wearing a small canvas backpack', topology: 'quad', remesh: true, symmetry_mode: 'auto', pose_mode: 'a-pose', pbr: true, texture_prompt: 'Hand-painted fur and weathered canvas with warm autumn colors', texture_image: 'https://example.com/red-panda-texture.png', }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Meshy 7: da immagine a 3D ### Parametri obbligatori | Parametro | Tipo | Descrizione | | ------------ | ------ | ------------------------------------------ | | `model_name` | string | Deve essere `meshy-v7-image-to-3d` | | `image_url` | string | URL pubblicamente accessibile dell’immagine di input | ### Parametri facoltativi | Parametro | Tipo | Descrizione | | ------------------ | ------- | ---------------------------------------------------------------------- | | `topology` | string | Topologia dopo la rigenerazione della mesh: `triangle` o `quad`. Valore predefinito: `triangle` | | `target_polycount` | integer | Numero di poligoni desiderato dopo la rigenerazione della mesh. Intervallo: 100–300000. Valore predefinito: 30000 | | `remesh` | boolean | Indica se rigenerare la mesh. Valore predefinito: `true` | | `symmetry_mode` | string | Modalità di simmetria: `off`, `auto` o `on`. Valore predefinito: `auto` | | `pose_mode` | string | Posa umanoide: `a-pose` o `t-pose`. Valore predefinito: `a-pose` | | `pbr` | boolean | Indica se generare texture dei materiali PBR. Valore predefinito: `false` | | `texture_prompt` | string | Descrizione testuale usata per guidare la generazione delle texture. Massimo 600 caratteri | | `texture_image` | string | URL dell’immagine di riferimento usata per guidare la generazione delle texture | ### Esempio di richiesta ```javascript const response = await fetch('https://api.flaq.ai/api/v1/3d/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'meshy-v7-image-to-3d', image_url: 'https://example.com/ceramic-lamp.png', topology: 'triangle', remesh: true, symmetry_mode: 'auto', pose_mode: 'a-pose', pbr: true, texture_prompt: 'Glazed blue ceramic with subtle gold details', texture_image: 'https://example.com/ceramic-reference.png', }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Meshy 7: da più viste a 3D ### Parametri obbligatori | Parametro | Tipo | Descrizione | | ------------ | -------- | ------------------------------------------------ | | `model_name` | string | Deve essere `meshy-v7-multiview-to-3d` | | `images` | string[] | Da 1 a 4 URL di immagini di riferimento. Non è richiesto un ordine delle viste | ### Parametri facoltativi | Parametro | Tipo | Descrizione | | ------------------ | ------- | ---------------------------------------------------------------------- | | `topology` | string | Topologia dopo la rigenerazione della mesh: `triangle` o `quad`. Valore predefinito: `triangle` | | `target_polycount` | integer | Numero di poligoni desiderato dopo la rigenerazione della mesh. Intervallo: 100–300000. Valore predefinito: 30000 | | `remesh` | boolean | Indica se rigenerare la mesh. Valore predefinito: `true` | | `symmetry_mode` | string | Modalità di simmetria: `off`, `auto` o `on`. Valore predefinito: `auto` | | `pose_mode` | string | Posa umanoide: `a-pose` o `t-pose`. Per impostazione predefinita non è specificata alcuna posa | | `pbr` | boolean | Indica se generare texture dei materiali PBR. Valore predefinito: `false` | | `texture_prompt` | string | Descrizione testuale usata per guidare la generazione delle texture. Massimo 600 caratteri | | `texture_image` | string | URL dell’immagine di riferimento usata per guidare la generazione delle texture | ### Esempio di richiesta ```javascript const response = await fetch('https://api.flaq.ai/api/v1/3d/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'meshy-v7-multiview-to-3d', images: [ 'https://example.com/chair-front.png', 'https://example.com/chair-side.png', 'https://example.com/chair-back.png', ], topology: 'quad', remesh: true, symmetry_mode: 'auto', pbr: true, texture_prompt: 'Natural walnut wood and woven cream fabric', texture_image: 'https://example.com/chair-material-reference.png', }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Formato della risposta ### Invio dell’attività ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/3d/{task_id}", "task_status": "submitted" } } ``` ### Verifica dello stato dell’attività ```javascript const response = await fetch('https://api.flaq.ai/api/v1/3d/{task_id}', { headers: { Authorization: 'Bearer YOUR_API_KEY' }, }); const { data } = await response.json(); console.log(data.task_status); ``` ### Attività completata ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/3d/{task_id}", "task_status": "succeed", "task_status_msg": null, "task_result": { "credit": 0.2, "files": [{ "url": "https://example.com/generated-model.glb" }] } } } ``` ### Valori dello stato dell’attività - `submitted`: L’attività è stata inviata. - `processing`: L’attività è in elaborazione. - `succeed`: L’attività è stata completata correttamente. - `failed`: L’attività non è riuscita.