---
title: "Connect Threekit to AI Agents: Orchestrate Visual Renders and Exports"
slug: connect-threekit-to-ai-agents-orchestrate-visual-renders-and-exports
date: 2026-07-25
author: Yuvraj Muley
categories: ["AI & Agents"]
excerpt: "Learn how to securely connect Threekit to AI agents using Truto's /tools endpoint. Orchestrate 3D renders, catalog variants, and manufacturing exports."
tldr: "Connect Threekit to AI agents to automate 3D visual renders, generate product catalog variants, and export CAD files using Truto's /tools endpoint. Includes full architectural patterns and rate limit handling."
canonical: https://truto.one/blog/connect-threekit-to-ai-agents-orchestrate-visual-renders-and-exports/
---

# Connect Threekit to AI Agents: Orchestrate Visual Renders and Exports


You want to connect Threekit to an AI agent so your internal systems can independently render 3D assets, orchestrate product catalog updates, generate configuration variants, and export manufacturing files based on natural language inputs. Here is exactly how to do it using Truto's `/tools` endpoint and SDK, completely bypassing the need to maintain a custom Threekit API wrapper or orchestrate complex asynchronous job loops from scratch.

Giving a Large Language Model (LLM) read and write access to your Threekit instance is an engineering headache. You either spend weeks building, hosting, and maintaining a custom connector that understands the nuances of 3D asset hierarchies and async rendering queues, or you use a managed infrastructure layer that handles the boilerplate for you. If your team uses ChatGPT, check out our guide on [connecting Threekit to ChatGPT](https://truto.one/connect-threekit-to-chatgpt-manage-3d-models-and-catalog-variants/), or if you are building on Anthropic's models, read our guide on [connecting Threekit to Claude](https://truto.one/connect-threekit-to-claude-configure-product-attributes-and-options/). For developers building custom autonomous workflows, you need a programmatic way to fetch these tools and bind them to your agent framework.

This guide breaks down exactly how to fetch AI-ready tools for Threekit, bind them natively to an LLM using LangChain (or any framework like LangGraph, CrewAI, or Vercel AI SDK), and execute complex visual configuration workflows. For a deeper look at the architecture behind this approach, refer to our research on [architecting AI agents and the SaaS integration bottleneck](https://truto.one/architecting-ai-agents-langgraph-langchain-and-the-saas-integration-bottleneck/).

## The Engineering Reality of Custom Threekit Connectors

Building AI agents is easy. Connecting them to external SaaS APIs is hard. Giving an LLM access to external visual configuration data sounds simple in a prototype. You write a Node.js function that makes a fetch request and wrap it in an `@tool` decorator. In production, this approach collapses entirely, especially with a 3D architecture as complex as Threekit.

If you decide to integrate Threekit yourself, you own the entire API lifecycle. Threekit's visual commerce API introduces several highly specific integration challenges that break standard LLM assumptions.

### The Asynchronous Job Polling Trap
Visual rendering is computationally expensive. When an agent needs to generate a 2D image of a customized 3D sofa, it cannot simply make a synchronous GET request and receive a PNG in the response. It must dispatch a WebGL or VRay render job, receive a `jobId`, and repeatedly [poll the jobs endpoint](https://truto.one/how-to-handle-long-running-saas-api-tasks-in-ai-agent-tool-calling-workflows/) until the `schedulerState` resolves. 

Standard LLMs do not inherently understand polling (see our guide on [handling long-running SaaS API tasks](https://truto.one/how-to-handle-long-running-saas-api-tasks-in-ai-agent-tool-calling-workflows/)). If you hand-code this integration, you have to write complex prompts to teach the LLM to submit a job, wait, query the job status, check for failures, and then retrieve the final asset. When the LLM inevitably hallucinates and tries to download the image before the job completes, the workflow crashes. You must build strict state machines to shield the LLM from this asynchronous complexity.

### Discriminated Unions in Attribute Schemas
Threekit relies heavily on a flexible configuration schema. Creating an attribute on an asset requires passing a JSON body that completely changes its structure based on the `type` field. A `String` attribute requires different validation than a `Number`, `Color`, or `Asset` attribute. 

When a model attempts to construct the JSON payload to update a material attribute, it frequently mixes properties from different union members - for example, attaching a `max` value to a `Color` type. Your tool execution layer must enforce strict JSON schema validation for these discriminated unions before the payload ever reaches the Threekit API, or you will drown in 400 Bad Request errors.

### The Catalog vs. Asset Dichotomy
Threekit separates raw visual nodes (`Assets`) from the sellable, configurable entities (`Catalog Items`). An LLM tasked with "updating the price of the red chair" must understand this relational model. It needs to find the catalog item, locate the specific variant, and update the variant price, rather than trying to attach a price tag to the raw 3D mesh asset. Without a carefully curated set of high-level tools, the agent will get lost traversing the foreign key relationships between proxy IDs, imported files, and catalog items.

## Architecting a Unified Tool Layer for Threekit

Before writing a line of integration code, decide what layer your agent talks to. Direct API tools push provider quirks into the LLM's context. A unified tool layer collapses these complexities behind stable, predictable schemas.

When using Truto to connect Threekit to your AI agents, you interface with the `/tools` endpoint. Truto translates the upstream Threekit resources into strict JSON schemas optimized for [function calling](https://truto.one/best-unified-api-for-llm-function-calling-ai-agent-tools-2026/). 

```mermaid
flowchart TD
    A["AI Agent <br>(LangChain/LangGraph)"] -->|"1. Fetches Tools"| B["Truto /tools Endpoint"]
    B -->|"Returns JSON Schemas"| A
    A -->|"2. Executes Tool Call"| C["Truto Proxy API"]
    C -->|"3. Normalizes Request"| D["Threekit API"]
    D -->|"Raw Data"| C
    C -->|"Clean JSON"| A
```

### Handling Rate Limits the Right Way
It is critical to understand how API traffic is handled when operating autonomous agents. Threekit enforces strict rate limits on expensive operations like bulk variant generation or high-resolution VRay rendering. 

**Factual note on rate limits:** Truto does not retry, throttle, or apply backoff on rate limit errors. When the upstream Threekit API returns an HTTP 429 Too Many Requests, Truto passes that error directly to the caller. However, Truto normalizes the upstream rate limit info into standardized headers (`ratelimit-limit`, `ratelimit-remaining`, `ratelimit-reset`) per the IETF specification. The caller (your agent framework) is completely responsible for handling retry and exponential backoff logic. Do not build agents assuming the infrastructure will magically absorb 429s.

## Hero Tools for Threekit

Truto provides a comprehensive mapping of Threekit's endpoints. Instead of dumping the entire API specification into your LLM's context window - which guarantees hallucination and context exhaustion - you fetch specific, high-leverage tools. Here are the hero tools that unlock the most powerful autonomous visual commerce workflows.

### Render WebGL Images
`threekit_asset_jobs_render_webgl`

This tool initiates a WebGL render job for a specific Threekit asset or product. It accepts an `asset_id` and an optional configuration object to dictate the visual state. Because this is an async operation, the tool returns a job object containing the `jobId`, which the agent uses to track progress.

> "Generate a WebGL render of asset ID 8f7b2c-9a1d, configured with the 'Oak Wood' material and 'Matte Black' hardware. Return the job ID so we can monitor it."

### Generate Catalog Variants
`threekit_catalog_variants_generate`

When a merchandiser adds a new option (like a new fabric color) to a configurable product, the platform must generate all the new valid combinations. This tool forces Threekit to evaluate the configuration rules and generate all valid variants for a specific `item_id`, automatically skipping invalid combinations.

> "We just added the 'Velvet' fabric option to the modular sofa (Item ID 44b-12x). Run the variant generation tool to compile all new configuration combinations for the catalog."

### Manage Asset Attributes
`create_a_threekit_asset_attribute`

This tool allows the agent to modify the parametric properties of a 3D asset. The request body is a discriminated union, meaning the agent can pass type-specific fields - like `min`, `max`, and `step` for a Number attribute, or hex codes for a Color attribute. It is the primary tool for building product configurators on the fly.

> "Add a numeric attribute called 'Width' to the desk asset (ID 77a-99z). Set the minimum value to 48, maximum to 72, and the step increment to 2. Lock the input to these steps."

### Bulk Update Variant Prices
`threekit_variant_prices_bulk_update`

Pricing complex configurable products requires managing thousands of variants. This tool overwrites the pricing tables for a specific catalog variant, accepting an array of price entries defined by ISO currency codes and amounts.

> "Update the pricing for the 'King Size - Memory Foam' variant of the mattress catalog item. Set the USD price to 1299.00 and the EUR price to 1150.00."

### Initiate 3D File Exports
`threekit_asset_jobs_export`

Visual configuration isn't just for e-commerce; it drives manufacturing. This tool exports a configured Threekit asset into industry-standard 3D or CAD formats like glTF, USDZ, STEP, or STL. It requires the `asset_id` and the desired `format`.

> "The customer finalized their custom shelving unit order. Take their configuration state and trigger an export job for a STEP file so we can send it to the CNC machine."

### Query Job Status
`get_single_threekit_catalog_job_by_id`

Because rendering and exporting are asynchronous, the agent needs a way to check if the file is ready. This tool retrieves the state of a job by ID, surfacing the `schedulerState` and the final `output` URLs once the task completes.

> "Check the status of job ID req-9982. If the scheduler state is 'completed', extract the download URL for the rendered image and provide it to the user."

For the complete inventory of available tools, including detailed query parameters and JSON schemas, visit the [Threekit integration page](https://truto.one/integrations/detail/threekit).

## Workflows in Action

When you combine these tools within an agentic loop, you can automate highly complex visual commerce and manufacturing workflows that previously required manual intervention from 3D artists and catalog managers. Here are three concrete examples of how an AI agent orchestrates Threekit.

### 1. The Autonomous Render Pipeline
Marketing teams constantly need fresh product imagery across thousands of configurations. Instead of manual rendering, an agent handles the entire pipeline.

> "I need a high-res image of the 'Aero Chair' configured with the leather seat and chrome legs. Generate the render, wait for it to finish, and give me the download link."

1. The agent calls `list_all_threekit_products` to find the exact ID of the "Aero Chair".
2. It formats the configuration state (leather seat, chrome legs) and calls `threekit_asset_jobs_render_webgl` to start the rendering process, receiving a `jobId`.
3. The agent enters a controlled loop, calling `get_single_threekit_catalog_job_by_id` every few seconds to check the `schedulerState`.
4. Once the state transitions to `completed`, the agent extracts the `fileId` and returns the final asset URL to the user.

### 2. Catalog Expansion and Pricing
When new inventory options arrive, product catalogs must be updated to reflect every possible combination and its corresponding price impact.

> "We are introducing a 'Matte Finish' option to our dining table line. Add this option to the surface attribute, generate the new variants, and set a $50 premium on all matte configurations."

1. The agent calls `threekit_catalog_attributes_add_option` to append 'Matte Finish' to the existing surface attribute of the dining table.
2. It executes `threekit_catalog_variants_generate` to build the new combinations in the database.
3. It calls `list_all_threekit_catalog_variants` to retrieve the newly created matte variants.
4. Iterating through the results, the agent calls `threekit_variant_prices_upsert` to apply the base price plus the $50 premium to each new configuration.

### 3. Manufacturing Handoff
Once a customer completes a complex B2B order, the visual configuration must be translated into manufacturing instructions.

> "Order #5521 just closed for a custom modular cabinet. Export the exact configuration as a STEP file for the engineering team and grab the vector paths for the vinyl cutter."

1. The agent fetches the finalized order data (potentially from a CRM tool) and maps it to the Threekit configuration.
2. It calls `threekit_asset_jobs_export` specifying the `format` as `step` to generate the CAD file.
3. It simultaneously calls `threekit_asset_jobs_export_paths` to generate an SVG file of the vector paths for the custom cuts.
4. The agent monitors both `jobId`s using `list_all_threekit_jobs`, downloading the respective files when the infrastructure completes the processing.

## Building Multi-Step Workflows

To build these autonomous workflows in production, you need to connect your agent framework to Truto's tool registry. The following example demonstrates how to implement this using LangChain, though the architectural pattern applies equally to LangGraph, CrewAI, or the Vercel AI SDK.

Because Truto dynamically generates these tools based on the live API spec, your agent instantly inherits the exact parameters required by Threekit without you writing manual validation logic.

### 1. Fetching Tools and Binding to the LLM

First, we use the Truto SDK to fetch the tools for the specific connected Threekit account. We then bind these tools directly to the LLM.

```typescript
import { ChatOpenAI } from "@langchain/openai";
import { TrutoToolManager } from "truto-langchainjs-toolset";

// Initialize the Truto Tool Manager with your API key
const trutoManager = new TrutoToolManager({
  apiKey: process.env.TRUTO_API_KEY
});

// Initialize the LLM
const llm = new ChatOpenAI({
  modelName: "gpt-4o",
  temperature: 0,
});

async function initializeAgent() {
  // Fetch tools for the specific Threekit Integrated Account ID
  const threekitAccountId = "act_tk_8832jd9s";
  const threekitTools = await trutoManager.getTools(threekitAccountId);

  // Bind the tools to the LLM
  const llmWithTools = llm.bindTools(threekitTools);
  
  return { llmWithTools, threekitTools };
}
```

### 2. Handling Tool Execution and Rate Limits

When the agent decides to invoke a tool - for example, initiating a bulk export - it returns an `AIMessage` containing `tool_calls`. Your application code must execute these calls against the Truto proxy, carefully monitoring for HTTP 429 rate limit responses.

```mermaid
sequenceDiagram
    participant Agent as AI Agent (LangChain)
    participant App as Workflow Engine
    participant Truto as Truto Proxy
    participant Upstream as Threekit API
    
    Agent->>App: Yields tool_call (threekit_asset_jobs_export)
    App->>Truto: POST /proxy/export
    Truto->>Upstream: Forward Request
    Upstream-->>Truto: HTTP 429 (Too Many Requests)
    Truto-->>App: HTTP 429 + ratelimit-reset header
    Note over App: App detects 429,<br>parses header,<br>and sleeps.
    App->>Truto: Retry POST /proxy/export
    Truto->>Upstream: Forward Request
    Upstream-->>Truto: HTTP 200 OK + jobId
    Truto-->>App: Clean JSON Response
    App-->>Agent: Returns ToolMessage (jobId)
```

Here is how you implement that execution loop, ensuring that Threekit's rate limits are respected without crashing the agent pipeline.

```typescript
import { ToolMessage } from "@langchain/core/messages";

async function executeWithBackoff(toolCall, tools, maxRetries = 3) {
  const tool = tools.find(t => t.name === toolCall.name);
  if (!tool) throw new Error("Tool not found");

  for (let attempt = 0; attempt < maxRetries; attempt++) {
    try {
      // Execute the actual API call via Truto
      const result = await tool.invoke(toolCall.args);
      return new ToolMessage({
        tool_call_id: toolCall.id,
        content: JSON.stringify(result)
      });
    } catch (error) {
      // Check if Truto passed back a 429 Rate Limit from Threekit
      if (error.response && error.response.status === 429) {
        // Extract standardized rate limit headers
        const resetTime = error.response.headers.get('ratelimit-reset');
        const sleepMs = resetTime 
          ? (parseInt(resetTime) * 1000) - Date.now() 
          : Math.pow(2, attempt) * 1000; // Fallback to exponential
          
        console.warn(`Rate limited by Threekit. Sleeping for ${sleepMs}ms...`);
        await new Promise(resolve => setTimeout(resolve, Math.max(sleepMs, 1000)));
        continue;
      }
      // If it's a 400 Bad Request or 500, return the error to the LLM so it can correct itself
      return new ToolMessage({
        tool_call_id: toolCall.id,
        content: `Error executing tool: ${error.message}`
      });
    }
  }
  throw new Error("Max retries exceeded");
}
```

This execution architecture guarantees that your agent interacts safely with Threekit. When the LLM hallucinates an invalid attribute schema, Threekit rejects it, Truto passes the 400 error back, and the `ToolMessage` feeds that error straight back into the LLM's context window. The agent immediately realizes its mistake, corrects the JSON structure, and tries again. 

## The Strategic Advantage of Managed Tool Layers

Connecting AI agents to visual commerce systems like Threekit represents a massive leap in operational efficiency. B2B sales teams can generate custom renders on demand, merchandisers can automate pricing variants, and manufacturing systems can extract CAD files the second an order closes - all orchestrated by natural language.

But building the plumbing to make this work is a massive distraction. Maintaining complex discriminated union schemas, normalizing authentication handshakes, and catching asynchronous job status states across a custom integration layer drains engineering resources. By using Truto's `/tools` endpoint, you instantly map the entire Threekit surface area into safe, validated, agent-ready functions. Your engineers focus on designing the agent's logic and prompting architecture, while the infrastructure handles the integration boilerplate.

> Stop wasting engineering cycles building custom Threekit API wrappers. Get instant, agent-ready tools for Threekit and 100+ other enterprise APIs with Truto.
>
> [Talk to us](https://cal.com/truto/partner-with-truto)
