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

# createExperiment

***

# Function: createExperiment()

```ts theme={null}
function createExperiment(
  name: string,
  projectName: string,
  dataset?: null | ExperimentDatasetRequest,
  metrics?: (string | Metric)[],
): Promise<ExperimentResponseType>;
```

Defined in: [src/utils/experiments.ts](https://github.com/rungalileo/galileo-js/blob/main/src/utils/experiments.ts)

Creates a new experiment.

## Parameters

### name

`string`

The name of the experiment.

### projectName

`string`

The name of the project.

### dataset?

(Optional) The dataset configuration.

`null` | [`ExperimentDatasetRequest`](/sdk-api/typescript/reference/types/type-aliases/ExperimentDatasetRequest)

### metrics?

(`string` | [`Metric`](/sdk-api/typescript/reference/types/interfaces/Metric))\[]

(Optional) List of server-side metrics to configure for the experiment.

## Returns

`Promise`\<[`ExperimentResponseType`](/sdk-api/typescript/reference/types/type-aliases/ExperimentResponseType)>

A promise that resolves to the created experiment.
