// This file is auto-generated by @hey-api/openapi-ts import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; import type { GetUserIdentityData, GetUserIdentityResponse2, GetUserIdentityError, GetCollectionByCrnData, GetCollectionByCrnResponse, GetCollectionByCrnError, HealthcheckData, HealthcheckResponse, HealthcheckError, HeartbeatData, HeartbeatResponse2, HeartbeatError, PreFlightChecksData, PreFlightChecksResponse, PreFlightChecksError, ResetData, ResetResponse, ResetError, CreateTenantData, CreateTenantResponse2, CreateTenantError, GetTenantData, GetTenantResponse2, GetTenantError, UpdateTenantData, UpdateTenantResponse2, UpdateTenantError, ListDatabasesData, ListDatabasesResponse, ListDatabasesError, CreateDatabaseData, CreateDatabaseResponse2, CreateDatabaseError, DeleteDatabaseData, DeleteDatabaseResponse2, DeleteDatabaseError, GetDatabaseData, GetDatabaseResponse, GetDatabaseError, ListCollectionsData, ListCollectionsResponse, ListCollectionsError, CreateCollectionData, CreateCollectionResponse, CreateCollectionError, GetCollectionByIdData, GetCollectionByIdResponse, GetCollectionByIdError, DeleteCollectionData, DeleteCollectionResponse2, DeleteCollectionError, GetCollectionData, GetCollectionResponse, GetCollectionError, UpdateCollectionData, UpdateCollectionResponse2, UpdateCollectionError, CollectionAddData, CollectionAddResponse, DetachFunctionData, DetachFunctionResponse2, DetachFunctionError, CollectionCountData, CollectionCountResponse, CollectionCountError, CollectionDeleteData, CollectionDeleteResponse, CollectionDeleteError, ForkCollectionData, ForkCollectionResponse, ForkCollectionError, ForkCountData, ForkCountResponse2, ForkCountError, AttachFunctionData, AttachFunctionResponse2, AttachFunctionError, GetAttachedFunctionData, GetAttachedFunctionResponse2, GetAttachedFunctionError, CollectionGetData, CollectionGetResponse, CollectionGetError, IndexingStatusData, IndexingStatusResponse, IndexingStatusError, CollectionQueryData, CollectionQueryResponse, CollectionQueryError, CollectionSearchData, CollectionSearchResponse, CollectionSearchError, CollectionUpdateData, CollectionUpdateResponse, CollectionUpsertData, CollectionUpsertResponse, CollectionUpsertError, CountCollectionsData, CountCollectionsResponse, CountCollectionsError, VersionData, VersionResponse } from './types.gen'; import { client as _heyApiClient } from './client.gen'; export type Options = ClientOptions & { /** * You can provide a client instance returned by `createClient()` instead of * individual options. This might be also useful if you want to implement a * custom client. */ client?: Client; /** * You can pass arbitrary values through the `meta` object. This can be * used to access values that aren't defined as part of the SDK function. */ meta?: Record; }; export class AuthenticationService { /** * Get user identity * Returns the current user's identity, tenant, and databases. */ public static getUserIdentity(options?: Options) { return (options?.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/auth/identity', ...options }); } } export class CollectionService { /** * Get collection by CRN * Returns a collection by Chroma Resource Name. */ public static getCollectionByCrn(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/collections/{crn}', ...options }); } /** * List collections * Lists all collections in a database. */ public static listCollections(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections', ...options }); } /** * Create collection * Creates a new collection in a database. */ public static createCollection(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Get collection by ID * Returns a collection by its UUID within a specific tenant and database. */ public static getCollectionById(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/by-id/{collection_id}', ...options }); } /** * Delete collection * Deletes a collection in a database. */ public static deleteCollection(options: Options) { return (options.client ?? _heyApiClient).delete({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}', ...options }); } /** * Get collection * Returns a collection by ID or name. */ public static getCollection(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}', ...options }); } /** * Update collection * Updates an existing collection's name or metadata. */ public static updateCollection(options: Options) { return (options.client ?? _heyApiClient).put({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Fork collection * Creates a fork of an existing collection. */ public static forkCollection(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/fork', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Get fork count * Returns the number of forks for a collection. */ public static forkCount(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/fork_count', ...options }); } /** * Get number of collections * Returns the total number of collections in a database. */ public static countCollections(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections_count', ...options }); } } export class SystemService { /** * Healthcheck * Returns the health status of the service. */ public static healthcheck(options?: Options) { return (options?.client ?? _heyApiClient).get({ url: '/api/v2/healthcheck', ...options }); } /** * Heartbeat * Returns a nanosecond timestamp of the current time. */ public static heartbeat(options?: Options) { return (options?.client ?? _heyApiClient).get({ url: '/api/v2/heartbeat', ...options }); } /** * Pre-flight checks * Returns basic readiness information. */ public static preFlightChecks(options?: Options) { return (options?.client ?? _heyApiClient).get({ url: '/api/v2/pre-flight-checks', ...options }); } /** * Reset database * Resets the database. Requires authorization. */ public static reset(options?: Options) { return (options?.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/reset', ...options }); } /** * Get version * Returns the version of the server. */ public static version(options?: Options) { return (options?.client ?? _heyApiClient).get({ url: '/api/v2/version', ...options }); } } export class TenantService { /** * Create tenant * Creates a new tenant. */ public static createTenant(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Get tenant * Returns an existing tenant by name. */ public static getTenant(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant_name}', ...options }); } /** * Update tenant * Updates an existing tenant by name. */ public static updateTenant(options: Options) { return (options.client ?? _heyApiClient).patch({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant_name}', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } } export class DatabaseService { /** * List databases * Lists all databases for a tenant. */ public static listDatabases(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases', ...options }); } /** * Create database * Creates a new database for a tenant. */ public static createDatabase(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Delete database * Deletes a database by name. */ public static deleteDatabase(options: Options) { return (options.client ?? _heyApiClient).delete({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}', ...options }); } /** * Get database * Returns a database by name. */ public static getDatabase(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}', ...options }); } } export class RecordService { /** * Add records * Adds records to a collection. */ public static collectionAdd(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/add', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Get number of records * Returns the number of records in a collection. */ public static collectionCount(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/count', ...options }); } /** * Delete records * Deletes records in a collection. Can filter by IDs or metadata. */ public static collectionDelete(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/delete', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Get records * Returns records from a collection by ID or metadata filter. */ public static collectionGet(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/get', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Get indexing status * Returns the indexing status of a collection. */ public static indexingStatus(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/indexing_status', ...options }); } /** * Query collection * Queries a collection using dense vector search with metadata and full-text search filtering. */ public static collectionQuery(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/query', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Search records * Searches records from a collection with dense, sparse, or hybrid vector search. */ public static collectionSearch(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/search', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Update records * Updates records in a collection by ID. */ public static collectionUpdate(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/update', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Upsert records * Upserts records in a collection (create if not exists, otherwise update). */ public static collectionUpsert(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/upsert', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } } export class FunctionService { /** * Detach function * Detaches a function from a collection. */ public static detachFunction(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/attached_functions/{name}/detach', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Attach function * Attaches a function to a collection. */ public static attachFunction(options: Options) { return (options.client ?? _heyApiClient).post({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }); } /** * Get attached function * Returns an attached function by name. */ public static getAttachedFunction(options: Options) { return (options.client ?? _heyApiClient).get({ security: [ { name: 'x-chroma-token', type: 'apiKey' } ], url: '/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/{function_name}', ...options }); } }