curl https://api.u1.archetypeai.app/v0.5/lens/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://api.u1.archetypeai.app/v0.5/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://api.u1.archetypeai.app/v0.5/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://api.u1.archetypeai.app/v0.5/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_3_7b_2508014e10af56",
"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://api.u1.archetypeai.app/v0.5/lens/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://api.u1.archetypeai.app/v0.5/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://api.u1.archetypeai.app/v0.5/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://api.u1.archetypeai.app/v0.5/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_3_7b_2508014e10af56",
"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"
}
]
}
Overview
This endpoint returns detailed information about each lens available to your organization, including lens IDs, names, and configurations.Request
string
Optional. Filter the response to a specific lens by ID.
integer
default:"-1"
Optional. Shard index for pagination. Use
-1 to retrieve all lenses.integer
default:"-1"
Optional. Maximum items per shard. Use
-1 for no limit.Response
Returns an array of lens objects, each containing:string
Unique identifier for the lens
string
Human-readable name of the lens
string
Current status of the lens (e.g., “LENS_STATUS_MOUNTED”)
boolean
Whether the lens can be modified or deleted
object
Configuration object containing lens-specific settings and parameters
curl https://api.u1.archetypeai.app/v0.5/lens/metadata \
-H "Authorization: Bearer $ATAI_API_KEY"
curl "https://api.u1.archetypeai.app/v0.5/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://api.u1.archetypeai.app/v0.5/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://api.u1.archetypeai.app/v0.5/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_3_7b_2508014e10af56",
"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?
⌘I