This guide walks you through how to connect an AI Agent (such as Claude Code, Cursor, or LangChain) to the Neural4D API so that 3D model generation becomes a fully automated, scriptable step in your existing software pipeline.
AI Agents interact with Neural4D through its REST API. You give the agent a natural language instruction, and it translates that into a structured HTTP POST request, polls for task completion, and downloads the output file. No manual scripting is needed on your end.
Agents with MCP (Model Context Protocol) support, such as Claude Code with Blender Connector or Cursor, can take this further and inject the downloaded asset directly into an open Blender or Autodesk Fusion scene automatically. For a practical walkthrough of this approach, see Use Claude Code with Neural4D API: 2026 Developer Guide.
Before instructing any AI Agent to call the Neural4D API, two prerequisites are required.
| Neural4D API Key | All API requests require a Bearer Token. Log in to Neural4D Studio, navigate to account settings, and generate a key under the API Keys tab. See our guide on How to Get and Manage Your Neural4D API Key for full steps. |
| An AI Agent or CLI Tool | You need an AI Agent capable of running terminal commands and making HTTP requests. Claude Code, Cursor, LangChain, or any MCP-compatible agent will work. The agent must be able to read your Bearer Token from environment variables to avoid hardcoding credentials. |
The Neural4D API does not return a completed model immediately. After submitting a POST request, the API returns a task_id. Your agent must then poll a separate status endpoint until the task is marked as complete before downloading the result. Here is how a well-configured agent manages this:
| Polling the Status Endpoint | Instruct the agent to call GET /v1/tasks/{task_id} every 30
seconds and check the status field. Once the value is
completed, proceed to download the output URL.
|
| Handling Timeout Errors | High-quality generation can take 60 to 120 seconds. Instruct the agent to wait at least 150 seconds before treating a task as failed. On a timeout, the agent can re-submit the same request automatically. |
| Storing Task State | For batch workflows, instruct the agent to write each task_id
to a local log file immediately after submission. If the session is
interrupted, the agent can resume by reading the log and polling unfinished
tasks. |
Automating the Neural4D endpoint requires handling JSON body parameters precisely. You can instruct your chosen AI Agent to script these requests using curl or a Python client. For a local environment setup walkthrough, see the Neural4D 3D Model API User Guide.
Provide your agent with the following prompt to test the integration:
Please request a 3D model of a 'Steampunk Aviator Goggles' from the Neural4D API at POST https://api.neural4d.com/v1/generateModelWithText.
Set modelCount: 1, disablePbr: 0.
Use Authorization: Bearer [YOUR_API_KEY].
Once requested, poll the task status, and when complete, save the UUIDs to a log file.The agent will automatically generate the script, handle the HTTP requests, and download the resulting .glb or .obj files directly to your workspace.
Need direct code integration? If you prefer to write the backend scripts manually without an AI Agent, refer to our guide on How to Integrate Neural4D API into Custom Workflows.
Ready to scale your workflows? Discover the Neural4D API.
Need assistance? Contact Support.