KLIQ|Developers
Quick Start

Getting Started

Go from zero to your first AI-powered inspection in under 5 minutes. Install the SDK, submit a photo, and get graded results.

Prerequisites

You need a KLIQ developer account. If you do not have one yet, sign up for free.

1. Get your API key

After signing up, navigate to Settings > API Keys and generate a new key. Store it as an environment variable:

export KLIQ_API_KEY="kliq_live_abc123..."

2. Install the SDK

npm install @kliq-ai/sdk

3. Initialize the client

import { KliqClient } from '@kliq-ai/sdk';

const kliq = new KliqClient({
apiKey: process.env.KLIQ_API_KEY!,
});

// Scope to your tenant
const tenant = kliq.forTenant('YOUR_TENANT_ID');

4. Create a location

const location = await tenant.locations.create({
name: 'Store #42 - Main Aisle',
address: '123 Retail Blvd, Brussels',
latitude: 50.8503,
longitude: 4.3517,
});

console.log('Location ID:', location.id);

5. Submit an observation

const observation = await tenant.observations.create({
locationId: location.id,
imageUrl: 'https://your-bucket.storage.com/shelf-photo.jpg',
latitude: 50.8503,
longitude: 4.3517,
metadata: { aisle: 'beverages', captured_by: 'rep_jane' },
});

console.log('Observation ID:', observation.id);

6. Run a CV job

const job = await tenant.cv.start({
observationId: observation.id,
model: 'shelf-detection-v2',
});

// Poll for completion (or use webhooks)
let result = await tenant.cv.get(job.id);
while (result.status === 'queued' || result.status === 'processing') {
await new Promise(r => setTimeout(r, 2000));
result = await tenant.cv.get(job.id);
}

console.log('CV Result:', result.result);

Use webhooks instead of polling

For production workloads, set up a webhook to receive cv.job.completed events. See the Webhooks guide.

Next steps

Recipes