Skip to main content
POST
/
3d
/
text_to_3d
Generate 3D model from text
curl --request POST \
  --url https://modelslab.com/api/v6/3d/text_to_3d \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "prompt": "A full body mesh of a dog",
  "resolution": 512,
  "output_format": "glb",
  "render": false,
  "negative_prompt": "",
  "guidance_scale": 3,
  "num_inference_steps": 30,
  "ss_guidance_strength": 7.5,
  "ss_sampling_steps": 50,
  "slat_guidance_strength": 3,
  "slat_sampling_steps": 50,
  "mesh_simplify": 0.9,
  "foreground_ratio": 0.85,
  "remove_bg": false,
  "chunk_size": 8192,
  "seed": 0,
  "temp": "no",
  "webhook": "<string>",
  "track_id": "<string>"
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "meta": {
    "chunk_size": 123,
    "file_prefix": "<string>",
    "foreground_ratio": "<string>",
    "guidance_scale": 123,
    "image": "<string>",
    "negative_prompt": "<string>",
    "num_inference_steps": 123,
    "output_format": "<string>",
    "prompt": "<string>",
    "remove_bg": true,
    "render": true,
    "resolution": 123,
    "seed": 123,
    "temp": "<string>",
    "ss_guidance_strength": 123,
    "ss_sampling_steps": 123,
    "slat_guidance_strength": 123,
    "slat_sampling_steps": 123,
    "mesh_simplify": 123,
    "multi_image": true,
    "texture_size": 123
  }
}

Request

Make a POST request to below endpoint and pass the required parameters as a request body.
curl
--request POST 'https://modelslab.com/api/v6/3d/text_to_3d' \

Body

json
{    
    "key": "your_api_key",    
    "foreground_ratio": "0.85",    
    "prompt": "a ghost wearing white bedsheet",    
    "num_inference_steps": "30",    
    "resolution": 512,    
    "guidance_scale": "3",    
    "ss_sampling_steps": 50,    
    "slat_sampling_steps": 50,    
    "seed": 0,    
    "temp": "no",    
    "webhook": null,    
    "track_id": null
}

Body

application/json
key
string
required

API key for request authorization

prompt
string
default:A full body mesh of a dog
required

Text prompt to describe the 3D model to generate

resolution
integer
default:512

Resolution of the generated 3D model

Required range: x <= 512
output_format
enum<string>
default:glb

Format of the generated 3D model

Available options:
obj,
stl,
ply,
glb
render
boolean
default:false

Whether to render a NeRF video of the generated 3D model

negative_prompt
string
default:""

Text to exclude specific elements from the generated model

guidance_scale
number
default:3

Balances the adherence to the prompt versus creativity in the generation

num_inference_steps
integer
default:30

Number of steps for generating the 3D model

ss_guidance_strength
number
default:7.5

Strength of style-space guidance for refinement

ss_sampling_steps
integer
default:50

Number of steps for style-space sampling

Required range: 1 <= x <= 50
slat_guidance_strength
number
default:3

Strength of slat guidance for model details

Required range: 0 <= x <= 10
slat_sampling_steps
integer
default:50

Number of steps for slat guidance sampling

Required range: 1 <= x <= 50
mesh_simplify
number
default:0.9

Degree of mesh simplification to optimize the output model

Required range: 0.9 <= x <= 0.98
foreground_ratio
number
default:0.85

Ratio of the foreground size to the overall image size

remove_bg
boolean
default:false

Removes the background from the generated model if enabled

chunk_size
integer
default:8192

Size of processing chunks (affects VRAM usage)

Required range: x <= 12000
seed
integer
default:0

Random seed for reproducibility; 0 generates a random seed

temp
enum<string>
default:no

Save output files in a temporary directory when set to 'yes'

Available options:
yes,
no
webhook
string | null

Webhook URL for completion notification

track_id
string | null

Custom tracking ID for the request

Response

3D generation response

  • Option 1
  • Option 2
status
enum<string>
Available options:
success
generationTime
number

Time taken to generate the 3D model in seconds

id
integer

Unique identifier for the generation request

output
string<uri>[]

Array of URLs to the generated 3D files

Array of proxy URLs for the generated 3D files

meta
object

Metadata about the generation process and parameters used

I