List Pipes langbase.pipe.list()

Retrieve a list of all your AI agent pipes on Langbase using the langbase.pipe.list() function.


Generate a User/Org API key

You will need to generate an API key to authenticate your requests. For more information, visit the User/Org API key documentation.


API reference

langbase.pipe.list()

Function Signature

langbase.pipe.list();

Usage example

Install the SDK

npm i langbase

Environment variables

.env file

LANGBASE_API_KEY="<USER/ORG-API-KEY>"

List pipes

List all pipes

import {Langbase} from 'langbase';

const langbase = new Langbase({
	apiKey: process.env.LANGBASE_API_KEY!,
});

const pipes = await langbase.pipe.list();

Response

  • Name
    PipeListResponse[]
    Type
    Array<object>
    Description

    An array of pipe objects returned by the langbase.pipe.list() function.

    PipeListResponse

    interface PipeListResponse {
    	name: string;
    	description: string;
    	status: 'public' | 'private';
    	owner_login: string;
    	url: string;
    	model: string;
    	stream: boolean;
    	json: boolean;
    	store: boolean;
    	moderate: boolean;
    	top_p: number;
    	max_tokens: number;
    	temperature: number;
    	presence_penalty: number;
    	frequency_penalty: number;
    	stop: string[];
    	tool_choice: 'auto' | 'required' | ToolChoice;
    	parallel_tool_calls: boolean;
    	messages: Message[];
    	variables: Variable[] | [];
    	tools: ToolFunction[] | [];
    	memory: Memory[] | [];
    }
    
    • Name
      name
      Type
      string
      Description

      Name of the pipe.

    • Name
      description
      Type
      string
      Description

      Description of the AI pipe.

    • Name
      status
      Type
      'public' | 'private'
      Description

      Status of the pipe.

    • Name
      owner_login
      Type
      string
      Description

      Login of the pipe owner.

    • Name
      url
      Type
      string
      Description

      Pipe access URL.

    • Name
      model
      Type
      string
      Description

      Pipe LLM model. Combination of model provider and model id.

      Format: provider:model_id

    • Name
      stream
      Type
      boolean
      Description

      Pipe stream status. If enabled, the pipe will stream the response.

    • Name
      json
      Type
      boolean
      Description

      Pipe JSON status. If enabled, the pipe will return the response in JSON format.

    • Name
      store
      Type
      boolean
      Description

      Whether to store the prompt and completions in the database.

    • Name
      moderate
      Type
      boolean
      Description

      Whether to moderate the completions returned by the model.

    • Name
      top_p
      Type
      number
      Description

      Pipe configured top_p value.

    • Name
      max_tokens
      Type
      number
      Description

      Configured maximum tokens for the pipe.

    • Name
      temperature
      Type
      number
      Description

      Configured temperature for the pipe.

      What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random. Lower values like 0.2 will make it more focused and deterministic.

    • Name
      presence_penalty
      Type
      number
      Description

      Configured presence penalty for the pipe.

    • Name
      frequency_penalty
      Type
      number
      Description

      Configured frequency penalty for the pipe.

    • Name
      stop
      Type
      string[]
      Description

      Configured stop sequences for the pipe.

    • Name
      tool_choice
      Type
      'auto' | 'required' | ToolChoice
      Description

      Tool usage configuration.

      • Name
        'auto'
        Type
        string
        Description

        Model decides when to use tools.

      • Name
        'required'
        Type
        string
        Description

        Model must use specified tools.

      • Name
        ToolChoice
        Type
        object
        Description

        Forces use of a specific function.

        ToolChoice Object

        interface ToolChoice {
        	type: 'function';
        	function: {
        		name: string;
        	};
        }
        
    • Name
      parallel_tool_calls
      Type
      boolean
      Description

      If enabled, the pipe will make parallel tool calls.

    • Name
      messages
      Type
      Array<Message>
      Description

      A messages array including the following properties.

      Message Object

      interface Message {
      	role: 'user' | 'assistant' | 'system'| 'tool';
      	content: string | null;
      	name?: string;
      	tool_call_id?: string;
      	tool_calls?: ToolCall[];
      }
      
      • Name
        role
        Type
        'user' | 'assistant' | 'system'| 'tool'
        Description

        The role of the author of this message

      • Name
        content
        Type
        string
        Description

        The contents of the chunk message

      • Name
        name
        Type
        string
        Description

        The name of the tool called by LLM

      • Name
        tool_call_id
        Type
        string
        Description

        The id of the tool called by LLM

      • Name
        tool_calls
        Type
        Array<ToolCall>
        Description

        The array of tools sent to LLM

        ToolCall Object

        interface ToolCall {
        	id: string;
        	type: 'function';
        	function: Function;
        }
        
      • Name
        function
        Type
        Function
        Description

        Function definition sent to LLM

        Function Object

        export interface Function {
        	name: string;
        	arguments: string;
        }
        
    • Name
      variables
      Type
      Array<Variable>
      Description

      A variables array including the name and value params.

      Variable Object

      interface Variable {
      	name: string;
      	value: string;
      }
      
      • Name
        name
        Type
        string
        Description

        The name of the variable.

      • Name
        value
        Type
        string
        Description

        The value of the variable.

    • Name
      memory
      Type
      Array<Memory>
      Description

      An array of memories the pipe has access to.

      Memory Object

      interface Memory {
      	name: string;
      }
      

Example PipeListResponse

[
	{
		"name": "summary-agent",
		"description": "AI pipe for summarization",
		"status": "public",
		"owner_login": "user123",
		"url": "https://langbase.com/user123/summary-agent",
		"model": "openai:gpt-4o-mini",
		"stream": true,
		"json": false,
		"store": true,
		"moderate": false,
		"top_p": 1,
		"max_tokens": 1000,
		"temperature": 0.7,
		"presence_penalty": 1,
		"frequency_penalty": 1,
		"stop": [],
		"tool_choice": "auto",
		"parallel_tool_calls": true,
		"messages": [],
		"variables": [],
		"tools": [],
		"memory": []
	}
]