Documentation

AI Features API

Access AI-powered features including semantic search, embeddings, and product enhancements.

Credits Required

Most AI endpoints consume credits. Check your balance before making requests.

POST /api/v1/ai/semantic-search

Search products using natural language. Requires embeddings to be generated first.

Request Body

Field Type Required Description
query string Yes Natural language search query (e.g., "wireless ceiling microphone for conference rooms")
limit integer No Maximum number of results to return (default: 10, max: 50)
threshold decimal No Minimum similarity score 0-1 (default: 0.7). Higher values return more relevant results.
includeBundles boolean No Include bundles in search results (default: true)

Example Request

{
    "query": "wireless ceiling microphone for conference rooms",
    "limit": 10,
    "threshold": 0.7,
    "includeBundles": true
}

Response

{
    "success": true,
    "data": {
        "query": "wireless ceiling microphone for conference rooms",
        "results": [
            {
                "id": 456,
                "isBundle": false,
                "name": "Shure MXA920",
                "description": "Ceiling array microphone",
                "similarity": 0.92,
                "make": "Shure",
                "model": "MXA920",
                "price": 2899.00,
                "productType": "Microphone"
            }
        ],
        "totalResults": 8,
        "embeddingStats": {
            "totalProducts": 1500,
            "productsWithEmbeddings": 1450,
            "percentageComplete": 96.7
        }
    }
}

POST /api/v1/ai/embeddings/generate

Generate embeddings for products and bundles. Runs in batches. Call repeatedly until all products are processed.

Request Body

Field Type Required Description
batchSize integer No Number of items to process per call (default: 50, max: 100)

Example Request

{
    "batchSize": 50
}

Response

{
    "success": true,
    "data": {
        "productsProcessed": 50,
        "bundlesProcessed": 10,
        "totalProcessed": 60,
        "stats": {
            "totalProducts": 1500,
            "productsWithEmbeddings": 1450,
            "totalBundles": 25,
            "bundlesWithEmbeddings": 25,
            "percentageComplete": 96.7
        },
        "message": "Generated embeddings for 50 products and 10 bundles"
    }
}

GET /api/v1/ai/embeddings/status

Get embedding generation status for products and bundles.

Response

{
    "success": true,
    "data": {
        "products": {
            "total": 1500,
            "withEmbeddings": 1450,
            "withoutEmbeddings": 50,
            "percentageComplete": 96.7
        },
        "bundles": {
            "total": 25,
            "withEmbeddings": 25,
            "withoutEmbeddings": 0,
            "percentageComplete": 100.0
        },
        "overall": {
            "total": 1525,
            "withEmbeddings": 1475,
            "withoutEmbeddings": 50,
            "percentageComplete": 96.7
        },
        "isReady": true
    }
}

POST /api/v1/ai/product/enhance-metadata

Enhance product metadata using AI. Returns suggestions without modifying the product. Consumes 1 AI credit.

Request Body

Field Type Required Description
productId integer Yes ID of the product to enhance

Example Request

{
    "productId": 456
}

Response

{
    "success": true,
    "data": {
        "productId": 456,
        "originalData": {
            "make": "Shure",
            "model": "MXA920",
            "description": null
        },
        "enhancedData": {
            "recommendedMake": "Shure",
            "recommendedModel": "MXA920",
            "description": "Ceiling array microphone with IntelliMix DSP",
            "longDescription": "The Shure MXA920 is a premium ceiling array microphone..."
        },
        "creditsUsed": 1.0,
        "message": "Product metadata enhanced successfully. Review and apply changes as needed."
    }
}

POST /api/v1/ai/product/generate-connection-metadata

Generate a product's connection metadata (input and output ports, device type, category) with AI and save it to the product. Needs 5 AI credits. A product that already has sub-devices is built as a kit and keeps every sub-device, with the values set on them. A product linked to a certified library device is refused with 409 PRODUCT_CERTIFIED before any credit check, and nothing is charged. A read-only API key is refused with 403 READ_ONLY_ACCESS.

Request Body

Field Type Required Description
productId integer Yes ID of the product to generate metadata for

Example Request

{
    "productId": 456
}

Response

inputPorts, outputPorts and subDevices are counts of what the product now has; the ports themselves are saved to the product.

{
    "success": true,
    "data": {
        "success": true,
        "productId": 456,
        "inputPorts": 2,
        "outputPorts": 1,
        "subDevices": 0,
        "category": "Input",
        "deviceType": "Microphone",
        "message": "Generated 2 input ports, 1 output ports",
        "creditsUsed": 5
    },
    "message": null,
    "timestamp": "2026-11-10T15:30:00Z"
}

Certified Product Response (409)

{
    "success": false,
    "error": {
        "code": "PRODUCT_CERTIFIED",
        "message": "This product is linked to a certified device in the AVstackr library, so AI fill is off for it. Change its ports by hand in the port editor, or use Reset to library ports on the product page.",
        "details": null
    },
    "timestamp": "2026-11-10T15:30:00Z"
}

Error Codes

Code HTTP Status Description
PRODUCT_CERTIFIED 409 The product is linked to a certified library device, so AI fill is off for it. Nothing is charged. Change its ports by hand, or use Reset to library ports on the product page; see Certified Systems.
PRODUCT_NOT_FOUND 404 No product of yours has the ID
INSUFFICIENT_CREDITS 400 Fewer than 5 credits are left
GENERATION_FAILED 400 The AI could not generate connection metadata; the product is unchanged

POST /api/v1/ai/product/generate-description

Generate a product description from make/model without needing an existing product. Consumes 1 AI credit.

Request Body

Field Type Required Description
make string Yes Manufacturer name (e.g., "Crestron", "Shure")
model string Yes Model number or name
part string No Part number (if different from model)

Example Request

{
    "make": "Crestron",
    "model": "CP4-R",
    "part": "CP4-R"
}

Response

{
    "success": true,
    "data": {
        "input": {
            "make": "Crestron",
            "model": "CP4-R"
        },
        "generatedData": {
            "recommendedMake": "Crestron",
            "recommendedModel": "CP4-R",
            "description": "4-Series Control System",
            "longDescription": "The Crestron CP4-R is a rack-mountable 4-Series control processor..."
        },
        "creditsUsed": 1.0
    }
}

POST /api/v1/ai/room/suggest-equipment

Get AI-powered equipment suggestions based on room type and requirements. Uses semantic search to find relevant products from your catalog.

Request Body

Field Type Required Description
roomType string Yes Type of room (e.g., "Large Conference Room", "Huddle Space", "Training Room", "Boardroom")
capacity integer No Room seating capacity (helps refine suggestions)
additionalRequirements string No Additional requirements in natural language (e.g., "Video conferencing capability", "Multiple displays")
maxSuggestionsPerCategory integer No Max suggestions per equipment category (default: 5)
maxTotalSuggestions integer No Max total suggestions across all categories (default: 20)

Example Request

{
    "roomType": "Large Conference Room",
    "capacity": 20,
    "additionalRequirements": "Video conferencing capability",
    "maxSuggestionsPerCategory": 5,
    "maxTotalSuggestions": 20
}

Response

{
    "success": true,
    "data": {
        "roomType": "Large Conference Room",
        "capacity": 20,
        "suggestions": [
            {
                "productId": 456,
                "make": "Shure",
                "model": "MXA920",
                "description": "Ceiling array microphone",
                "price": 2899.00,
                "category": "Microphone",
                "relevanceScore": 0.95,
                "rationale": "Recommended for Large Conference Room: Microphone"
            }
        ],
        "totalSuggestions": 18,
        "categories": ["Display", "Camera", "Microphone", "Video Conferencing", "DSP"]
    }
}
Embeddings Required

Equipment suggestions use semantic search, which requires embeddings to be generated first.


POST /api/v1/ai/project/executive-summary

Generate an executive summary for a project using AI. Processes each room and creates a consolidated summary. Charged by the work in each summary — updating fewer rooms costs less. A run needs a balance of at least 1 credit; creditsUsed is what the run took from your balance. There are no free runs, so wasFreeUse is always false.

Request Body

Field Type Required Description
projectId integer Yes ID of the project to generate a summary for
roomIds integer[] Yes Room IDs to include in the summary. Must be non-empty. Every ID must belong to the project — calls with any invalid ID are rejected. Use GET /api/v1/projects/{projectId}/rooms to discover valid IDs.

Example Request

{
    "projectId": 123,
    "roomIds": [45, 46, 47]
}

Response

{
    "success": true,
    "data": {
        "projectId": 123,
        "projectName": "Acme Corporate HQ",
        "summary": "Executive Boardroom\n\nScope of Work\nThe Executive Boardroom will support hybrid meetings...",
        "summaryHtml": "<h3>Executive Boardroom</h3><h4>Scope of Work</h4><p>The Executive Boardroom will support hybrid meetings...</p>...",
        "roomSummaries": [
            {
                "roomId": 45,
                "roomName": "Executive Boardroom",
                "summary": "Executive Boardroom\n\nScope of Work\nThe Executive Boardroom will support hybrid meetings and presentations...",
                "summaryHtml": "<h3>Executive Boardroom</h3><h4>Scope of Work</h4><p>The Executive Boardroom will support hybrid meetings and presentations...</p><h4>Video</h4><ul><li>One (1) 98-inch 4K display will be wall mounted...</li></ul>...",
                "itemCount": 12,
                "categoryCount": 5
            },
            {
                "roomId": 46,
                "roomName": "Large Conference Room",
                "summary": "Large Conference Room\n\nScope of Work\nThe Large Conference Room will support hybrid meetings...",
                "summaryHtml": "<h3>Large Conference Room</h3><h4>Scope of Work</h4><p>The Large Conference Room will support hybrid meetings...</p>...",
                "itemCount": 8,
                "categoryCount": 4
            }
        ],
        "roomsProcessed": 3,
        "creditsUsed": 1.5, // what this run took from your balance
        "wasFreeUse": false, // always false: summaries have no free runs
        "timestamp": "2024-12-26T15:30:00Z"
    }
}

summaryHtml is the formatted summary: per room an h3 room name, an h4 Scope of Work heading and its paragraph, each category as an h4 and a bulleted list (ul/li, with a nested list for sub-bullets), and an h4 Integration heading and its paragraph. summary is the same text as plain text, with "• " before each bullet and " o " before each sub-bullet. Each entry in roomSummaries carries its own room's slice in both forms.

Error Codes

Code Description
PROJECT_NOT_FOUND The specified project does not exist or belongs to another tenant
MISSING_ROOM_IDS The roomIds field was missing or empty (also raised by the validation layer as VALIDATION_ERROR)
INVALID_ROOM_IDS One or more provided roomIds do not belong to the specified project. The error message lists the offending IDs. The whole call is rejected — no partial summary is generated and no credits are deducted.
INSUFFICIENT_CREDITS Your balance is below the minimum charge (1 credit), so the summary was not generated
AI_GENERATION_FAILED AI service failed to generate the summary
Use Cases

Executive summaries are ideal for proposals, client presentations, and project documentation. Each room is analyzed individually, then combined into a cohesive project overview.