Skip to content

Generate

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

1
2
3
4
5
6
7
8
var apiKey =
    Environment.GetEnvironmentVariable("SILICONFLOW_API_KEY") is { Length: > 0 } value
        ? value
        : throw new AssertInconclusiveException("SILICONFLOW_API_KEY environment variable is not found.");

using var client = new SiliconFlowClient(apiKey);

// The client has sub-clients for different API capabilities.