Skip to content

Topaz

Modern .NET SDK for Topaz generated from the provider's OpenAPI definition with AutoSDK.

Nuget package dotnet License: MIT Discord

Generated from the source spec

Built from Topaz Labs' official OpenAPI definitions (Image + Video) so the SDK stays close to the upstream API surface.

Auto-updated

Designed for fast regeneration and low-friction updates when the upstream API changes without breaking compatibility.

Modern .NET

Targets current .NET practices including nullability, trimming, NativeAOT awareness, and source-generated serialization.

Docs from examples

Examples stay in sync between the README, MkDocs site, and integration tests through the AutoSDK docs pipeline.

Usage

1
2
3
using Topaz;

using var client = new TopazClient(apiKey);

Client Creation

Basic example showing how to create a Topaz Labs client.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Create a Topaz Labs client using your API key.
// Get one at https://www.topazlabs.com/api.

var apiKey =
    Environment.GetEnvironmentVariable("TOPAZ_API_KEY") is { Length: > 0 } apiKeyValue
        ? apiKeyValue
        : throw new AssertInconclusiveException("TOPAZ_API_KEY environment variable is not found.");

using var client = new TopazClient(apiKey);

// The client exposes organized sub-clients covering both the Image and Video APIs:
// Image-side:
// - `client.Enhance` -- upscale / enhance images (precision + generative)
// - `client.Sharpen` -- specialized sharpening
// - `client.Denoise` -- noise reduction
// - `client.Restore` -- generative restoration
// - `client.Lighting` -- exposure / color correction
// - `client.Matting` -- background segmentation
// - `client.Tool` -- specialized tools (transparent upscale, etc.)
// - `client.Estimate` -- estimate credits/time before running a job
// - `client.ImageStatus` / `client.Download` / `client.Cancel` -- manage async jobs
// Video-side:
// - `client.CreateRequest` / `client.CreateExpressRequest` -- kick off a video job
// - `client.AcceptRequest` / `client.CompleteUpload` -- multipart upload workflow
// - `client.GetRequestStatus` / `client.GetRequestMetrics` / `client.GetRequestHistory`
// - `client.CancelRequest` / `client.DeleteFiles`
// - `client.VideoStatus` -- video cloud system status

MEAI Tools

Example showing how to create MEAI AIFunction tools from the Topaz client.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Create AIFunction tools from the Topaz client for use with any `IChatClient`.

var apiKey =
    Environment.GetEnvironmentVariable("TOPAZ_API_KEY") is { Length: > 0 } apiKeyValue
        ? apiKeyValue
        : throw new AssertInconclusiveException("TOPAZ_API_KEY environment variable is not found.");

using var client = new TopazClient(apiKey);

// Create tools that wrap the core async-job workflow:
var enhanceImageTool = client.AsEnhanceImageTool();
var getImageStatusTool = client.AsGetImageStatusTool();
var downloadImageResultTool = client.AsDownloadImageResultTool();
var getVideoStatusTool = client.AsGetVideoStatusTool();

// Wire them up to an IChatClient:
// ```csharp
// var options = new ChatOptions
// {
//     Tools = [enhanceImageTool, getImageStatusTool, downloadImageResultTool, getVideoStatusTool],
// };
// ```

Support

Bugs

Open an issue in tryAGI/Topaz.

Ideas and questions

Use GitHub Discussions for design questions and usage help.

Community

Join the tryAGI Discord for broader discussion across SDKs.

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.