What are ChatGPT and Gemini? They are advanced Large Language Models (LLMs) capable of writing functional code, debugging scripts, and automating tasks based on natural language instructions. By providing them with the Neural4D API Documentation (PDF), you can instruct these AI tools to write the exact Python or Node.js scripts needed to generate watertight 3D models without writing a single line of code yourself.
This integration bridges the gap between natural language prompts and production-ready 3D assets, allowing creators to build custom 3D applications, Discord bots, or automated e-commerce pipelines effortlessly.
Looking for frontend development instead? If you prefer to generate models manually and use Gemini to write the display code (like Three.js), check out our Guide to Building Interactive 3D Websites or watch the video tutorial below:
Need direct code integration? For developers looking to write their own backend scripts manually without AI tools, see our dedicated guide on How to Integrate Neural4D API into Custom Workflows.
Before you start prompting, you need your unique API key. This authenticates your requests to the Direct3D-S2 engine. For a detailed walkthrough, check out our guide on How to Get and Manage Your Neural4D API Key.
| Step 1 | Log in to the Neural4D Studio. |
| Step 2 | Navigate to your account settings and select the API Keys tab. |
| Step 3 | Click Generate New Key and copy the sk-xxx string. Keep this secure and do not share it publicly. |
The secret to generating successful scripts with ChatGPT or Gemini lies in providing them with the correct API specifications. Copy the prompt template below, replace the placeholder with your API key, and paste it into your favorite AI chatbot.
Please write a Python script to call the Neural4D API to generate a 3D model.
Here are the API specifications:
1. Endpoint: POST https://api.neural4d.com/v1/generate
2. Headers required: "Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json"
3. Body parameters (JSON):
- "prompt": A string describing the 3D model (e.g., "A futuristic sci-fi helmet").
- "quality": "high"
4. The API returns a JSON response containing a "task_id".
After the POST request, write a polling loop to check the status:
1. Endpoint: GET https://api.neural4d.com/v1/tasks/{task_id}
2. Headers required: "Authorization: Bearer YOUR_API_KEY"
3. Poll every 5 seconds until the "status" field in the response is "completed".
4. Once completed, extract the "model_url" from the response and download the .obj file to the local directory.
Please use the `requests` library in Python. Here is my API key: [INSERT_YOUR_API_KEY_HERE]The AI will immediately output a clean, ready-to-use Python script based on these exact instructions.
Once ChatGPT or Gemini provides the Python script, follow these steps to execute it:
pip install requests.
python generate_3d.py.If the script fails to run, it is usually due to one of the following issues:
| 401 Unauthorized | You forgot to replace the [INSERT_YOUR_API_KEY_HERE]
placeholder with your actual API key, or the key is invalid. |
| ModuleNotFoundError | You haven't installed the `requests` library. Run
pip install requests in your terminal.
|
| Timeout Error | The polling loop might have timed out. Ensure your script waits at least 90-120 seconds, as high-quality 3D generation requires significant GPU computation. |
Need assistance? Contact Support.
Read more: Why your next project needs an Image-to-3D API.