> ## Documentation Index
> Fetch the complete documentation index at: https://avala.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript SDK Reference

> Complete API reference for the Avala TypeScript SDK

Auto-generated from SDK source. Last updated: February 2026.

## Client

### `Avala`

Main client class. Default export of `@avala-ai/sdk`.

```typescript theme={null}
import Avala from "@avala-ai/sdk";

const avala = new Avala({
  apiKey: "avk_...",      // or set AVALA_API_KEY env var
  baseUrl: "https://api.avala.ai/api/v1",  // default
  timeout: 30_000,        // ms
});
```

| Parameter | Type      | Default                       | Description                      |
| --------- | --------- | ----------------------------- | -------------------------------- |
| `apiKey`  | `string?` | `AVALA_API_KEY` env var       | Your Avala API key.              |
| `baseUrl` | `string?` | `https://api.avala.ai/api/v1` | API base URL.                    |
| `timeout` | `number?` | `30000`                       | Request timeout in milliseconds. |

**Resources:**

| Property                   | Type                         | Description                                   |
| -------------------------- | ---------------------------- | --------------------------------------------- |
| `avala.datasets`           | `DatasetsResource`           | Dataset operations                            |
| `avala.projects`           | `ProjectsResource`           | Project operations (read-only)                |
| `avala.exports`            | `ExportsResource`            | Export operations                             |
| `avala.tasks`              | `TasksResource`              | Task operations (read-only)                   |
| `avala.storageConfigs`     | `StorageConfigsResource`     | Cloud storage operations                      |
| `avala.agents`             | `AgentsResource`             | Automation agent operations                   |
| `avala.inferenceProviders` | `InferenceProvidersResource` | Inference provider operations                 |
| `avala.autoLabelJobs`      | `AutoLabelJobsResource`      | Auto-labeling job operations                  |
| `avala.qualityTargets`     | `QualityTargetsResource`     | Quality target operations (project-scoped)    |
| `avala.consensus`          | `ConsensusResource`          | Consensus scoring operations (project-scoped) |
| `avala.webhooks`           | `WebhooksResource`           | Webhook subscription operations               |
| `avala.webhookDeliveries`  | `WebhookDeliveriesResource`  | Webhook delivery log operations (read-only)   |
| `avala.organizations`      | `OrganizationsResource`      | Organization management                       |
| `avala.slices`             | `SlicesResource`             | Slice operations                              |

**Methods:**

| Method                | Returns         | Description                           |
| --------------------- | --------------- | ------------------------------------- |
| `avala.rateLimitInfo` | `RateLimitInfo` | Rate limit headers from last response |

***

## Resources

### datasets

#### `avala.datasets.create()`

Create a new dataset.

```typescript theme={null}
const dataset = await avala.datasets.create({
  name: "LiDAR Captures Q1",
  slug: "lidar-captures-q1",
  dataType: "lidar",
  visibility: "private",
  providerConfig: {
    provider: "aws_s3",
    s3_bucket_name: "my-datasets",
    s3_bucket_region: "us-east-1",
    s3_bucket_prefix: "captures/q1/",
    s3_access_key_id: "AKIA...",
    s3_secret_access_key: "your-secret-key",
  },
  ownerName: "my-org",
});
```

| Parameter        | Type                       | Default     | Description                                      |
| ---------------- | -------------------------- | ----------- | ------------------------------------------------ |
| `name`           | `string`                   | —           | Display name for the dataset.                    |
| `slug`           | `string`                   | —           | URL-friendly identifier.                         |
| `dataType`       | `string`                   | —           | Data type: `image`, `video`, `lidar`, or `mcap`. |
| `visibility`     | `string?`                  | `"private"` | `"private"` or `"public"`.                       |
| `createMetadata` | `boolean?`                 | `true`      | Whether to create dataset metadata.              |
| `providerConfig` | `Record<string, unknown>?` | `undefined` | Cloud storage provider configuration.            |
| `ownerName`      | `string?`                  | `undefined` | Dataset owner username or email.                 |

**Returns:** `Promise<Dataset>`

#### `avala.datasets.list()`

List datasets with optional filtering and cursor-based pagination.

```typescript theme={null}
const page = await avala.datasets.list({ dataType: "image", name: "highway", limit: 20 });
```

| Parameter    | Type      | Default     | Description                                                         |
| ------------ | --------- | ----------- | ------------------------------------------------------------------- |
| `dataType`   | `string?` | `undefined` | Filter by data type: `image`, `video`, `lidar`, `mcap`, or `splat`. |
| `name`       | `string?` | `undefined` | Filter by name (case-insensitive substring match).                  |
| `status`     | `string?` | `undefined` | Filter by status: `creating` or `created`.                          |
| `visibility` | `string?` | `undefined` | Filter by visibility: `private` or `public`.                        |
| `limit`      | `number?` | `undefined` | Maximum results per page.                                           |
| `cursor`     | `string?` | `undefined` | Pagination cursor from a previous response.                         |

**Returns:** `Promise<CursorPage<Dataset>>`

#### `avala.datasets.get()`

Get a single dataset by UID.

```typescript theme={null}
const dataset = await avala.datasets.get("550e8400-e29b-41d4-a716-446655440000");
```

| Parameter | Type     | Description                |
| --------- | -------- | -------------------------- |
| `uid`     | `string` | Dataset unique identifier. |

**Returns:** `Promise<Dataset>`

#### `avala.datasets.listItems()`

List items in a dataset. Uses the owner/slug path.

```typescript theme={null}
const page = await avala.datasets.listItems("my-org", "my-dataset", { limit: 50 });
```

| Parameter | Type      | Default     | Description                        |
| --------- | --------- | ----------- | ---------------------------------- |
| `owner`   | `string`  | —           | Dataset owner (organization slug). |
| `slug`    | `string`  | —           | Dataset slug.                      |
| `limit`   | `number?` | `undefined` | Maximum results per page.          |
| `cursor`  | `string?` | `undefined` | Pagination cursor.                 |

**Returns:** `Promise<CursorPage<DatasetItem>>`

#### `avala.datasets.getItem()`

Get a single item within a dataset.

```typescript theme={null}
const item = await avala.datasets.getItem("my-org", "my-dataset", "item_uid");
```

| Parameter | Type     | Description                        |
| --------- | -------- | ---------------------------------- |
| `owner`   | `string` | Dataset owner (organization slug). |
| `slug`    | `string` | Dataset slug.                      |
| `itemUid` | `string` | Item unique identifier.            |

**Returns:** `Promise<DatasetItem>`

#### `avala.datasets.listSequences()`

List sequences in a dataset.

```typescript theme={null}
const page = await avala.datasets.listSequences("my-org", "my-dataset", { limit: 50 });
```

| Parameter | Type      | Default     | Description                        |
| --------- | --------- | ----------- | ---------------------------------- |
| `owner`   | `string`  | —           | Dataset owner (organization slug). |
| `slug`    | `string`  | —           | Dataset slug.                      |
| `limit`   | `number?` | `undefined` | Maximum results per page.          |
| `cursor`  | `string?` | `undefined` | Pagination cursor.                 |

**Returns:** `Promise<CursorPage<DatasetSequence>>`

#### `avala.datasets.getSequence()`

Get a single sequence within a dataset.

```typescript theme={null}
const seq = await avala.datasets.getSequence("my-org", "my-dataset", "sequence_uid");
```

| Parameter     | Type     | Description                        |
| ------------- | -------- | ---------------------------------- |
| `owner`       | `string` | Dataset owner (organization slug). |
| `slug`        | `string` | Dataset slug.                      |
| `sequenceUid` | `string` | Sequence unique identifier.        |

**Returns:** `Promise<DatasetSequence>`

#### `avala.datasets.getFrame()`

Return a single frame's LiDAR JSON metadata. Indexes into `getSequence().frames` client-side.

```typescript theme={null}
const frame = await avala.datasets.getFrame("my-org", "my-dataset", "sequence_uid", 0);
```

**Returns:** `Promise<DatasetFrame>` — throws `RangeError` when `frameIdx` is out of range.

#### `avala.datasets.getCalibration()`

Return the canonicalized per-camera rig for a sequence, derived from `frame[0]`.

```typescript theme={null}
const calib = await avala.datasets.getCalibration("my-org", "my-dataset", "sequence_uid");
```

**Returns:** `Promise<DatasetCalibration>`

#### `avala.datasets.getHealth()`

Read-only ingest/health snapshot. Intended for post-ingest validation.

```typescript theme={null}
const health = await avala.datasets.getHealth("my-org", "my-dataset");
if (!health.ingestOk) console.error(health.issues);
```

**Returns:** `Promise<DatasetHealth>` — includes `totalFrames`, `sequenceCount`, `s3Prefix`, `sequences[]`, `ingestOk`, `issues[]`.

***

### projects

#### `avala.projects.list()`

List projects with cursor-based pagination.

```typescript theme={null}
const page = await avala.projects.list({ limit: 20 });
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<Project>>`

#### `avala.projects.get()`

Get a single project by UID.

```typescript theme={null}
const project = await avala.projects.get("770a9600-a40d-63f6-c938-668877660000");
```

| Parameter | Type     | Description                |
| --------- | -------- | -------------------------- |
| `uid`     | `string` | Project unique identifier. |

**Returns:** `Promise<Project>`

***

### tasks

#### `avala.tasks.list()`

List tasks with optional filtering and cursor-based pagination.

```typescript theme={null}
const page = await avala.tasks.list({
  project: "proj_uid",
  status: "pending",
  limit: 50,
});
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `project` | `string?` | `undefined` | Filter by project UID.    |
| `status`  | `string?` | `undefined` | Filter by task status.    |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<Task>>`

#### `avala.tasks.get()`

Get a single task by UID.

```typescript theme={null}
const task = await avala.tasks.get("990c1800-b62f-85a8-e150-880099880000");
```

| Parameter | Type     | Description             |
| --------- | -------- | ----------------------- |
| `uid`     | `string` | Task unique identifier. |

**Returns:** `Promise<Task>`

***

### exports

#### `avala.exports.list()`

List exports with cursor-based pagination.

```typescript theme={null}
const page = await avala.exports.list({ limit: 10 });
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<Export>>`

#### `avala.exports.create()`

Create a new export. Provide either `project` or `dataset`.

```typescript theme={null}
const exportJob = await avala.exports.create({ project: "proj_uid" });
```

| Parameter | Type      | Default     | Description            |
| --------- | --------- | ----------- | ---------------------- |
| `project` | `string?` | `undefined` | Project UID to export. |
| `dataset` | `string?` | `undefined` | Dataset UID to export. |

**Returns:** `Promise<Export>`

#### `avala.exports.get()`

Get a single export by UID.

```typescript theme={null}
const exportJob = await avala.exports.get("export_uid");
```

| Parameter | Type     | Description               |
| --------- | -------- | ------------------------- |
| `uid`     | `string` | Export unique identifier. |

**Returns:** `Promise<Export>`

***

### storageConfigs

#### `avala.storageConfigs.list()`

List storage configurations.

```typescript theme={null}
const page = await avala.storageConfigs.list();
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<StorageConfig>>`

#### `avala.storageConfigs.create()`

Create a new storage configuration.

```typescript theme={null}
const config = await avala.storageConfigs.create({
  name: "Production S3",
  provider: "aws_s3",
  s3BucketName: "my-bucket",
  s3BucketRegion: "us-west-2",
  s3AccessKeyId: process.env.AWS_ACCESS_KEY_ID!,
  s3SecretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
});
```

| Parameter                  | Type       | Required | Description                      |
| -------------------------- | ---------- | -------- | -------------------------------- |
| `name`                     | `string`   | Yes      | Configuration name.              |
| `provider`                 | `string`   | Yes      | `"aws_s3"` or `"gc_storage"`.    |
| `s3BucketName`             | `string?`  | No       | S3 bucket name.                  |
| `s3BucketRegion`           | `string?`  | No       | S3 region.                       |
| `s3BucketPrefix`           | `string?`  | No       | S3 key prefix.                   |
| `s3AccessKeyId`            | `string?`  | No       | AWS access key ID.               |
| `s3SecretAccessKey`        | `string?`  | No       | AWS secret access key.           |
| `s3IsAccelerated`          | `boolean?` | No       | Enable S3 Transfer Acceleration. |
| `gcStorageBucketName`      | `string?`  | No       | GCS bucket name.                 |
| `gcStoragePrefix`          | `string?`  | No       | GCS key prefix.                  |
| `gcStorageAuthJsonContent` | `string?`  | No       | GCS service account JSON.        |

**Returns:** `Promise<StorageConfig>`

#### `avala.storageConfigs.test()`

Test a storage configuration.

```typescript theme={null}
const result = await avala.storageConfigs.test("config_uid");
// { verified: boolean, errors?: Record<string, string[]> }
```

**Returns:** `Promise<{ verified: boolean; errors?: Record<string, string[]> }>`

#### `avala.storageConfigs.delete()`

Delete a storage configuration.

```typescript theme={null}
await avala.storageConfigs.delete("config_uid");
```

**Returns:** `Promise<void>`

***

### agents

#### `avala.agents.list()`

List automation agents.

```typescript theme={null}
const page = await avala.agents.list({ limit: 20 });
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<Agent>>`

#### `avala.agents.get()`

Get a single agent by UID.

```typescript theme={null}
const agent = await avala.agents.get("agent_uid");
```

| Parameter | Type     | Description              |
| --------- | -------- | ------------------------ |
| `uid`     | `string` | Agent unique identifier. |

**Returns:** `Promise<Agent>`

#### `avala.agents.create()`

Create a new automation agent.

```typescript theme={null}
const agent = await avala.agents.create({
  name: "QA Bot",
  events: ["task.completed"],
  callbackUrl: "https://example.com/webhook",
  taskTypes: ["annotation"],
});
```

| Parameter     | Type        | Required | Description                      |
| ------------- | ----------- | -------- | -------------------------------- |
| `name`        | `string`    | Yes      | Agent name.                      |
| `events`      | `string[]`  | Yes      | Events the agent listens to.     |
| `description` | `string?`   | No       | Agent description.               |
| `callbackUrl` | `string?`   | No       | URL called when events fire.     |
| `project`     | `string?`   | No       | Scope to a specific project UID. |
| `taskTypes`   | `string[]?` | No       | Task types the agent handles.    |

**Returns:** `Promise<Agent>`

#### `avala.agents.update()`

Update an existing agent.

```typescript theme={null}
const agent = await avala.agents.update("agent_uid", {
  isActive: false,
  callbackUrl: "https://example.com/new-webhook",
});
```

| Parameter     | Type        | Required | Description                  |
| ------------- | ----------- | -------- | ---------------------------- |
| `uid`         | `string`    | Yes      | Agent unique identifier.     |
| `name`        | `string?`   | No       | Agent name.                  |
| `description` | `string?`   | No       | Agent description.           |
| `callbackUrl` | `string?`   | No       | Callback URL.                |
| `events`      | `string[]?` | No       | Events to listen to.         |
| `isActive`    | `boolean?`  | No       | Enable or disable the agent. |
| `project`     | `string?`   | No       | Project UID scope.           |
| `taskTypes`   | `string[]?` | No       | Task types.                  |

**Returns:** `Promise<Agent>`

#### `avala.agents.delete()`

Delete an agent.

```typescript theme={null}
await avala.agents.delete("agent_uid");
```

**Returns:** `Promise<void>`

#### `avala.agents.listExecutions()`

List execution history for an agent.

```typescript theme={null}
const page = await avala.agents.listExecutions("agent_uid", { limit: 50 });
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `uid`     | `string`  | —           | Agent unique identifier.  |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<AgentExecution>>`

#### `avala.agents.test()`

Send a test event to an agent.

```typescript theme={null}
const result = await avala.agents.test("agent_uid");
// { success: boolean }
```

**Returns:** `Promise<{ success: boolean }>`

***

### inferenceProviders

#### `avala.inferenceProviders.list()`

List inference providers.

```typescript theme={null}
const page = await avala.inferenceProviders.list();
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<InferenceProvider>>`

#### `avala.inferenceProviders.get()`

Get a single inference provider by UID.

```typescript theme={null}
const provider = await avala.inferenceProviders.get("provider_uid");
```

**Returns:** `Promise<InferenceProvider>`

#### `avala.inferenceProviders.create()`

Create a new inference provider.

```typescript theme={null}
const provider = await avala.inferenceProviders.create({
  name: "My SageMaker",
  providerType: "sagemaker",
  config: { endpoint: "my-endpoint", region: "us-east-1" },
});
```

| Parameter      | Type                      | Required | Description                                     |
| -------------- | ------------------------- | -------- | ----------------------------------------------- |
| `name`         | `string`                  | Yes      | Provider name.                                  |
| `providerType` | `string`                  | Yes      | Provider type (e.g. `"sagemaker"`, `"openai"`). |
| `config`       | `Record<string, unknown>` | Yes      | Provider-specific configuration.                |
| `description`  | `string?`                 | No       | Provider description.                           |
| `project`      | `string?`                 | No       | Scope to a project UID.                         |

**Returns:** `Promise<InferenceProvider>`

#### `avala.inferenceProviders.update()`

Update an inference provider.

```typescript theme={null}
const provider = await avala.inferenceProviders.update("provider_uid", {
  isActive: false,
});
```

| Parameter      | Type                       | Required | Description                 |
| -------------- | -------------------------- | -------- | --------------------------- |
| `uid`          | `string`                   | Yes      | Provider unique identifier. |
| `name`         | `string?`                  | No       | Provider name.              |
| `description`  | `string?`                  | No       | Provider description.       |
| `providerType` | `string?`                  | No       | Provider type.              |
| `config`       | `Record<string, unknown>?` | No       | Configuration object.       |
| `isActive`     | `boolean?`                 | No       | Enable or disable.          |
| `project`      | `string?`                  | No       | Project UID scope.          |

**Returns:** `Promise<InferenceProvider>`

#### `avala.inferenceProviders.delete()`

Delete an inference provider.

```typescript theme={null}
await avala.inferenceProviders.delete("provider_uid");
```

**Returns:** `Promise<void>`

#### `avala.inferenceProviders.test()`

Test connectivity to an inference provider.

```typescript theme={null}
const result = await avala.inferenceProviders.test("provider_uid");
// { success: boolean, message: string, testedAt: string }
```

**Returns:** `Promise<{ success: boolean; message: string; testedAt: string }>`

***

### autoLabelJobs

#### `avala.autoLabelJobs.list()`

List auto-label jobs with optional filtering.

```typescript theme={null}
const page = await avala.autoLabelJobs.list({
  project: "proj_uid",
  status: "completed",
});
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `project` | `string?` | `undefined` | Filter by project UID.    |
| `status`  | `string?` | `undefined` | Filter by job status.     |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<AutoLabelJob>>`

#### `avala.autoLabelJobs.get()`

Get a single auto-label job by UID.

```typescript theme={null}
const job = await avala.autoLabelJobs.get("job_uid");
console.log(`Progress: ${job.progressPct}%`);
```

**Returns:** `Promise<AutoLabelJob>`

#### `avala.autoLabelJobs.create()`

Create a new auto-label job for a project.

```typescript theme={null}
const job = await avala.autoLabelJobs.create("proj_uid", {
  modelType: "object_detection",
  confidenceThreshold: 0.85,
  labels: ["car", "truck"],
});
```

| Parameter             | Type        | Required | Description                      |
| --------------------- | ----------- | -------- | -------------------------------- |
| `projectUid`          | `string`    | Yes      | Project to auto-label.           |
| `modelType`           | `string?`   | No       | Model type to use.               |
| `confidenceThreshold` | `number?`   | No       | Minimum confidence score.        |
| `labels`              | `string[]?` | No       | Labels to apply.                 |
| `dryRun`              | `boolean?`  | No       | Preview without applying labels. |

**Returns:** `Promise<AutoLabelJob>`

#### `avala.autoLabelJobs.cancel()`

Cancel a running auto-label job.

```typescript theme={null}
await avala.autoLabelJobs.cancel("job_uid");
```

**Returns:** `Promise<void>`

***

### qualityTargets

All quality target methods are scoped to a project.

#### `avala.qualityTargets.list()`

List quality targets for a project.

```typescript theme={null}
const page = await avala.qualityTargets.list("proj_uid");
```

| Parameter    | Type      | Default     | Description                |
| ------------ | --------- | ----------- | -------------------------- |
| `projectUid` | `string`  | —           | Project unique identifier. |
| `limit`      | `number?` | `undefined` | Maximum results per page.  |
| `cursor`     | `string?` | `undefined` | Pagination cursor.         |

**Returns:** `Promise<CursorPage<QualityTarget>>`

#### `avala.qualityTargets.get()`

Get a single quality target.

```typescript theme={null}
const target = await avala.qualityTargets.get("proj_uid", "target_uid");
```

**Returns:** `Promise<QualityTarget>`

#### `avala.qualityTargets.create()`

Create a quality target for a project.

```typescript theme={null}
const target = await avala.qualityTargets.create("proj_uid", {
  name: "Accuracy Target",
  metric: "accuracy",
  operator: "gte",
  threshold: 0.95,
  severity: "critical",
  notifyWebhook: true,
  notifyEmails: ["alerts@example.com"],
});
```

| Parameter       | Type        | Required | Description                                   |
| --------------- | ----------- | -------- | --------------------------------------------- |
| `projectUid`    | `string`    | Yes      | Project unique identifier.                    |
| `name`          | `string`    | Yes      | Target name.                                  |
| `metric`        | `string`    | Yes      | Metric to track.                              |
| `operator`      | `string`    | Yes      | Comparison operator (`"gte"`, `"lte"`, etc.). |
| `threshold`     | `number`    | Yes      | Threshold value.                              |
| `severity`      | `string?`   | No       | Severity level.                               |
| `isActive`      | `boolean?`  | No       | Enable or disable.                            |
| `notifyWebhook` | `boolean?`  | No       | Send webhook on breach.                       |
| `notifyEmails`  | `string[]?` | No       | Email addresses for breach alerts.            |

**Returns:** `Promise<QualityTarget>`

#### `avala.qualityTargets.update()`

Update a quality target.

```typescript theme={null}
const target = await avala.qualityTargets.update("proj_uid", "target_uid", {
  threshold: 0.9,
});
```

**Returns:** `Promise<QualityTarget>`

#### `avala.qualityTargets.delete()`

Delete a quality target.

```typescript theme={null}
await avala.qualityTargets.delete("proj_uid", "target_uid");
```

**Returns:** `Promise<void>`

#### `avala.qualityTargets.evaluate()`

Evaluate all quality targets for a project and return current results.

```typescript theme={null}
const results = await avala.qualityTargets.evaluate("proj_uid");
for (const r of results) {
  console.log(`${r.name}: ${r.currentValue} (breached: ${r.isBreached})`);
}
```

**Returns:** `Promise<QualityTargetEvaluation[]>`

***

### consensus

All consensus methods are scoped to a project.

#### `avala.consensus.getSummary()`

Get consensus summary statistics for a project.

```typescript theme={null}
const summary = await avala.consensus.getSummary("proj_uid");
console.log(`Mean score: ${summary.meanScore}`);
console.log(`Items with consensus: ${summary.itemsWithConsensus}/${summary.totalItems}`);
```

**Returns:** `Promise<ConsensusSummary>`

#### `avala.consensus.listScores()`

List consensus scores for individual items.

```typescript theme={null}
const page = await avala.consensus.listScores("proj_uid", { limit: 50 });
```

| Parameter    | Type      | Default     | Description                |
| ------------ | --------- | ----------- | -------------------------- |
| `projectUid` | `string`  | —           | Project unique identifier. |
| `limit`      | `number?` | `undefined` | Maximum results per page.  |
| `cursor`     | `string?` | `undefined` | Pagination cursor.         |

**Returns:** `Promise<CursorPage<ConsensusScore>>`

#### `avala.consensus.compute()`

Trigger consensus computation for a project.

```typescript theme={null}
const result = await avala.consensus.compute("proj_uid");
console.log(result.status);  // "started"
```

**Returns:** `Promise<ConsensusComputeResult>`

#### `avala.consensus.getConfig()`

Get consensus configuration for a project.

```typescript theme={null}
const config = await avala.consensus.getConfig("proj_uid");
console.log(`IoU threshold: ${config.iouThreshold}`);
```

**Returns:** `Promise<ConsensusConfig>`

#### `avala.consensus.updateConfig()`

Update consensus configuration. Uses PUT (full replacement).

```typescript theme={null}
const config = await avala.consensus.updateConfig("proj_uid", {
  iouThreshold: 0.7,
  minAgreementRatio: 0.8,
  minAnnotations: 3,
});
```

| Parameter           | Type      | Required | Description                   |
| ------------------- | --------- | -------- | ----------------------------- |
| `projectUid`        | `string`  | Yes      | Project unique identifier.    |
| `iouThreshold`      | `number?` | No       | IoU threshold for matching.   |
| `minAgreementRatio` | `number?` | No       | Minimum agreement ratio.      |
| `minAnnotations`    | `number?` | No       | Minimum annotations required. |

**Returns:** `Promise<ConsensusConfig>`

***

### webhooks

#### `avala.webhooks.list()`

List webhook subscriptions.

```typescript theme={null}
const page = await avala.webhooks.list();
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<Webhook>>`

#### `avala.webhooks.get()`

Get a single webhook by UID.

```typescript theme={null}
const webhook = await avala.webhooks.get("webhook_uid");
```

**Returns:** `Promise<Webhook>`

#### `avala.webhooks.create()`

Create a new webhook subscription.

```typescript theme={null}
const webhook = await avala.webhooks.create({
  targetUrl: "https://example.com/webhook",
  events: ["task.completed", "export.ready"],
  isActive: true,
});
```

| Parameter   | Type       | Required | Description                           |
| ----------- | ---------- | -------- | ------------------------------------- |
| `targetUrl` | `string`   | Yes      | URL to receive events.                |
| `events`    | `string[]` | Yes      | Events to subscribe to.               |
| `isActive`  | `boolean?` | No       | Enable the webhook (default: `true`). |

**Returns:** `Promise<Webhook>`

#### `avala.webhooks.update()`

Update a webhook subscription.

```typescript theme={null}
const webhook = await avala.webhooks.update("webhook_uid", {
  isActive: false,
});
```

| Parameter   | Type        | Required | Description                |
| ----------- | ----------- | -------- | -------------------------- |
| `uid`       | `string`    | Yes      | Webhook unique identifier. |
| `targetUrl` | `string?`   | No       | URL to receive events.     |
| `events`    | `string[]?` | No       | Events to subscribe to.    |
| `isActive`  | `boolean?`  | No       | Enable or disable.         |

**Returns:** `Promise<Webhook>`

#### `avala.webhooks.delete()`

Delete a webhook subscription.

```typescript theme={null}
await avala.webhooks.delete("webhook_uid");
```

**Returns:** `Promise<void>`

#### `avala.webhooks.test()`

Send a test event to a webhook.

```typescript theme={null}
const result = await avala.webhooks.test("webhook_uid");
// { success: boolean }
```

**Returns:** `Promise<{ success: boolean }>`

***

### webhookDeliveries

#### `avala.webhookDeliveries.list()`

List webhook delivery attempts.

```typescript theme={null}
const page = await avala.webhookDeliveries.list({ limit: 20 });
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<WebhookDelivery>>`

#### `avala.webhookDeliveries.get()`

Get a single webhook delivery by UID.

```typescript theme={null}
const delivery = await avala.webhookDeliveries.get("delivery_uid");
console.log(`Status: ${delivery.status}, Attempts: ${delivery.attempts}`);
```

**Returns:** `Promise<WebhookDelivery>`

***

### organizations

#### `avala.organizations.list()`

List organizations.

```typescript theme={null}
const page = await avala.organizations.list({ limit: 20 });
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<Organization>>`

#### `avala.organizations.get()`

Get a single organization by slug.

```typescript theme={null}
const org = await avala.organizations.get("my-org");
```

| Parameter | Type     | Description        |
| --------- | -------- | ------------------ |
| `slug`    | `string` | Organization slug. |

**Returns:** `Promise<Organization>`

#### `avala.organizations.create()`

Create a new organization.

```typescript theme={null}
const org = await avala.organizations.create({
  name: "My Team",
  visibility: "private",
  industry: "technology",
});
```

| Parameter     | Type      | Required | Description                |
| ------------- | --------- | -------- | -------------------------- |
| `name`        | `string`  | Yes      | Organization name.         |
| `description` | `string?` | No       | Description.               |
| `logo`        | `string?` | No       | Logo URL.                  |
| `website`     | `string?` | No       | Website URL.               |
| `industry`    | `string?` | No       | Industry.                  |
| `email`       | `string?` | No       | Contact email.             |
| `phone`       | `string?` | No       | Contact phone.             |
| `visibility`  | `string?` | No       | `"public"` or `"private"`. |

**Returns:** `Promise<Organization>`

#### `avala.organizations.update()`

Update an organization.

```typescript theme={null}
const org = await avala.organizations.update("my-org", {
  name: "New Name",
  description: "Updated description",
});
```

| Parameter     | Type      | Required | Description          |
| ------------- | --------- | -------- | -------------------- |
| `slug`        | `string`  | Yes      | Organization slug.   |
| `name`        | `string?` | No       | Organization name.   |
| `description` | `string?` | No       | Description.         |
| `logo`        | `string?` | No       | Logo URL.            |
| `website`     | `string?` | No       | Website URL.         |
| `handle`      | `string?` | No       | Organization handle. |
| `industry`    | `string?` | No       | Industry.            |
| `email`       | `string?` | No       | Contact email.       |
| `phone`       | `string?` | No       | Contact phone.       |
| `visibility`  | `string?` | No       | Visibility setting.  |

**Returns:** `Promise<Organization>`

#### `avala.organizations.delete()`

<Warning>
  Deleting an organization is irreversible and may cascade-delete all associated projects, datasets, and other resources. Double-check the organization slug before calling this method.
</Warning>

Delete an organization.

```typescript theme={null}
await avala.organizations.delete("my-org");
```

**Returns:** `Promise<void>`

#### `avala.organizations.industryChoices()`

Get the list of valid industry choices.

```typescript theme={null}
const choices = await avala.organizations.industryChoices();
```

**Returns:** `Promise<Record<string, unknown>>` — An object containing industry choices.

#### `avala.organizations.listMembers()`

List members of an organization.

```typescript theme={null}
const page = await avala.organizations.listMembers("my-org", { role: "admin" });
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `slug`    | `string`  | —           | Organization slug.        |
| `search`  | `string?` | `undefined` | Search by name or email.  |
| `role`    | `string?` | `undefined` | Filter by role.           |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<OrganizationMember>>`

#### `avala.organizations.removeMember()`

Remove a member from an organization.

```typescript theme={null}
await avala.organizations.removeMember("my-org", "user_uid");
```

**Returns:** `Promise<void>`

#### `avala.organizations.updateMemberRole()`

Update a member's role.

```typescript theme={null}
await avala.organizations.updateMemberRole("my-org", "user_uid", { role: "admin" });
```

**Returns:** `Promise<void>`

#### `avala.organizations.leave()`

Leave an organization (as the current user).

```typescript theme={null}
await avala.organizations.leave("my-org");
```

**Returns:** `Promise<void>`

#### `avala.organizations.transferOwnership()`

Transfer organization ownership to another member.

```typescript theme={null}
await avala.organizations.transferOwnership("my-org", { newOwnerUid: "new_owner_uid" });
```

**Returns:** `Promise<void>`

#### `avala.organizations.listInvitations()`

List pending invitations for an organization.

```typescript theme={null}
const invitations = await avala.organizations.listInvitations("my-org");
```

**Returns:** `Promise<Invitation[]>`

#### `avala.organizations.createInvitation()`

Invite a user to an organization.

```typescript theme={null}
const invitation = await avala.organizations.createInvitation("my-org", {
  email: "user@example.com",
  role: "member",
});
```

| Parameter | Type      | Required | Description           |
| --------- | --------- | -------- | --------------------- |
| `slug`    | `string`  | Yes      | Organization slug.    |
| `email`   | `string`  | Yes      | Email to invite.      |
| `role`    | `string?` | No       | Role for the invitee. |

**Returns:** `Promise<Invitation>`

#### `avala.organizations.resendInvitation()`

Resend a pending invitation.

```typescript theme={null}
await avala.organizations.resendInvitation("my-org", "invitation_uid");
```

**Returns:** `Promise<void>`

#### `avala.organizations.cancelInvitation()`

Cancel a pending invitation.

```typescript theme={null}
await avala.organizations.cancelInvitation("my-org", "invitation_uid");
```

**Returns:** `Promise<void>`

#### `avala.organizations.listTeams()`

List teams in an organization.

```typescript theme={null}
const teams = await avala.organizations.listTeams("my-org");
```

**Returns:** `Promise<Team[]>`

#### `avala.organizations.createTeam()`

Create a team.

```typescript theme={null}
const team = await avala.organizations.createTeam("my-org", {
  name: "ML Engineers",
  description: "Machine learning team",
});
```

| Parameter     | Type      | Required | Description        |
| ------------- | --------- | -------- | ------------------ |
| `slug`        | `string`  | Yes      | Organization slug. |
| `name`        | `string`  | Yes      | Team name.         |
| `description` | `string?` | No       | Team description.  |
| `color`       | `string?` | No       | Team color.        |

**Returns:** `Promise<Team>`

#### `avala.organizations.getTeam()`

Get a team by slug.

```typescript theme={null}
const team = await avala.organizations.getTeam("my-org", "team_slug");
```

**Returns:** `Promise<Team>`

#### `avala.organizations.updateTeam()`

Update a team.

```typescript theme={null}
const team = await avala.organizations.updateTeam("my-org", "team_slug", { name: "Updated Name" });
```

**Returns:** `Promise<Team>`

#### `avala.organizations.deleteTeam()`

Delete a team.

```typescript theme={null}
await avala.organizations.deleteTeam("my-org", "team_slug");
```

**Returns:** `Promise<void>`

#### `avala.organizations.listTeamMembers()`

List members of a team.

```typescript theme={null}
const members = await avala.organizations.listTeamMembers("my-org", "team_slug");
```

**Returns:** `Promise<TeamMember[]>`

#### `avala.organizations.addTeamMember()`

Add a member to a team.

```typescript theme={null}
const member = await avala.organizations.addTeamMember("my-org", "team_slug", {
  userUid: "user_uid",
  role: "member",
});
```

**Returns:** `Promise<TeamMember>`

#### `avala.organizations.removeTeamMember()`

Remove a member from a team.

```typescript theme={null}
await avala.organizations.removeTeamMember("my-org", "team_slug", "user_uid");
```

**Returns:** `Promise<void>`

#### `avala.organizations.updateTeamMemberRole()`

Update a team member's role.

```typescript theme={null}
await avala.organizations.updateTeamMemberRole("my-org", "team_slug", "user_uid", {
  role: "lead",
});
```

**Returns:** `Promise<void>`

***

### slices

#### `avala.slices.list()`

List slices for an owner.

```typescript theme={null}
const page = await avala.slices.list("my-org", { limit: 20 });
```

| Parameter | Type      | Default     | Description                        |
| --------- | --------- | ----------- | ---------------------------------- |
| `owner`   | `string`  | —           | Owner slug (organization or user). |
| `limit`   | `number?` | `undefined` | Maximum results per page.          |
| `cursor`  | `string?` | `undefined` | Pagination cursor.                 |

**Returns:** `Promise<CursorPage<Slice>>`

#### `avala.slices.get()`

Get a single slice.

```typescript theme={null}
const slice = await avala.slices.get("my-org", "my-slice");
```

| Parameter | Type     | Description |
| --------- | -------- | ----------- |
| `owner`   | `string` | Owner slug. |
| `slug`    | `string` | Slice slug. |

**Returns:** `Promise<Slice>`

#### `avala.slices.create()`

Create a new slice.

```typescript theme={null}
const slice = await avala.slices.create({
  name: "Validation Set",
  visibility: "private",
  subSlices: [{ dataset: "dataset_uid", filters: {} }],
  organization: "my-org",
});
```

| Parameter              | Type                                          | Required | Description                         |
| ---------------------- | --------------------------------------------- | -------- | ----------------------------------- |
| `name`                 | `string`                                      | Yes      | Slice name.                         |
| `visibility`           | `string`                                      | Yes      | `"public"` or `"private"`.          |
| `subSlices`            | `Array<{ dataset: string; filters: object }>` | Yes      | Sub-slice definitions.              |
| `organization`         | `string?`                                     | No       | Organization slug to own the slice. |
| `randomSelectionCount` | `number?`                                     | No       | Randomly select N items.            |

**Returns:** `Promise<Slice>`

#### `avala.slices.listItems()`

List items in a slice.

```typescript theme={null}
const page = await avala.slices.listItems("my-org", "my-slice", { limit: 50 });
```

| Parameter | Type      | Default     | Description               |
| --------- | --------- | ----------- | ------------------------- |
| `owner`   | `string`  | —           | Owner slug.               |
| `slug`    | `string`  | —           | Slice slug.               |
| `limit`   | `number?` | `undefined` | Maximum results per page. |
| `cursor`  | `string?` | `undefined` | Pagination cursor.        |

**Returns:** `Promise<CursorPage<SliceItem>>`

#### `avala.slices.getItem()`

Get a single item within a slice.

```typescript theme={null}
const item = await avala.slices.getItem("my-org", "my-slice", "item_uid");
```

| Parameter | Type     | Description             |
| --------- | -------- | ----------------------- |
| `owner`   | `string` | Owner slug.             |
| `slug`    | `string` | Slice slug.             |
| `itemUid` | `string` | Item unique identifier. |

**Returns:** `Promise<SliceItem>`

***

## Types

### Dataset

```typescript theme={null}
interface Dataset {
  uid: string;
  name: string;
  slug: string;
  itemCount: number;
  dataType: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### DatasetItem

```typescript theme={null}
interface DatasetItem {
  id: number | null;
  uid: string;
  key: string | null;
  dataset: string | null;
  url: string | null;
  gpuTextureUrl: string | null;
  thumbnails: string[] | null;
  videoThumbnail: string | null;
  metadata: Record<string, unknown> | null;
  exportSnippet: Record<string, unknown> | null;
  annotations: Record<string, unknown> | null;
  cropData: Record<string, unknown> | null;
  relatedItems: Record<string, unknown>[] | null;
  relatedSequenceUid: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### DatasetSequence

```typescript theme={null}
interface DatasetSequence {
  uid: string;
  key: string | null;
  customUuid: string | null;
  status: string | null;
  featuredImage: string | null;
  numberOfFrames: number | null;
  views: Record<string, unknown>[] | null;
  cropData: Record<string, unknown> | null;
  predefinedLabels: Record<string, unknown>[] | null;
  frames: Record<string, unknown>[] | null;
  metrics: Record<string, unknown> | null;
  datasetUid: string | null;
  allowLidarCalibration: boolean | null;
  lidarCalibrationEnabled: boolean | null;
  cameraCalibrationEnabled: boolean | null;
}
```

### Project

```typescript theme={null}
interface Project {
  uid: string;
  name: string;
  status: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### Task

```typescript theme={null}
interface Task {
  uid: string;
  type: string | null;
  name: string | null;
  status: string | null;
  project: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### Export

```typescript theme={null}
interface Export {
  uid: string;
  status: string | null;
  downloadUrl: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### StorageConfig

```typescript theme={null}
interface StorageConfig {
  uid: string;
  name: string;
  provider: string;
  s3BucketName: string | null;
  s3BucketRegion: string | null;
  s3BucketPrefix: string | null;
  s3IsAccelerated: boolean;
  gcStorageBucketName: string | null;
  gcStoragePrefix: string | null;
  isVerified: boolean;
  lastVerifiedAt: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### Agent

```typescript theme={null}
interface Agent {
  uid: string;
  name: string;
  description: string | null;
  events: string[];
  callbackUrl: string | null;
  isActive: boolean;
  project: string | null;
  taskTypes: string[];
  createdAt: string | null;
  updatedAt: string | null;
}
```

### AgentExecution

```typescript theme={null}
interface AgentExecution {
  uid: string;
  registration: string;
  eventType: string;
  task: string | null;
  result: string | null;
  status: string | null;
  action: string | null;
  eventPayload: Record<string, unknown> | null;
  responsePayload: Record<string, unknown> | null;
  errorMessage: string | null;
  startedAt: string | null;
  completedAt: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### InferenceProvider

```typescript theme={null}
interface InferenceProvider {
  uid: string;
  name: string;
  description: string | null;
  providerType: string | null;
  config: Record<string, unknown> | null;
  isActive: boolean;
  project: string | null;
  lastTestAt: string | null;
  lastTestSuccess: boolean | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### AutoLabelJob

```typescript theme={null}
interface AutoLabelJob {
  uid: string;
  status: string | null;
  modelType: string | null;
  confidenceThreshold: number | null;
  labels: string[];
  dryRun: boolean;
  totalItems: number;
  processedItems: number;
  successfulItems: number;
  failedItems: number;
  skippedItems: number;
  progressPct: number | null;
  errorMessage: string | null;
  summary: Record<string, unknown> | null;
  startedAt: string | null;
  completedAt: string | null;
  createdAt: string | null;
}
```

### QualityTarget

```typescript theme={null}
interface QualityTarget {
  uid: string;
  name: string;
  metric: string;
  operator: string;
  threshold: number;
  severity: string | null;
  isActive: boolean;
  notifyWebhook: boolean;
  notifyEmails: string[];
  lastEvaluatedAt: string | null;
  lastValue: number | null;
  isBreached: boolean;
  breachCount: number;
  lastBreachedAt: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### QualityTargetEvaluation

```typescript theme={null}
interface QualityTargetEvaluation {
  uid: string;
  name: string;
  metric: string;
  threshold: number;
  operator: string;
  currentValue: number;
  isBreached: boolean;
  severity: string | null;
}
```

### ConsensusConfig

```typescript theme={null}
interface ConsensusConfig {
  uid: string;
  iouThreshold: number;
  minAgreementRatio: number;
  minAnnotations: number;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### ConsensusScore

```typescript theme={null}
interface ConsensusScore {
  uid: string;
  datasetItemUid: string;
  taskName: string;
  scoreType: string | null;
  score: number;
  annotatorCount: number;
  details: Record<string, unknown> | null;
  createdAt: string | null;
}
```

### ConsensusSummary

```typescript theme={null}
interface ConsensusSummary {
  meanScore: number;
  medianScore: number;
  minScore: number;
  maxScore: number;
  totalItems: number;
  itemsWithConsensus: number;
  scoreDistribution: Record<string, unknown> | null;
  byTaskName: unknown[] | null;
}
```

### ConsensusComputeResult

```typescript theme={null}
interface ConsensusComputeResult {
  status: string;
  message: string;
}
```

### Webhook

```typescript theme={null}
interface Webhook {
  uid: string;
  targetUrl: string;
  events: string[];
  isActive: boolean;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### WebhookDelivery

```typescript theme={null}
interface WebhookDelivery {
  uid: string;
  subscription: string;
  eventType: string;
  payload: Record<string, unknown>;
  responseStatus: number | null;
  responseBody: string | null;
  attempts: number;
  nextRetryAt: string | null;
  status: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### Organization

```typescript theme={null}
interface Organization {
  uid: string;
  name: string;
  slug: string;
  handle: string | null;
  description: string | null;
  logo: string | null;
  website: string | null;
  industry: string | null;
  email: string | null;
  phone: string | null;
  visibility: string | null;
  plan: string | null;
  isVerified: boolean;
  isActive: boolean;
  memberCount: number | null;
  teamCount: number | null;
  datasetCount: number | null;
  projectCount: number | null;
  sliceCount: number | null;
  role: string | null;
  joinedAt: string | null;
  allowedDomains: string[] | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### OrganizationMember

```typescript theme={null}
interface OrganizationMember {
  userUid: string;
  username: string | null;
  email: string | null;
  fullName: string | null;
  picture: string | null;
  role: string | null;
  createdAt: string | null;
}
```

### Invitation

```typescript theme={null}
interface Invitation {
  uid: string;
  organizationName: string | null;
  organizationSlug: string | null;
  invitedEmail: string;
  invitedByUsername: string | null;
  role: string | null;
  status: string | null;
  expiresAt: string | null;
  isExpired: boolean | null;
  acceptUrl: string | null;
  copyLink: string | null;
  createdAt: string | null;
}
```

### Team

```typescript theme={null}
interface Team {
  uid: string;
  name: string;
  slug: string | null;
  description: string | null;
  color: string | null;
  organizationUid: string | null;
  organizationName: string | null;
  organizationSlug: string | null;
  memberCount: number | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

### TeamMember

```typescript theme={null}
interface TeamMember {
  userUid: string;
  username: string | null;
  email: string | null;
  fullName: string | null;
  picture: string | null;
  role: string | null;
  createdAt: string | null;
}
```

### Slice

```typescript theme={null}
interface Slice {
  uid: string;
  name: string;
  slug: string | null;
  ownerName: string | null;
  organization: Record<string, unknown> | null;
  visibility: string | null;
  status: string | null;
  itemCount: number | null;
  subSlices: Array<Record<string, unknown>> | null;
  sourceData: unknown | null;
  featuredSliceItemUrls: string[] | null;
}
```

### SliceItem

```typescript theme={null}
interface SliceItem {
  id: number | null;
  uid: string;
  key: string | null;
  dataset: string | null;
  url: string | null;
  gpuTextureUrl: string | null;
  thumbnails: string[] | null;
  videoThumbnail: string | null;
  metadata: Record<string, unknown> | null;
  exportSnippet: Record<string, unknown> | null;
  annotations: Record<string, unknown> | null;
  cropData: Record<string, unknown> | null;
  relatedItems: Array<Record<string, unknown>> | null;
  relatedSequenceUid: string | null;
  createdAt: string | null;
  updatedAt: string | null;
}
```

***

## Pagination

### CursorPage

All `list()` methods return a `CursorPage<T>`:

```typescript theme={null}
interface CursorPage<T> {
  items: T[];
  nextCursor: string | null;
  previousCursor: string | null;
  hasMore: boolean;
}
```

| Property         | Type             | Description                                    |
| ---------------- | ---------------- | ---------------------------------------------- |
| `items`          | `T[]`            | Items on the current page.                     |
| `nextCursor`     | `string \| null` | Cursor for the next page. `null` if last page. |
| `previousCursor` | `string \| null` | Cursor for the previous page.                  |
| `hasMore`        | `boolean`        | `true` if `nextCursor` is not `null`.          |

```typescript theme={null}
const page = await avala.datasets.list({ limit: 20 });
for (const dataset of page.items) {
  console.log(dataset.name);
}

if (page.hasMore) {
  const next = await avala.datasets.list({ limit: 20, cursor: page.nextCursor! });
}
```

### RateLimitInfo

```typescript theme={null}
interface RateLimitInfo {
  limit: string | null;      // X-RateLimit-Limit header
  remaining: string | null;  // X-RateLimit-Remaining header
  reset: string | null;      // X-RateLimit-Reset header
}
```

***

## Errors

All errors extend `AvalaError`:

```typescript theme={null}
import {
  AvalaError,
  AuthenticationError,
  NotFoundError,
  RateLimitError,
  ValidationError,
  ServerError,
} from "@avala-ai/sdk";
```

| Error                 | HTTP Status | Extra Properties             |
| --------------------- | ----------- | ---------------------------- |
| `AvalaError`          | Any         | `statusCode`, `body`         |
| `AuthenticationError` | 401         | —                            |
| `NotFoundError`       | 404         | —                            |
| `RateLimitError`      | 429         | `retryAfter: number \| null` |
| `ValidationError`     | 400 / 422   | `details: unknown[]`         |
| `ServerError`         | 5xx         | —                            |

```typescript theme={null}
try {
  const dataset = await avala.datasets.get("nonexistent");
} catch (error) {
  if (error instanceof NotFoundError) {
    console.log(`Not found: ${error.message}`);
  } else if (error instanceof RateLimitError) {
    console.log(`Retry after ${error.retryAfter}s`);
  } else if (error instanceof AvalaError) {
    console.log(`Error (${error.statusCode}): ${error.message}`);
  }
}
```

***

## Exported Symbols

```typescript theme={null}
// Default export
import Avala from "@avala-ai/sdk";

// Named types
import type {
  Agent,
  AgentExecution,
  AutoLabelJob,
  AvalaConfig,
  ConsensusComputeResult,
  ConsensusConfig,
  ConsensusScore,
  ConsensusSummary,
  CursorPage,
  Dataset,
  DatasetItem,
  DatasetSequence,
  Export,
  InferenceProvider,
  Invitation,
  Organization,
  OrganizationMember,
  Project,
  QualityTarget,
  QualityTargetEvaluation,
  RateLimitInfo,
  Slice,
  SliceItem,
  StorageConfig,
  Task,
  Team,
  TeamMember,
  Webhook,
  WebhookDelivery,
} from "@avala-ai/sdk";

// Error classes
import {
  AvalaError,
  AuthenticationError,
  NotFoundError,
  RateLimitError,
  ValidationError,
  ServerError,
} from "@avala-ai/sdk";
```

## Environment Variables

| Variable         | Description                                             | Default                       |
| ---------------- | ------------------------------------------------------- | ----------------------------- |
| `AVALA_API_KEY`  | API key (used when `apiKey` not passed to constructor). | Required                      |
| `AVALA_BASE_URL` | Base API URL override.                                  | `https://api.avala.ai/api/v1` |

## Runtime Requirements

* **Node.js 18+** (uses native `fetch`)
* **Zero runtime dependencies**
* Also works in Deno and Bun
