Langfuse launches AI Gateway Learn more
FaqHow do I list prompts with a specific label?

How do I list prompts with a specific label?

Call GET /api/public/v2/prompts with the label query parameter:

curl -u "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" \
  "https://cloud.langfuse.com/api/public/v2/prompts?label=production&limit=100"

Other query parameters are name, tag, version, fromUpdatedAt, toUpdatedAt, page (starts at 1), and limit (up to 100). The response lists each matching prompt with its versions and labels. The versions and labels in the response include only the versions that match your filter.

With the SDKs:

from langfuse import get_client

langfuse = get_client()
prompts = langfuse.api.prompts.list(label="production", limit=100)
import { LangfuseClient } from "@langfuse/client";

const langfuse = new LangfuseClient();
const prompts = await langfuse.api.prompts.list({ label: "production", limit: 100 });

To fetch the content of a prompt, use langfuse.get_prompt() (Python) or langfuse.prompt.get() (JS/TS). See Get started with prompt management.


Was this page helpful?

Last updated on