Cloudinary.Analysis
0.1.0
dotnet add package Cloudinary.Analysis --version 0.1.0
NuGet\Install-Package Cloudinary.Analysis -Version 0.1.0
<PackageReference Include="Cloudinary.Analysis" Version="0.1.0" />
<PackageVersion Include="Cloudinary.Analysis" Version="0.1.0" />
<PackageReference Include="Cloudinary.Analysis" />
paket add Cloudinary.Analysis --version 0.1.0
#r "nuget: Cloudinary.Analysis, 0.1.0"
#addin nuget:?package=Cloudinary.Analysis&version=0.1.0
#tool nuget:?package=Cloudinary.Analysis&version=0.1.0
Cloudinary Analysis .NET SDK
SDK Example Usage
Example
using Cloudinary.Analysis;
using Cloudinary.Analysis.Models.Components;
using System.Collections.Generic;
var sdk = new CloudinaryAnalysis(security: new Security() {
CloudinaryAuth = new SchemeCloudinaryAuth() {
ApiKey = "CLOUDINARY_API_KEY",
ApiSecret = "CLOUDINARY_API_SECRET",
},
});
AnalyzeAIVisionGeneralRequest req = new AnalyzeAIVisionGeneralRequest() {
Source = Source.CreateUri(
new Models.Components.Uri() {
Uri = "https://res.cloudinary.com/demo/image/upload/sample.jpg",
}
),
NotificationUrl = "https://path.to/webhook",
Prompts = new List<string>() {
"Please describe this image in detail",
"Does this image contain an animal?",
},
};
var res = await sdk.Analyze.AiVisionGeneralAsync(req);
// handle response
Server Selection
Server Variables
The default server https://api.cloudinary.com/v2/analysis/{cloud_name}
contains variables and is set to https://api.cloudinary.com/v2/analysis/CLOUD_NAME
by default. To override default values, the following parameters are available when initializing the SDK client instance:
Variable | Parameter | Default | Description |
---|---|---|---|
cloud_name |
cloudName: string |
"CLOUD_NAME" |
Your Cloud Name. |
Example
using Cloudinary.Analysis;
using Cloudinary.Analysis.Models.Components;
using System.Collections.Generic;
var sdk = new CloudinaryAnalysis(
cloudName: "<value>",
security: new Security() {
CloudinaryAuth = new SchemeCloudinaryAuth() {
ApiKey = "CLOUDINARY_API_KEY",
ApiSecret = "CLOUDINARY_API_SECRET",
},
}
);
AnalyzeAIVisionGeneralRequest req = new AnalyzeAIVisionGeneralRequest() {
Source = Source.CreateUri(
new Models.Components.Uri() {
Uri = "https://res.cloudinary.com/demo/image/upload/sample.jpg",
}
),
NotificationUrl = "https://path.to/webhook",
Prompts = new List<string>() {
"Please describe this image in detail",
"Does this image contain an animal?",
},
};
var res = await sdk.Analyze.AiVisionGeneralAsync(req);
// handle response
Override Server URL Per-Client
The default server can be overridden globally by passing a URL to the serverUrl: string
optional parameter when initializing the SDK client instance. For example:
using Cloudinary.Analysis;
using Cloudinary.Analysis.Models.Components;
using System.Collections.Generic;
var sdk = new CloudinaryAnalysis(
serverUrl: "https://api.cloudinary.com/v2/analysis/CLOUD_NAME",
security: new Security() {
CloudinaryAuth = new SchemeCloudinaryAuth() {
ApiKey = "CLOUDINARY_API_KEY",
ApiSecret = "CLOUDINARY_API_SECRET",
},
}
);
AnalyzeAIVisionGeneralRequest req = new AnalyzeAIVisionGeneralRequest() {
Source = Source.CreateUri(
new Models.Components.Uri() {
Uri = "https://res.cloudinary.com/demo/image/upload/sample.jpg",
}
),
NotificationUrl = "https://path.to/webhook",
Prompts = new List<string>() {
"Please describe this image in detail",
"Does this image contain an animal?",
},
};
var res = await sdk.Analyze.AiVisionGeneralAsync(req);
// handle response
Authentication
Per-Client Security Schemes
This SDK supports the following security schemes globally:
Name | Type | Scheme |
---|---|---|
CloudinaryAuth |
http | Custom HTTP |
OAuth2 |
oauth2 | OAuth2 token |
You can set the security parameters through the security
optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
using Cloudinary.Analysis;
using Cloudinary.Analysis.Models.Components;
using System.Collections.Generic;
var sdk = new CloudinaryAnalysis(security: new Security() {
CloudinaryAuth = new SchemeCloudinaryAuth() {
ApiKey = "CLOUDINARY_API_KEY",
ApiSecret = "CLOUDINARY_API_SECRET",
},
});
AnalyzeAIVisionGeneralRequest req = new AnalyzeAIVisionGeneralRequest() {
Source = Source.CreateUri(
new Models.Components.Uri() {
Uri = "https://res.cloudinary.com/demo/image/upload/sample.jpg",
}
),
NotificationUrl = "https://path.to/webhook",
Prompts = new List<string>() {
"Please describe this image in detail",
"Does this image contain an animal?",
},
};
var res = await sdk.Analyze.AiVisionGeneralAsync(req);
// handle response
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
By default, an API error will raise a Cloudinary.Analysis.Models.Errors.APIException
exception, which has the following properties:
Property | Type | Description |
---|---|---|
Message |
string | The error message |
Request |
HttpRequestMessage | The HTTP request |
Response |
HttpResponseMessage | The HTTP response |
When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the AiVisionGeneralAsync
method throws the following exceptions:
Error Type | Status Code | Content Type |
---|---|---|
Cloudinary.Analysis.Models.Errors.ErrorResponse | 400, 401, 403, 404 | application/json |
Cloudinary.Analysis.Models.Errors.RateLimitedResponse | 429 | application/json |
Cloudinary.Analysis.Models.Errors.ErrorResponse | 500 | application/json |
Cloudinary.Analysis.Models.Errors.APIException | 4XX, 5XX | */* |
Example
using Cloudinary.Analysis;
using Cloudinary.Analysis.Models.Components;
using Cloudinary.Analysis.Models.Errors;
using System.Collections.Generic;
var sdk = new CloudinaryAnalysis(security: new Security() {
CloudinaryAuth = new SchemeCloudinaryAuth() {
ApiKey = "CLOUDINARY_API_KEY",
ApiSecret = "CLOUDINARY_API_SECRET",
},
});
try
{
AnalyzeAIVisionGeneralRequest req = new AnalyzeAIVisionGeneralRequest() {
Source = Source.CreateUri(
new Models.Components.Uri() {
Uri = "https://res.cloudinary.com/demo/image/upload/sample.jpg",
}
),
NotificationUrl = "https://path.to/webhook",
Prompts = new List<string>() {
"Please describe this image in detail",
"Does this image contain an animal?",
},
};
var res = await sdk.Analyze.AiVisionGeneralAsync(req);
// handle response
}
catch (Exception ex)
{
if (ex is ErrorResponse)
{
// Handle exception data
throw;
}
else if (ex is RateLimitedResponse)
{
// Handle exception data
throw;
}
else if (ex is ErrorResponse)
{
// Handle exception data
throw;
}
else if (ex is Cloudinary.Analysis.Models.Errors.APIException)
{
// Handle default exception
throw;
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- newtonsoft.json (>= 13.0.3)
- nodatime (>= 3.1.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.1.0 | 140 | 5/19/2025 |