> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archetypeai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Lens Metadata

> Retrieve detailed metadata for all lenses available to your organization

## Overview

This endpoint returns detailed information about each lens available to your organization, including lens IDs, names, and configurations.

## Request

<ParamField query="lens_id" type="string">
  Optional. Filter the response to a specific lens by ID.
</ParamField>

<ParamField query="shard_index" type="integer" default="-1">
  Optional. Shard index for pagination. Use `-1` to retrieve all lenses.
</ParamField>

<ParamField query="max_items_per_shard" type="integer" default="-1">
  Optional. Maximum items per shard. Use `-1` for no limit.
</ParamField>

## Response

Returns an array of lens objects, each containing:

<ResponseField name="lens_id" type="string">
  Unique identifier for the lens
</ResponseField>

<ResponseField name="lens_name" type="string">
  Human-readable name of the lens
</ResponseField>

<ResponseField name="lens_status" type="string">
  Current status of the lens (e.g., "LENS\_STATUS\_MOUNTED")
</ResponseField>

<ResponseField name="lens_modifiable" type="boolean">
  Whether the lens can be modified or deleted
</ResponseField>

<ResponseField name="lens_config" type="object">
  Configuration object containing lens-specific settings and parameters
</ResponseField>

<RequestExample>
  ```bash cURL - All Lenses theme={"system"}
  curl https://api.u1.archetypeai.app/v0.5/lens/metadata \
    -H "Authorization: Bearer $ATAI_API_KEY"
  ```

  ```bash cURL - Specific Lens theme={"system"}
  curl "https://api.u1.archetypeai.app/v0.5/lens/metadata?lens_id=lns-test-lens-b2ba0058" \
    -H "Authorization: Bearer $ATAI_API_KEY"
  ```

  ```python Python theme={"system"}
  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')})")
  ```

  ```javascript JavaScript theme={"system"}
  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})`);
    }
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={"system"}
  [
    {
      "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
        }
      }
    }
  ]
  ```

  ```json 200 - Non-existent lens_id (empty object in array) theme={"system"}
  [
    {}
  ]
  ```

  ```json 401 - Unauthorized theme={"system"}
  {
    "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"
      }
    ]
  }
  ```

  ```json 422 - Invalid shard_index type theme={"system"}
  {
    "detail": [
      {
        "type": "int_parsing",
        "loc": [
          "query",
          "shard_index"
        ],
        "msg": "Input should be a valid integer, unable to parse string as an integer",
        "input": "abc"
      }
    ]
  }
  ```
</ResponseExample>
