Introducing the Prompt2CAD API: Generate and refine CAD from code
From a design brief to a CAD file, inside your own application.
Prompt2CAD team ·
Your application has a description of a physical object. Perhaps it is a customer brief for a fitted cabinet, a bracket that needs to fit an existing assembly, or an enclosure for a prototype. How do you turn that description into a CAD model and keep changing it as the requirements develop?
We have opened the Prompt2CAD developer API in beta to make that workflow available from your own software. Send text with optional reference images or CAD/3D files, choose the default agent or lower-cost DeepSeek V4.1 Flash, refine the same project, and download the geometry in the format your next tool needs.
The API uses the same design agent as the Prompt2CAD app. You can call it from Python, JavaScript, or any HTTP client.
You can also pass CAD files to the API so the agent can work with geometry you already have. Start from an existing part or assembly, describe the next design task, and keep developing the project from there.
A CAD workflow you can build into your product
For physical objects, a useful model needs more than an appealing silhouette. A bracket has mounting holes and wall thicknesses. An enclosure needs an interior cavity. A fitted shelf has to respect the space available.
Prompt2CAD builds dimensioned, parametric CAD geometry. The agent retains the model and conversation within a project, so a follow-up request can change an existing design rather than start again from an unrelated description.
Meshes remain useful for web previews and 3D printing, and the API exports those too. The distinction is the modeling workflow: you can describe physical constraints, develop the design through successive requests, and export STEP for downstream CAD work.
Exported files carry geometry at a chosen model state. They do not carry the agent's editable parameter source or promise a native feature tree in another CAD application. Continued conversational refinement happens in the API project.
From a brief to a file: create, generate, refine, export
Consider a simple integration that creates a mounting bracket. The following requests illustrate the workflow; they are not a record of a measured generation. For complete runnable Python and JavaScript examples, use the API quickstart.
1. Create a project
First, create an API key, store it on your server, and set PROMPT2CAD_API_KEY in your environment. Keep the returned project ID in your application.
curl -X POST "https://prompt2cad.com/api/v1/projects" \
-H "Authorization: Bearer $PROMPT2CAD_API_KEY" \
-H "Idempotency-Key: bracket-demo-project-1" \
-H "Content-Type: application/json" \
-d '{"name":"Mounting bracket"}'Set PROJECT_ID to the response's id. The idempotency key identifies this operation: reuse it when retrying the same request, and choose a new key for a new operation.
2. Submit the design brief
Include dimensions and the constraints that matter to the object. Here is an illustrative bracket brief:
curl -X POST "https://prompt2cad.com/api/v1/projects/$PROJECT_ID/generations" \
-H "Authorization: Bearer $PROMPT2CAD_API_KEY" \
-H "Idempotency-Key: bracket-demo-generate-1" \
-H "Content-Type: application/json" \
-d '{
"prompt":"Create an L bracket, 100 mm wide, with 6 mm walls and two mounting holes of 8 mm diameter. Make each leg 60 mm long.",
"executionMode":"autonomous",
"unitSystem":"metric"
}'Generation is asynchronous. A 202 Accepted response means the job was accepted, not that the design is already complete. Set GENERATION_ID to the returned id, then poll its status every five seconds:
curl "https://prompt2cad.com/api/v1/projects/$PROJECT_ID/generations/$GENERATION_ID" \
-H "Authorization: Bearer $PROMPT2CAD_API_KEY"Wait for completed before exporting or submitting the next refinement. Handle other states explicitly: a paused job needs a deliberate resume request, and a failed job needs investigation. The quickstart covers the state transitions and usage information.
3. Refine the same design
Once the first generation completes, send another brief to the same project:
curl -X POST "https://prompt2cad.com/api/v1/projects/$PROJECT_ID/generations" \
-H "Authorization: Bearer $PROMPT2CAD_API_KEY" \
-H "Idempotency-Key: bracket-demo-refine-1" \
-H "Content-Type: application/json" \
-d '{
"prompt":"Increase the bracket width to 120 mm. Keep the leg lengths, wall thickness and hole diameters unchanged.",
"executionMode":"autonomous"
}'This creates a new generation within the retained design context. Save its returned ID and poll it to completion. In a customer-facing tool, this is where a user could request a change without your application having to rebuild the modeling instructions from scratch.
4. Export the completed revision
Set GENERATION_ID to the completed refinement's ID. Request STEP for downstream CAD work and PNG for a viewport preview:
curl -X POST "https://prompt2cad.com/api/v1/projects/$PROJECT_ID/exports" \
-H "Authorization: Bearer $PROMPT2CAD_API_KEY" \
-H "Idempotency-Key: bracket-demo-export-1" \
-H "Content-Type: application/json" \
-d "{\"generationId\":\"$GENERATION_ID\",\"formats\":[\"step\",\"png\"]}"Save the returned export id as EXPORT_ID, then poll GET /api/v1/projects/$PROJECT_ID/exports/$EXPORT_ID. Check each artifact's status and download completed artifacts using their downloadUrl and your API key. An export can finish with some formats failed.
Exports capture an immutable snapshot: a later design change does not alter a file you already requested. Download URLs require authentication, and artifacts expire seven days after export creation. Save the files in your own storage when you need longer retention.
Text, reference images, and human input
For a visual brief, upload JPEG, PNG, or WebP references through POST /files and include their IDs in imageFileIds. You can attach up to four images to a generation. Give dimensions in the prompt as well: an image alone does not establish accurate scale.
The default autonomous mode accepts the agent's suggested clarification defaults and automatically approves validated room plans. Selected defaults appear in the response's assumptions array, so your integration can expose them for review.
Use interactive mode when a person should answer clarification questions or approve a room plan. Your application reads the pending questions or plan reviews when the job reaches awaiting_input, then submits the user's answers or decision through the API.
Bring your existing CAD into the workflow
Many design workflows already have a starting model: a supplier component, a previous product revision, or a part exported from another CAD tool. Re-describing that geometry in a prompt loses useful context and creates work before the actual design task begins.
Pass a CAD file to the API and give the agent a design task. The workflow is existing geometry + a change request → an updated design → an export for the next tool.
For example, a developer could build a workflow around requests such as:
- Design around a supplied component: “Use this component as the reference for an enclosure, with space for its connectors and mounting points.”
- Adapt an existing part: “Modify this bracket for the new mounting arrangement.”
- Explore product variants: “Use this model as the starting point for a version with a different footprint.”
- Connect CAD handoffs: take a model from an existing design process, attach the next design brief, and return the result to that process for review.
Use the API documentation to check supported input formats, the upload workflow, and editing limits. Imported geometry provides a starting point for the design task; it does not recover the source file's original feature history or make every imported feature parametrically editable.
Upload a part and request a modification
For a concrete example, suppose you already have a plate exported as plate.stl in millimeters. Create an API project as above, then upload the raw file bytes:
curl "https://prompt2cad.com/api/v1/cad-files?fileName=plate.stl&units=mm" \
-H "Authorization: Bearer $PROMPT2CAD_API_KEY" \
-H "Content-Type: application/octet-stream" \
--data-binary @plate.stlCheck the response's units and bounds, then set CAD_FILE_ID to its id. Attach it to the change request:
curl -X POST "https://prompt2cad.com/api/v1/projects/$PROJECT_ID/generations" \
-H "Authorization: Bearer $PROMPT2CAD_API_KEY" \
-H "Idempotency-Key: plate-demo-modify-1" \
-H "Content-Type: application/json" \
-d "{\"prompt\":\"Use the attached plate as the base. Add two 6 mm diameter through-holes, centered across its width and spaced 60 mm apart along its length. Preserve the outer shape and thickness.\",\"cadFileIds\":[\"$CAD_FILE_ID\"],\"model\":\"deepseek/deepseek-v4.1-flash-1017\"}"Save the returned generation ID and poll until it completes. To change the holes again, submit another prompt to the same project, for example “Increase the two hole diameters to 8 mm; preserve their centers and the plate.” The project retains the source and modified geometry, so you do not need to upload the file again or resend cadFileIds. Use a new idempotency key for each new change, and export the completed revision as shown above.
Supported inputs are DWG, DXF, SKP, OBJ, STL, GLB and self-contained glTF. STEP and IGES are not supported inputs. GLB/glTF must embed their buffers and images; DWG ACIS solids are not decoded. Source uploads are limited to 10 MiB, normalized geometry to 8 MiB per file, and retained CAD attachments to 16 MiB per project.
An uploaded file is reference material until the agent explicitly uses it. Say “use the attached part as the base” when you want it inserted, or “inspect the attached part” when you only need its dimensions to design around it. Imported meshes remain meshes, with supported local geometry edits; they are not automatically rebuilt into the source application's parametric feature tree.
Choose the AI model for each generation
Use "model":"default", or leave model out, for the configured default CAD agent, currently DeepSeek V4.1 Flash 1017. Set "model":"deepseek/deepseek-v4.1-flash-1017" to select that model explicitly. This works for a new design, a change to an imported part, or a refinement of an API-generated model:
curl -X POST "https://prompt2cad.com/api/v1/projects/$PROJECT_ID/generations" \
-H "Authorization: Bearer $PROMPT2CAD_API_KEY" \
-H "Idempotency-Key: plate-demo-refine-deepseek-1" \
-H "Content-Type: application/json" \
-d '{"prompt":"Increase the two hole diameters to 8 mm; preserve their centers and the plate.","model":"deepseek/deepseek-v4.1-flash-1017"}'The choice applies to that generation, including a paused generation's resume. Omitting it on the next refinement uses the current default. Switching models preserves the project's conversation and CAD geometry. The generation response reports your selected model option.
As of October 22, 2026, the default DeepSeek V4.1 Flash 1017 costs $1.20 per million input tokens, $0.024 per million cached input tokens, and $4.80 per million output tokens. Output includes reasoning tokens; the cached rate applies only to cache hits reported by the provider. Billing uses the same account credits as the app, with charges rounded up to whole credits and a minimum one-credit charge for successful non-zero-token calls. See the current pricing for top-ups and illustrative usage examples.
Token rates are not a fixed quote per design. Models may use different numbers of tokens and iterations, and paid auxiliary tools have their own charges. Check generation usage and the billing guide when evaluating cost for your workflow.
The opportunity is to make the CAD agent useful at the next step of an existing project, as well as at the beginning of a new one.
What could you build with the beta today?
Three starting points we would like developers to explore:
- Custom-object design tools. Turn a customer brief into an initial furniture or product model, show a preview, and collect follow-up changes before downstream detailing.
- Hardware prototyping workflows. Generate an enclosure, bracket, or fixture from dimensions and references, then export it for further engineering or print preparation.
- Internal design automation. Connect incoming requests to retained CAD projects, track background jobs, and deliver files to your existing review process.
These are integration ideas, not claims of existing customer deployments. The beta supports API-created projects; it does not import existing web-app projects or provide an embedded CAD editor.
Choose the output for the next step
The API supports nine export formats: STEP, DXF, SKP, GLB, DAE, OBJ, STL, 3MF, and PNG.
Use STEP for CAD interchange, GLB for a web viewer, and STL or 3MF for a 3D-printing workflow. DXF contains 3D geometry, not flattened 2D cutting profiles. PNG is a viewport preview, not an AI-generated photorealistic render. See the export format guide for the relevant limitations.
Generated geometry still needs review for its intended use. Tolerances, material suitability, production drawings, toolpaths, and manufacturing sign-off remain downstream work.
Try it with one real design request
API generation uses your existing Prompt2CAD credit balance and token-based billing, with no separate API subscription. API CAD downloads are available during the trial without a top-up. When generation credits run out, top up the same account to continue; there is no extra credit charge for exports or reference uploads in this release.
The beta currently allows three concurrent generations per account, with one generation at a time per project. Check the documentation for current limits, model eligibility, and error handling.
Start with a well-defined object, inspect the first result, request one change, and export it into the tool you already use. That short loop is the best way to evaluate whether the API fits your workflow.
Get your API key, explore the API overview, or use the OpenAPI specification. If you are building an integration, tell us what you need. We would like to hear where it fits and where it needs to improve.