# Admin

# Workspaces

## Create

`client.admin.workspaces.create(WorkspaceCreateParamsbody, RequestOptionsoptions?): WorkspaceCreateResponse`

**post** `/compute/v1/admin/workspaces`

Create a workspace

### Parameters

- `body: WorkspaceCreateParams`

  - `data_retention?: DataRetention`

    How long result data is retained before automatic deletion. Defaults to 7 days if not specified. Maximum retention is 14 days (336 hours).

    - `unit: "hours" | "days"`

      Time unit for retention duration

      - `"hours"`

      - `"days"`

    - `value: number`

      Duration value. Maximum retention is 14 days (or 336 hours).

  - `name?: string`

    Workspace name

### Returns

- `WorkspaceCreateResponse`

  - `id: string`

    Workspace ID

  - `archived_at: string | null`

  - `created_at: string`

  - `data_retention: DataRetention`

    How long result data is retained before automatic deletion. Defaults to 7 days if not specified. Maximum retention is 14 days (336 hours).

    - `unit: "hours" | "days"`

      Time unit for retention duration

      - `"hours"`

      - `"days"`

    - `value: number`

      Duration value. Maximum retention is 14 days (or 336 hours).

  - `is_default: boolean`

    Whether this is the default workspace

  - `name: string | null`

    Workspace name

  - `updated_at: string`

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

const workspace = await client.admin.workspaces.create();

console.log(workspace.id);
```

## List

`client.admin.workspaces.list(WorkspaceListParamsquery?, RequestOptionsoptions?): CursorPage<WorkspaceListResponse>`

**get** `/compute/v1/admin/workspaces`

List workspaces

### Parameters

- `query: WorkspaceListParams`

  - `after_id?: string`

    Return results after this ID

  - `before_id?: string`

    Return results before this ID

  - `limit?: number`

    Max items to return

### Returns

- `WorkspaceListResponse`

  - `id: string`

    Workspace ID

  - `archived_at: string | null`

  - `created_at: string`

  - `data_retention: DataRetention`

    How long result data is retained before automatic deletion. Defaults to 7 days if not specified. Maximum retention is 14 days (336 hours).

    - `unit: "hours" | "days"`

      Time unit for retention duration

      - `"hours"`

      - `"days"`

    - `value: number`

      Duration value. Maximum retention is 14 days (or 336 hours).

  - `is_default: boolean`

    Whether this is the default workspace

  - `name: string | null`

    Workspace name

  - `updated_at: string`

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const workspaceListResponse of client.admin.workspaces.list()) {
  console.log(workspaceListResponse.id);
}
```

## Retrieve

`client.admin.workspaces.retrieve(stringworkspaceID, RequestOptionsoptions?): WorkspaceRetrieveResponse`

**get** `/compute/v1/admin/workspaces/{workspace_id}`

Get a workspace

### Parameters

- `workspaceID: string`

### Returns

- `WorkspaceRetrieveResponse`

  - `id: string`

    Workspace ID

  - `archived_at: string | null`

  - `created_at: string`

  - `data_retention: DataRetention`

    How long result data is retained before automatic deletion. Defaults to 7 days if not specified. Maximum retention is 14 days (336 hours).

    - `unit: "hours" | "days"`

      Time unit for retention duration

      - `"hours"`

      - `"days"`

    - `value: number`

      Duration value. Maximum retention is 14 days (or 336 hours).

  - `is_default: boolean`

    Whether this is the default workspace

  - `name: string | null`

    Workspace name

  - `updated_at: string`

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

const workspace = await client.admin.workspaces.retrieve('workspace_id');

console.log(workspace.id);
```

## Update

`client.admin.workspaces.update(stringworkspaceID, WorkspaceUpdateParamsbody, RequestOptionsoptions?): WorkspaceUpdateResponse`

**post** `/compute/v1/admin/workspaces/{workspace_id}`

Update a workspace

### Parameters

- `workspaceID: string`

- `body: WorkspaceUpdateParams`

  - `data_retention?: DataRetention`

    How long result data is retained before automatic deletion. Defaults to 7 days if not specified. Maximum retention is 14 days (336 hours).

    - `unit: "hours" | "days"`

      Time unit for retention duration

      - `"hours"`

      - `"days"`

    - `value: number`

      Duration value. Maximum retention is 14 days (or 336 hours).

  - `name?: string | null`

### Returns

- `WorkspaceUpdateResponse`

  - `id: string`

    Workspace ID

  - `archived_at: string | null`

  - `created_at: string`

  - `data_retention: DataRetention`

    How long result data is retained before automatic deletion. Defaults to 7 days if not specified. Maximum retention is 14 days (336 hours).

    - `unit: "hours" | "days"`

      Time unit for retention duration

      - `"hours"`

      - `"days"`

    - `value: number`

      Duration value. Maximum retention is 14 days (or 336 hours).

  - `is_default: boolean`

    Whether this is the default workspace

  - `name: string | null`

    Workspace name

  - `updated_at: string`

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

const workspace = await client.admin.workspaces.update('workspace_id');

console.log(workspace.id);
```

## Archive

`client.admin.workspaces.archive(stringworkspaceID, RequestOptionsoptions?): WorkspaceArchiveResponse`

**post** `/compute/v1/admin/workspaces/{workspace_id}/archive`

Archives a workspace and deactivates all its API keys. This action is irreversible.

### Parameters

- `workspaceID: string`

### Returns

- `WorkspaceArchiveResponse`

  - `id: string`

    Workspace ID

  - `archived_at: string | null`

  - `created_at: string`

  - `data_retention: DataRetention`

    How long result data is retained before automatic deletion. Defaults to 7 days if not specified. Maximum retention is 14 days (336 hours).

    - `unit: "hours" | "days"`

      Time unit for retention duration

      - `"hours"`

      - `"days"`

    - `value: number`

      Duration value. Maximum retention is 14 days (or 336 hours).

  - `is_default: boolean`

    Whether this is the default workspace

  - `name: string | null`

    Workspace name

  - `updated_at: string`

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

const response = await client.admin.workspaces.archive('workspace_id');

console.log(response.id);
```

# API Keys

## Create

`client.admin.apiKeys.create(APIKeyCreateParamsbody, RequestOptionsoptions?): APIKeyCreateResponse`

**post** `/compute/v1/admin/api-keys`

Create a workspace API key

### Parameters

- `body: APIKeyCreateParams`

  - `name: string`

    API key name

  - `allowed_ips?: Array<string>`

    IP addresses allowed to use this key (IPv4 or IPv6). An empty array (the default) means all IPs are allowed.

  - `expires_in_days?: number`

    Days until the key expires. Omit for a key that does not expire.

  - `mode?: "live" | "test"`

    Key mode. Test keys create test-mode resources with synthetic data.

    - `"live"`

    - `"test"`

  - `workspace_id?: string`

    Workspace ID to scope this key to. Omit for default workspace.

### Returns

- `APIKeyCreateResponse`

  - `key: string`

    The full API key. This is only shown once — store it securely.

  - `key_details: KeyDetails`

    - `id: string`

      API key ID

    - `allowed_ips: Array<string>`

      IP addresses allowed to use this key. An empty array means all IPs are allowed.

    - `created_at: string`

    - `expires_at: string | null`

      When the key expires. Null if the key does not expire.

    - `is_active: boolean`

    - `key_prefix: string`

      First 12 characters of the key

    - `key_type: "workspace"`

      - `"workspace"`

    - `last_used_at: string | null`

    - `livemode: boolean`

      Whether this is a live API key (false for test keys).

    - `name: string`

      API key name

    - `workspace_id: string`

      Workspace this key is scoped to

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

const apiKey = await client.admin.apiKeys.create({ name: 'x' });

console.log(apiKey.key);
```

## List

`client.admin.apiKeys.list(APIKeyListParamsquery?, RequestOptionsoptions?): CursorPage<APIKeyListResponse>`

**get** `/compute/v1/admin/api-keys`

List API keys

### Parameters

- `query: APIKeyListParams`

  - `after_id?: string`

    Return results after this ID

  - `before_id?: string`

    Return results before this ID

  - `limit?: number`

    Max items to return

  - `workspace_id?: string`

    Filter by workspace ID. If not provided, returns keys across all workspaces.

### Returns

- `APIKeyListResponse`

  - `id: string`

    API key ID

  - `allowed_ips: Array<string>`

    IP addresses allowed to use this key. An empty array means all IPs are allowed.

  - `created_at: string`

  - `expires_at: string | null`

    When the key expires. Null if the key does not expire.

  - `is_active: boolean`

  - `key_prefix: string`

    First 12 characters of the key

  - `key_type: "admin" | "workspace"`

    - `"admin"`

    - `"workspace"`

  - `last_used_at: string | null`

  - `livemode: boolean`

    Whether this is a live API key (false for test keys).

  - `name: string`

    API key name

  - `workspace_id: string | null`

    Workspace ID if workspace-scoped

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const apiKeyListResponse of client.admin.apiKeys.list()) {
  console.log(apiKeyListResponse.id);
}
```

## Revoke

`client.admin.apiKeys.revoke(stringapiKeyID, RequestOptionsoptions?): APIKeyRevokeResponse`

**post** `/compute/v1/admin/api-keys/{api_key_id}/revoke`

Revoke an API key

### Parameters

- `apiKeyID: string`

### Returns

- `APIKeyRevokeResponse`

  - `id: string`

    API key ID

  - `allowed_ips: Array<string>`

    IP addresses allowed to use this key. An empty array means all IPs are allowed.

  - `created_at: string`

  - `expires_at: string | null`

    When the key expires. Null if the key does not expire.

  - `is_active: boolean`

  - `key_prefix: string`

    First 12 characters of the key

  - `key_type: "admin" | "workspace"`

    - `"admin"`

    - `"workspace"`

  - `last_used_at: string | null`

  - `livemode: boolean`

    Whether this is a live API key (false for test keys).

  - `name: string`

    API key name

  - `workspace_id: string | null`

    Workspace ID if workspace-scoped

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

const response = await client.admin.apiKeys.revoke('api_key_id');

console.log(response.id);
```

# Usage

## List

`client.admin.usage.list(UsageListParamsquery, RequestOptionsoptions?): OpaqueCursorPage<UsageListResponse>`

**get** `/compute/v1/admin/usage`

Retrieve aggregated usage data across the organization, optionally grouped by workspace and/or application.

### Parameters

- `query: UsageListParams`

  - `ending_at: string`

    End of the time range as an ISO 8601 date-time with timezone, for example 2026-04-08T18:56:46Z

  - `starting_at: string`

    Start of the time range as an ISO 8601 date-time with timezone, for example 2026-04-08T18:56:46Z

  - `window_size: "HOUR" | "DAY"`

    Time window size. HOUR supports up to 31 days per query; DAY supports up to 365 days per query.

    - `"HOUR"`

    - `"DAY"`

  - `applications?: "structure_and_binding" | "small_molecule_design" | "small_molecule_library_screen" | 3 more | Array<"structure_and_binding" | "small_molecule_design" | "small_molecule_library_screen" | 3 more>`

    Filter to specific applications

    - `"structure_and_binding" | "small_molecule_design" | "small_molecule_library_screen" | 3 more`

      - `"structure_and_binding"`

      - `"small_molecule_design"`

      - `"small_molecule_library_screen"`

      - `"protein_design"`

      - `"protein_library_screen"`

      - `"adme"`

    - `Array<"structure_and_binding" | "small_molecule_design" | "small_molecule_library_screen" | 3 more>`

      - `"structure_and_binding"`

      - `"small_molecule_design"`

      - `"small_molecule_library_screen"`

      - `"protein_design"`

      - `"protein_library_screen"`

      - `"adme"`

  - `groupBy?: "workspace_id" | "application" | Array<"workspace_id" | "application">`

    Group results by workspace_id and/or application

    - `"workspace_id" | "application"`

      - `"workspace_id"`

      - `"application"`

    - `Array<"workspace_id" | "application">`

      - `"workspace_id"`

      - `"application"`

  - `limit?: number`

    Maximum number of buckets to return

  - `page?: string`

    Cursor for pagination

  - `workspaceIDs?: string | Array<string>`

    Filter to specific workspace IDs

    - `string`

    - `Array<string>`

### Returns

- `UsageListResponse`

  - `end_time: string`

  - `quantity: number`

    Aggregated billed quantity for this bucket

  - `start_time: string`

  - `application?: "structure_and_binding" | "small_molecule_design" | "small_molecule_library_screen" | 3 more`

    - `"structure_and_binding"`

    - `"small_molecule_design"`

    - `"small_molecule_library_screen"`

    - `"protein_design"`

    - `"protein_library_screen"`

    - `"adme"`

  - `workspace_id?: string`

    Present when grouped by workspace_id

### Example

```typescript
import Boltz from 'boltz-api';

const client = new Boltz({
  apiKey: process.env['BOLTZ_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const usageListResponse of client.admin.usage.list({
  ending_at: '2019-12-27T18:11:19.117Z',
  starting_at: '2019-12-27T18:11:19.117Z',
  window_size: 'HOUR',
})) {
  console.log(usageListResponse.workspace_id);
}
```
