> ## 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.

> ## Agent Instructions
> Start with /introduction/getting-started. Use the Direct Query API (POST /query) with the Newton Fusion model (text, image, and video reasoning) or the Newton Omega encoder (time-series embeddings). ATAI_API_ENDPOINT must include the version path: /v0.5 for most APIs, /v0.6 for the Fine-Tuning Service. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# Get Pipeline Schema

> Retrieve the configuration schema for a specific pipeline

<Callout icon="clock" color="#3064E3" iconType="solid">
  Requires [version 1.1.0](/release-notes/1.1.x#v1-1-0) or later of the Archetype platform.
</Callout>

## Overview

This endpoint returns the configuration schema for a specific pipeline, including the user-facing JSON Schema, full config schema, and input/output port definitions. Use this to understand what parameters a pipeline accepts before creating a job.

## Request

<ParamField path="id" type="string" required>
  The unique pipeline identifier
</ParamField>

## Response

<ResponseField name="id" type="string">
  Pipeline identifier
</ResponseField>

<ResponseField name="pipeline_key" type="string">
  Pipeline key
</ResponseField>

<ResponseField name="pipeline_version" type="string">
  Pipeline version
</ResponseField>

<ResponseField name="user_schema" type="object">
  User-facing JSON Schema describing the configurable parameters for this pipeline (pretty-printed JSON)
</ResponseField>

<ResponseField name="config_schema" type="object">
  Full JSON Schema for the pipeline configuration
</ResponseField>

<ResponseField name="inputs" type="object">
  Input port definitions, each with `name`, `description`, `mode` (`plain_file_list` or `n_shot_file_list`), `distribute` (`scatter` or `replicate`), `required` (bool), and `tracked` (bool — `false` for reference/n-shot ports whose inputs land in the terminal `reference` status).
</ResponseField>

<ResponseField name="outputs" type="object">
  Output port definitions, each with `name` and `description` fields
</ResponseField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl https://api.u1.archetypeai.app/v0.5/batch/registry/pipelines/ppl_abc123def456/schema \
    -H "Authorization: Bearer $ATAI_API_KEY"
  ```

  ```python Python theme={"system"}
  import requests
  import os

  api_key = os.environ.get("ATAI_API_KEY")
  pipeline_id = "ppl_abc123def456"

  response = requests.get(
      f"https://api.u1.archetypeai.app/v0.5/batch/registry/pipelines/{pipeline_id}/schema",
      headers={"Authorization": f"Bearer {api_key}"}
  )

  schema = response.json()
  print(f"Pipeline: {schema['pipeline_key']} v{schema['pipeline_version']}")
  print(f"Inputs: {list(schema['inputs'].keys())}")
  print(f"Outputs: {list(schema['outputs'].keys())}")
  print(f"User schema: {schema['user_schema']}")
  ```

  ```javascript JavaScript theme={"system"}
  const pipelineId = 'ppl_abc123def456';

  const response = await fetch(`https://api.u1.archetypeai.app/v0.5/batch/registry/pipelines/${pipelineId}/schema`, {
    headers: {
      'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
    }
  });

  const schema = await response.json();
  console.log(`Pipeline: ${schema.pipeline_key} v${schema.pipeline_version}`);
  console.log('Inputs:', Object.keys(schema.inputs));
  console.log('Outputs:', Object.keys(schema.outputs));
  console.log('User schema:', JSON.stringify(schema.user_schema, null, 2));
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={"system"}
  {
    "id": "ppl_abc123def456",
    "pipeline_key": "machine-state-classification",
    "pipeline_version": "1.1.1",
    "user_schema": {
      "type": "object",
      "properties": {
        "model_type": {
          "type": "string",
          "description": "Omega model variant used to generate embeddings.",
          "enum": ["omega_1_4_base", "omega_1_3_surface", "omega_1_3_power_drive"],
          "default": "omega_1_4_base"
        },
        "batch_size": {
          "type": "integer",
          "description": "Number of windows processed together in a single batch.",
          "default": 32,
          "minimum": 1
        },
        "classifier_config": {
          "type": "object",
          "properties": {
            "n_neighbors": {"type": "integer", "minimum": 3, "default": 5},
            "metric": {"type": "string", "enum": ["euclidean", "cosine", "manhattan"], "default": "euclidean"},
            "weights": {"type": "string", "enum": ["uniform", "distance"], "default": "uniform"},
            "normalize_embeddings": {"type": "boolean", "default": false}
          }
        }
      }
    },
    "config_schema": {},
    "inputs": {
      "worker.inference": {
        "name": "Input files",
        "description": "CSV files for machine-state classification",
        "mode": "plain_file_list",
        "distribute": "scatter",
        "required": true,
        "tracked": true
      },
      "worker.n_shots": {
        "name": "N-Shot example files",
        "description": "Labeled few-shot training files (class declared via input metadata)",
        "mode": "n_shot_file_list",
        "distribute": "replicate",
        "required": true,
        "tracked": false
      }
    },
    "outputs": {
      "worker.results": {
        "name": "Output files",
        "description": "Machine-state classification results"
      }
    }
  }
  ```

  ```json 404 - Not Found theme={"system"}
  {
    "code": "NOT_FOUND",
    "message": "Pipeline not found",
    "error_uid": "err_abc123"
  }
  ```

  ```json 401 - Unauthorized theme={"system"}
  {
    "detail": "Invalid access with key: api_key_not_found"
  }
  ```
</ResponseExample>

<Tip>
  Use the `user_schema` field to understand what parameters you can pass in the `config` field when creating a job. This schema describes the user-configurable options for each pipeline component.
</Tip>
