---
title: "Add Variant From Base And Config"
method: POST
path: "/variants/from-base"
tags: ["Variants"]
---

# Add Variant From Base And Config

`POST /variants/from-base`

Add a new variant based on an existing one.
Same as POST /config

Args:
    payload (AddVariantFromBasePayload): Payload containing base variant ID, new variant name, and parameters.

Raises:
    HTTPException: Raised if the variant could not be added or accessed.

Returns:
    Union[AppVariantResponse, Any]: New variant details or exception.

## Request body

- AddVariantFromBasePayload
  - `base_id` string, required
  - `new_variant_name` string, required
  - `new_config_name` string, required
  - `parameters` object, required
  - `commit_message` string, nullable

## Response `200`

Successful Response

- union
  - AppVariantResponse
    - `app_id` string, required
    - `app_name` string, required
    - `variant_id` string, required
    - `variant_name` string, required
    - `project_id` string, required
    - `base_name` string, required
    - `base_id` string, required
    - `config_name` string, required
    - `uri` string, nullable
    - `revision` integer, required
    - `created_at` string, nullable
    - `updated_at` string, nullable
    - `modified_by_id` string, nullable
    - `organization_id` string, nullable
    - `workspace_id` string, nullable
  - unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-02-13** `72fe88316d15` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status
- **2025-06-27** `e3e84db47198` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/variants/from-base/post.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/revisions/edbcb02ac8b1/schema)
