Skip to main content
GET
/
api
/
ml
/
v1
/
prompts
List prompts
curl --request GET \
  --url https://{controlPlaneURL}/api/ml/v1/prompts \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{controlPlaneURL}/api/ml/v1/prompts"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{controlPlaneURL}/api/ml/v1/prompts', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://{controlPlaneURL}/api/ml/v1/prompts",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://{controlPlaneURL}/api/ml/v1/prompts"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{controlPlaneURL}/api/ml/v1/prompts")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://{controlPlaneURL}/api/ml/v1/prompts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "id": "<string>",
      "ml_repo_id": "<string>",
      "name": "<string>",
      "fqn": "<string>",
      "created_by_subject": {
        "subjectId": "<string>",
        "subjectSlug": "<string>",
        "subjectDisplayName": "<string>",
        "subjectPatName": "<string>",
        "subjectControllerName": "<string>",
        "subjectExternalIdentitySlug": "<string>"
      },
      "type": "chat_prompt",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "latest_version": {
        "id": "<string>",
        "fqn": "<string>",
        "created_by_subject": {
          "subjectId": "<string>",
          "subjectSlug": "<string>",
          "subjectDisplayName": "<string>",
          "subjectPatName": "<string>",
          "subjectControllerName": "<string>",
          "subjectExternalIdentitySlug": "<string>"
        },
        "manifest": {
          "name": "<string>",
          "metadata": {},
          "ml_repo": "<string>",
          "messages": [
            {
              "role": "system",
              "content": "<string>",
              "name": "<string>"
            }
          ],
          "version": 2,
          "type": "chat_prompt",
          "description": "<string>",
          "version_alias": "<string>",
          "variables": {},
          "model_configuration": {
            "provider": "<string>",
            "model": "<string>",
            "parameters": {
              "max_tokens": 123,
              "temperature": 123,
              "top_k": 123,
              "top_p": 123,
              "stop": [
                "<string>"
              ]
            },
            "extra_parameters": {}
          },
          "tools": [
            {
              "type": "function",
              "function": {
                "name": "<string>",
                "description": "<string>",
                "parameters": {},
                "strict": false
              }
            }
          ],
          "mcp_servers": [
            {
              "type": "mcp-server-fqn",
              "integration_fqn": "<string>",
              "enable_all_tools": false,
              "tools": [
                {
                  "name": "<string>"
                }
              ]
            }
          ],
          "guardrails": {
            "input_guardrails": [
              "<string>"
            ],
            "output_guardrails": [
              "<string>"
            ]
          },
          "response_format": {
            "type": "json_object"
          },
          "routing_config": {
            "type": "weight-based-routing",
            "load_balance_targets": [
              {
                "target": "<string>",
                "weight": 123,
                "retry_config": {
                  "attempts": 1,
                  "delay": 100,
                  "on_status_codes": [
                    "429",
                    "500",
                    "502",
                    "503"
                  ]
                },
                "fallback_status_codes": [
                  "401",
                  "403",
                  "404",
                  "408",
                  "429",
                  "500",
                  "502",
                  "503"
                ],
                "fallback_candidate": true,
                "override_params": {},
                "headers_override": {
                  "remove": [
                    "<string>"
                  ],
                  "set": {}
                },
                "metadata_match": {}
              }
            ],
            "sticky_routing": {
              "ttl_seconds": 44100,
              "session_identifiers": [
                {
                  "key": "<string>"
                }
              ]
            }
          },
          "cache_config": {
            "type": "semantic",
            "similarity_threshold": 0.5,
            "ttl": 3600,
            "namespace": "<string>"
          },
          "tool_call_to_mcp_mapping": {},
          "logging_config": {
            "enabled": true,
            "tracing_project_fqn": "<string>"
          },
          "sub_agents": [
            {
              "name": "<string>"
            }
          ]
        },
        "ml_repo_id": "<string>",
        "prompt_id": "<string>",
        "created_at": "2023-11-07T05:31:56Z",
        "updated_at": "2023-11-07T05:31:56Z",
        "tags": [
          "<string>"
        ],
        "version_alias": "<string>",
        "usage_code_snippet": "<string>",
        "usage_code_snippets": [
          {
            "display_name": "<string>",
            "language": "<string>",
            "code": "<string>",
            "libraries": [
              "<string>"
            ],
            "icon": "<string>"
          }
        ]
      },
      "run_steps": [
        123
      ]
    }
  ],
  "pagination": {
    "total": 100,
    "offset": 0,
    "limit": 10
  }
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

fqn
string

Fully qualified name to filter prompts by (format: 'chat_prompt:{tenant_name}/{ml_repo_name}/{prompt_name}')

ml_repo_id
string

ID of the ML Repo to filter prompts by

name
string

Name of the prompt to filter by

offset
integer
default:0

Number of prompts to skip for pagination

limit
integer

Maximum number of prompts to return

include_empty_prompts
boolean
default:true

Whether to include prompts that have no versions

Response

List of prompts matching the query with pagination information

data
Prompt · object[]
required

List of prompts matching the query

pagination
Pagination · object
required

Pagination information including total count, offset, and limit