Skip to main content

Overview

The ModelResource provides methods for managing models within Speckle projects. Access it via client.model after authenticating your SpeckleClient. Models are containers within projects that organize related versions of your data. Each model can have multiple versions representing different iterations or states.

Methods

get()

Get a single model by ID.
Parameters:
str
required
The ID of the model to retrieve
str
required
The ID of the project containing the model
Returns:
Model
The model object
Example:
See Model for property details.

get_models()

Get all models in a project with pagination support.
Parameters:
str
required
The ID of the project
int
default:"25"
Maximum number of models to return
str
default:"None"
Cursor for pagination
ProjectModelsFilter
default:"None"
Filter criteria. See ProjectModelsFilter
Returns:
ResourceCollection[Model]
Collection with items, totalCount, and cursor
Example:
See ProjectModelsFilter for filtering options.
The ResourceCollection object includes: - items - List of Model objects - totalCount - Total number of models (across all pages) - cursor - Pagination cursor for next page (or None if no more pages)

get_with_versions()

Get a model with its versions included.
Parameters:
str
required
The ID of the model
str
required
The ID of the project
int
default:"25"
Maximum number of versions to return
str
default:"None"
Cursor for pagination
ModelVersionsFilter
default:"None"
Filter criteria for versions. See ModelVersionsFilter
Returns:
ModelWithVersions
Model with versions collection
Example:
See ModelVersionsFilter for filtering options. Pagination:

create()

Create a new model in a project.
Parameters:
CreateModelInput
required
Model creation parameters. See CreateModelInput
Returns:
Model
The newly created model
Example:
See CreateModelInput for all available fields. Advanced Example:

update()

Update an existing model’s properties.
Parameters:
UpdateModelInput
required
Model update parameters. See UpdateModelInput
Returns:
Model
The updated model
Example:
See UpdateModelInput for all available fields.

delete()

Delete a model permanently.
Parameters:
DeleteModelInput
required
Model deletion parameters. See DeleteModelInput
Returns:
bool
True if deletion was successful
Example:
DeleteModelInput Fields:
  • projectId (str, required) - The project ID
  • modelId (str, required) - The model ID to delete
This operation is irreversible! All versions in the model will be permanently deleted. Consider archiving or exporting data before deletion.

Types

Model

Represents a Speckle model within a project.
str
Model ID
str
Model name (URL-safe identifier)
str
Human-readable display name
str
Model description
datetime
Creation timestamp
datetime
Last update timestamp
str
URL to preview image
LimitedUser
User who created the model. See LimitedUser

Input Types

CreateModelInput

Used with create(). Fields:
  • name (str) - Model name
  • description (str, optional) - Model description
  • project_id (str) - Project ID

UpdateModelInput

Used with update(). Fields:
  • id (str) - Model ID
  • name (str, optional) - New model name
  • description (str, optional) - New description
  • project_id (str) - Project ID

DeleteModelInput

Used with delete(). Fields:
  • id (str) - Model ID
  • project_id (str) - Project ID

Filters

ProjectModelsFilter

Used with get_models() and client.project.get_with_models(). Fields:
  • contributors (List[str], optional) - Filter by contributor user IDs
  • exclude_ids (List[str], optional) - Exclude specific model IDs
  • ids (List[str], optional) - Include only specific model IDs
  • only_with_versions (bool, optional) - Only return models with versions
  • search (str, optional) - Search by model name
  • source_apps (List[str], optional) - Filter by source application

ModelVersionsFilter

Used with get_with_versions(). Fields:
  • priority_ids (List[str]) - Version IDs to prioritize
  • priority_ids_only (bool, optional) - Only return priority versions

VersionResource

Create and manage versions in models

ProjectResource

Manage projects that contain models

Operations

Send and receive data to/from models

SpeckleClient

Main client documentation
Last modified on July 18, 2026