Levain LabsLevain Labs
API ReferenceAgents

Create Version

Create a new version of an agent.

A new v{N} is branched off either the latest version's branch (the default), parent_version when the caller forks explicitly, or the root branch for the very first version on an agent.

POST
/api/v1/agents/{agent_id}/versions

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

agent_id*Agent Id

Header Parameters

X-API-Key?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.levainlabs.com/api/v1/agents/string/versions" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "string",
  "agent_id": "string",
  "version": 0,
  "description": "string",
  "status": "string",
  "parent_version": 0,
  "created_at": "string",
  "updated_at": "string",
  "last_commit_at": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}