Skip to content

Prompts

Manage prompt templates for structured LLM interactions.

This example assumes using Portkey; is in scope and apiKey contains your Portkey API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
using var client = new PortkeyClient(apiKey);

// List all prompt templates in your Portkey account.
// Prompts are reusable templates with variables that can be
// rendered and completed through the Portkey gateway.
var response = await client.Prompts.ListPromptsAsync(
    currentPage: 1,
    pageSize: 10);

Console.WriteLine($"Total prompts: {response.Total}");

foreach (var prompt in response.Data!)
{
    Console.WriteLine($"  Prompt: {prompt.Name} (ID: {prompt.Id})");
}