Overview
The Text to 3D Simulation API transforms natural language prompts into fully interactive 3D simulations. This endpoint leverages advanced AI to interpret your description and generate a complete simulation environment with actors, terrain, and dynamic elements.
Authentication
curl -X POST "https://api.worldlens.co/api/v1/simulations/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json"
Request Body
Natural language description of the simulation you want to create. Be specific about the environment, actors, and scenarios you envision.
Optional webhook URL to receive notifications when the simulation is complete. Must be a valid HTTPS URL.
Optional simulation settings to customize the generation process. Maximum number of agents to include in the simulation (1-1000)
settings.simulation_duration
Simulation duration in seconds (60-3600)
settings.environment_type
Type of environment: urban, rural, indoor, mixed
settings.weather_conditions
Weather conditions: clear, rain, snow, fog, storm
Example Requests
Basic Simulation
Advanced Simulation
Disaster Scenario
curl -X POST "https://api.worldlens.co/api/v1/simulations/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Create a busy downtown intersection with pedestrians crossing, cars waiting at traffic lights, and a food truck on the corner"
}'
Response
Unique identifier for the created simulation (“id”)
URL-friendly slug for the simulation, useful in web UIs
Current status of the simulation: queued, processing, completed, failed
ISO 8601 timestamp when the simulation was created
Absolute URL to poll build status
Absolute URL to fetch completed simulation data (null until status == completed)
Example Response
{
"id" : "123e4567-e89b-12d3-a456-426614174000" ,
"slug" : "busy-downtown-intersection" ,
"status" : "queued" ,
"created_at" : "2024-01-15T10:30:00Z" ,
"status_url" : "/api/v1/simulations/123e4567-e89b-12d3-a456-426614174000/status/" ,
"result_url" : "/api/v1/simulations/123e4567-e89b-12d3-a456-426614174000/"
}
Status Codes
Simulation successfully queued for processing
Invalid request parameters or malformed prompt
Invalid or missing API key
Server error during simulation creation
Error Response
{
"error" : "Invalid prompt: Prompt must be at least 10 characters long" ,
"code" : "INVALID_PROMPT" ,
"details" : {
"field" : "prompt" ,
"min_length" : 10 ,
"provided_length" : 5
}
}
Webhook Notifications
If you provide a webhook_url, you’ll receive POST notifications at key simulation milestones:
Simulation Started
{
"event" : "simulation.started" ,
"simulation_id" : "sim_abc123def456" ,
"timestamp" : "2024-01-15T10:30:30Z"
}
Simulation Completed
{
"event" : "simulation.completed" ,
"simulation_id" : "sim_abc123def456" ,
"timestamp" : "2024-01-15T10:35:15Z" ,
"result_url" : "https://api.worldlens.co/api/v1/simulations/sim_abc123def456/"
}
Simulation Failed
{
"event" : "simulation.failed" ,
"simulation_id" : "sim_abc123def456" ,
"timestamp" : "2024-01-15T10:32:45Z" ,
"error" : "Failed to generate terrain from prompt"
}
Next Steps