curl https://platform.u1.archetypeai.app/api/lens/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://platform.u1.archetypeai.app/api/lens/metadata?lens_id=lns-test-lens-b2ba0058" \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.get(
"https://platform.u1.archetypeai.app/api/lens/metadata",
headers={"Authorization": f"Bearer {api_key}"}
)
lenses = response.json()
for lens in lenses:
if lens: # Check for non-empty objects
print(f"Lens: {lens.get('lens_name')} (ID: {lens.get('lens_id')})")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/metadata', {
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const lenses = await response.json();
lenses.forEach(lens => {
if (Object.keys(lens).length > 0) {
console.log(`Lens: ${lens.lens_name} (ID: ${lens.lens_id})`);
}
});
[
{
"lens_id": "lns-test-lens-b2ba0058",
"lens_name": "Test Lens",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": true,
"lens_config": {
"lens_name": "Test Lens"
}
},
{
"lens_id": "lns-fd669361822b07e2-bc608aa3fdf8b4f9",
"lens_name": "Activity Monitor",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": false,
"lens_config": {
"model_pipeline": [
{
"processor_name": "lens_camera_processor",
"processor_config": {}
}
],
"model_parameters": {
"focus": "Describe the video.",
"model_name": "Newton",
"instruction": "Answer the following question about the video:",
"max_replicas": 1,
"min_replicas": 1,
"model_version": "Newton::c2_4_7b_251215a172f6d7",
"max_new_tokens": 512,
"camera_buffer_size": 5,
"camera_buffer_step_size": 5
}
}
}
]
[
{}
]
{
"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"
}
]
}
{
"detail": [
{
"type": "int_parsing",
"loc": [
"query",
"shard_index"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "abc"
}
]
}
Lens API
Get Lens Metadata
Retrieve detailed metadata for all lenses available to your organization
GET
/
lens
/
metadata
curl https://platform.u1.archetypeai.app/api/lens/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://platform.u1.archetypeai.app/api/lens/metadata?lens_id=lns-test-lens-b2ba0058" \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.get(
"https://platform.u1.archetypeai.app/api/lens/metadata",
headers={"Authorization": f"Bearer {api_key}"}
)
lenses = response.json()
for lens in lenses:
if lens: # Check for non-empty objects
print(f"Lens: {lens.get('lens_name')} (ID: {lens.get('lens_id')})")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/metadata', {
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const lenses = await response.json();
lenses.forEach(lens => {
if (Object.keys(lens).length > 0) {
console.log(`Lens: ${lens.lens_name} (ID: ${lens.lens_id})`);
}
});
[
{
"lens_id": "lns-test-lens-b2ba0058",
"lens_name": "Test Lens",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": true,
"lens_config": {
"lens_name": "Test Lens"
}
},
{
"lens_id": "lns-fd669361822b07e2-bc608aa3fdf8b4f9",
"lens_name": "Activity Monitor",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": false,
"lens_config": {
"model_pipeline": [
{
"processor_name": "lens_camera_processor",
"processor_config": {}
}
],
"model_parameters": {
"focus": "Describe the video.",
"model_name": "Newton",
"instruction": "Answer the following question about the video:",
"max_replicas": 1,
"min_replicas": 1,
"model_version": "Newton::c2_4_7b_251215a172f6d7",
"max_new_tokens": 512,
"camera_buffer_size": 5,
"camera_buffer_step_size": 5
}
}
}
]
[
{}
]
{
"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"
}
]
}
{
"detail": [
{
"type": "int_parsing",
"loc": [
"query",
"shard_index"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "abc"
}
]
}
Requires version 1.1.5 or later of the Archetype platform.
Overview
This endpoint returns detailed information about each lens available to your organization, including lens IDs, names, and configurations.Request
Response
Returns an array of lens objects, each containing:curl https://platform.u1.archetypeai.app/api/lens/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://platform.u1.archetypeai.app/api/lens/metadata?lens_id=lns-test-lens-b2ba0058" \
-H "Authorization: Bearer $ATAI_API_KEY"
import requests
import os
api_key = os.environ.get("ATAI_API_KEY")
response = requests.get(
"https://platform.u1.archetypeai.app/api/lens/metadata",
headers={"Authorization": f"Bearer {api_key}"}
)
lenses = response.json()
for lens in lenses:
if lens: # Check for non-empty objects
print(f"Lens: {lens.get('lens_name')} (ID: {lens.get('lens_id')})")
const response = await fetch('https://platform.u1.archetypeai.app/api/lens/metadata', {
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
});
const lenses = await response.json();
lenses.forEach(lens => {
if (Object.keys(lens).length > 0) {
console.log(`Lens: ${lens.lens_name} (ID: ${lens.lens_id})`);
}
});
[
{
"lens_id": "lns-test-lens-b2ba0058",
"lens_name": "Test Lens",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": true,
"lens_config": {
"lens_name": "Test Lens"
}
},
{
"lens_id": "lns-fd669361822b07e2-bc608aa3fdf8b4f9",
"lens_name": "Activity Monitor",
"lens_status": "LENS_STATUS_MOUNTED",
"lens_modifiable": false,
"lens_config": {
"model_pipeline": [
{
"processor_name": "lens_camera_processor",
"processor_config": {}
}
],
"model_parameters": {
"focus": "Describe the video.",
"model_name": "Newton",
"instruction": "Answer the following question about the video:",
"max_replicas": 1,
"min_replicas": 1,
"model_version": "Newton::c2_4_7b_251215a172f6d7",
"max_new_tokens": 512,
"camera_buffer_size": 5,
"camera_buffer_step_size": 5
}
}
}
]
[
{}
]
{
"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"
}
]
}
{
"detail": [
{
"type": "int_parsing",
"loc": [
"query",
"shard_index"
],
"msg": "Input should be a valid integer, unable to parse string as an integer",
"input": "abc"
}
]
}
Was this page helpful?