curl -X POST https://platform.u1.archetypeai.app/api/lens/clone \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lens_id": "lns-test-lens-93812264"
}'
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.post(
"https://platform.u1.archetypeai.app/api/lens/clone",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={
"lens_id": "lns-test-lens-93812264"
}
)
data = response.json()
# Check if clone was successful (should have lens_name)
if data.get("lens_name"):
print(f"Cloned lens ID: {data['lens_id']}")
else:
print("Clone may have failed - verify lens_id exists")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/clone', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
lens_id: 'lns-test-lens-93812264'
})
});
const data = await response.json();
if (data.lens_name) {
console.log(`Cloned lens ID: ${data.lens_id}`);
} else {
console.log('Clone may have failed - verify lens_id exists');
}
{
"lens_id": "lns-test-lens-b2ba0058",
"lens_name": "Test Lens",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": true,
"lens_config": {
"model_pipeline": [
{
"processor_name": "lens_noop_processor",
"processor_config": {}
}
],
"origin_lens_id": "lns-test-lens-c55bdf3b"
}
}
{
"errors": [
{
"code": "lens_not_found",
"message": "The specified lens was not found.",
"suggestion": "Verify the lens identifier and ensure it exists before retrying.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "missing_lens_id",
"message": "Missing required field: lens_id.",
"suggestion": "Include the 'lens_id' field in the request payload.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
Lens API
Clone Lens
Creates a copy of a lens template
POST
/
lens
/
clone
curl -X POST https://platform.u1.archetypeai.app/api/lens/clone \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lens_id": "lns-test-lens-93812264"
}'
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.post(
"https://platform.u1.archetypeai.app/api/lens/clone",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={
"lens_id": "lns-test-lens-93812264"
}
)
data = response.json()
# Check if clone was successful (should have lens_name)
if data.get("lens_name"):
print(f"Cloned lens ID: {data['lens_id']}")
else:
print("Clone may have failed - verify lens_id exists")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/clone', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
lens_id: 'lns-test-lens-93812264'
})
});
const data = await response.json();
if (data.lens_name) {
console.log(`Cloned lens ID: ${data.lens_id}`);
} else {
console.log('Clone may have failed - verify lens_id exists');
}
{
"lens_id": "lns-test-lens-b2ba0058",
"lens_name": "Test Lens",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": true,
"lens_config": {
"model_pipeline": [
{
"processor_name": "lens_noop_processor",
"processor_config": {}
}
],
"origin_lens_id": "lns-test-lens-c55bdf3b"
}
}
{
"errors": [
{
"code": "lens_not_found",
"message": "The specified lens was not found.",
"suggestion": "Verify the lens identifier and ensure it exists before retrying.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "missing_lens_id",
"message": "Missing required field: lens_id.",
"suggestion": "Include the 'lens_id' field in the request payload.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
Requires version 1.1.5 or later of the Archetype platform.
Overview
This endpoint creates a copy of a lens template, registering the lens and returning the new lens_id. Note that once a lens is cloned, any modifications to the original lens template will not be propagated to any cloned templates.Request
Response
curl -X POST https://platform.u1.archetypeai.app/api/lens/clone \
-H "Authorization: Bearer $ATAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"lens_id": "lns-test-lens-93812264"
}'
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.post(
"https://platform.u1.archetypeai.app/api/lens/clone",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={
"lens_id": "lns-test-lens-93812264"
}
)
data = response.json()
# Check if clone was successful (should have lens_name)
if data.get("lens_name"):
print(f"Cloned lens ID: {data['lens_id']}")
else:
print("Clone may have failed - verify lens_id exists")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/clone', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
lens_id: 'lns-test-lens-93812264'
})
});
const data = await response.json();
if (data.lens_name) {
console.log(`Cloned lens ID: ${data.lens_id}`);
} else {
console.log('Clone may have failed - verify lens_id exists');
}
{
"lens_id": "lns-test-lens-b2ba0058",
"lens_name": "Test Lens",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": true,
"lens_config": {
"model_pipeline": [
{
"processor_name": "lens_noop_processor",
"processor_config": {}
}
],
"origin_lens_id": "lns-test-lens-c55bdf3b"
}
}
{
"errors": [
{
"code": "lens_not_found",
"message": "The specified lens was not found.",
"suggestion": "Verify the lens identifier and ensure it exists before retrying.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "missing_lens_id",
"message": "Missing required field: lens_id.",
"suggestion": "Include the 'lens_id' field in the request payload.",
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "unauthorized_request",
"message": "Unauthorized or invalid access.",
"suggestion": "Provide valid authentication credentials and ensure they have the required permissions.",
"error_uid": "err-xxxxxxxx"
}
]
}
Was this page helpful?