Client Creation
Basic example showing how to create a Picsart client.
This example assumes using Picsart; is in scope and apiKey contains your Picsart API key.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 | // Create a Picsart client using your API key.
var apiKey =
Environment.GetEnvironmentVariable("PICSART_API_KEY") is { Length: > 0 } apiKeyValue
? apiKeyValue
: throw new AssertInconclusiveException("PICSART_API_KEY environment variable is not found.");
using var client = new PicsartClient(apiKey);
// The client provides access to all Picsart sub-APIs:
// - `client.ImageRemoveBackground` -- background removal
// - `client.ImagePhotoEnhancement` -- upscale, enhance, face enhancement
// - `client.ImageEffects` -- effects, masks, adjustments
// - `client.GenAIText2Image` -- text-to-image generation
// - `client.GenAIText2VideoImage2Video` -- text/image-to-video generation
// - `client.VideoEdit` -- video editing (trim, crop, concat)
|