API Reference
Accessing the Experiments API
TheExperimentsClient is accessible as a property on the main Basalt client:
Methods
create_sync
Creates a new experiment synchronously.
feature_slug(str, required): A slug to identify the feature this experiment belongs to (e.g., “qa-model”, “recommendation-algo”).name(str, required): A human-readable name for the experiment (e.g., “GPT-4 vs Claude Comparison”).
Experiment object with:
id(str): Unique experiment identifiername(str): Experiment namefeature_slug(str): Feature identifiercreated_at(str): ISO 8601 timestamp of creation
UnauthorizedError: Invalid or missing API keyBadRequestError: Invalid parametersNetworkError: Network connectivity issuesBasaltAPIError: Other API errors
create (async)
Creates a new experiment asynchronously.
create_sync. Same parameters and return type.
Example:
Models
Experiment
Represents a registered experiment.TraceExperiment
Represents experiment metadata attached to a trace. Used when attaching an experiment to a span.id are optional. Example: