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

# Create Version

> Create a version for your product.

## Returns

Returns a [Version](/concepts/product/version) object for the given parameters, or `None` if an error occurs.

## Example

```python theme={"system"}
version = galtea.versions.create(
    name=version_name,
    product_id=product_id,
    description="Demo version created via SDK",
)
```

## Parameters

<ResponseField name="name" type="string" required>
  The name of the version.
</ResponseField>

<ResponseField name="product_id" type="string" required>
  The ID of the product you want to create a version for.
</ResponseField>

<ResponseField name="description" type="string" optional>
  A textual description of the version.
</ResponseField>

<ResponseField name="system_prompt" type="string" optional>
  The system prompt used with the model for this version.
</ResponseField>

<ResponseField name="model_id" type="string" optional>
  Reference to a [model](/concepts/model) configured in the Galtea Platform, used for cost tracking on this version's inference results.

  <Accordion title="Example: linking a version to a model">
    Use the [Model service](/sdk/api/model/service) to look up an existing model by name and pass its `id` to `versions.create`:

    ```python theme={"system"}
    # Look up an existing model by name (created earlier via galtea.models.create).
    selected_model = galtea.models.get_by_name(name=model_name)

    # Pass its id to versions.create so Galtea can track cost for this version's
    # inference results using the model's per-token pricing.
    version = galtea.versions.create(
        name="v1.0-with-model-" + run_identifier,
        product_id=_demo_product_id,
        model_id=selected_model.id,
        description="Version linked to a model for cost tracking.",
    )
    ```

    See [`galtea.models.get_by_name`](/sdk/api/model/get-by-name) or [`galtea.models.list`](/sdk/api/model/list) for other ways to discover existing models.
  </Accordion>
</ResponseField>

<ResponseField name="dataset_description" type="string" optional>
  Description of the dataset used for training or fine-tuning.
</ResponseField>

<ResponseField name="dataset_uri" type="string" optional>
  A URI pointing to the dataset.
</ResponseField>

<ResponseField name="conversation_endpoint_connection_id" type="string" optional>
  The ID of the [Endpoint Connection](/concepts/product/endpoint-connection) used for conversational interactions with your AI product.
</ResponseField>

<ResponseField name="initialization_endpoint_connection_id" type="string" optional>
  The ID of the [Endpoint Connection](/concepts/product/endpoint-connection) executed before the conversation begins. Used to initialize a session and obtain a session ID. See [Version Endpoint Connections](/concepts/product/version#endpoint-connections) for more details.
</ResponseField>

<ResponseField name="finalization_endpoint_connection_id" type="string" optional>
  The ID of the [Endpoint Connection](/concepts/product/endpoint-connection) executed after the conversation ends. Used to clean up resources.
</ResponseField>

<ResponseField name="phone_connection_id" type="string" optional>
  The ID of the [Phone Connection](/concepts/product/phone-connection) Galtea dials to reach your AI agent over the phone. A version's conversation target is mutually exclusive: provide one of a phone connection, a WebRTC connection (`web_rtc_connection_id`), or an endpoint connection (`conversation_endpoint_connection_id`), never more than one.
</ResponseField>

<ResponseField name="web_rtc_connection_id" type="string" optional>
  The ID of the [WebRTC Connection](/concepts/product/webrtc-connection) Galtea uses to reach your AI agent over WebRTC. A version's conversation target is mutually exclusive: provide one of a WebRTC connection, a phone connection (`phone_connection_id`), or an endpoint connection (`conversation_endpoint_connection_id`), never more than one.
</ResponseField>

<ResponseField name="endpoint_connection_id" type="string" optional>
  <Warning>Deprecated. Use `conversation_endpoint_connection_id` instead.</Warning>
  Legacy parameter maintained for backwards compatibility. Maps to `conversation_endpoint_connection_id`.
</ResponseField>

<ResponseField name="guardrails" type="string" optional>
  Configuration or description of safety guardrails applied.
</ResponseField>

<ResponseField name="parent_version_id" type="string" optional>
  The ID of the parent [version](/concepts/product/version) this version is iterated from. Setting it makes the new version a revision of the parent and records the lineage. The parent must belong to the same product. Leave it empty to create a root version. See [Version Lineage](/concepts/product/version#version-lineage) for details.
</ResponseField>
