Skip to content

Configs

Manage gateway configurations for routing and load balancing.

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
using var client = new PortkeyClient(apiKey);

// List all gateway configurations in your Portkey account.
// Configs define routing rules, load balancing strategies,
// fallbacks, retries, and other gateway behaviors.
var response = await client.Configs.ListConfigsAsync();

Console.WriteLine($"Success: {response.Success}");
Console.WriteLine($"Configs found: {response.Data!.Count}");

foreach (var config in response.Data)
{
    Console.WriteLine($"  Config: {config.Name} (Slug: {config.Slug})");
}