CoraxAi.ApiClient
2.349.0
dotnet add package CoraxAi.ApiClient --version 2.349.0
NuGet\Install-Package CoraxAi.ApiClient -Version 2.349.0
<PackageReference Include="CoraxAi.ApiClient" Version="2.349.0" />
<PackageVersion Include="CoraxAi.ApiClient" Version="2.349.0" />
<PackageReference Include="CoraxAi.ApiClient" />
paket add CoraxAi.ApiClient --version 2.349.0
#r "nuget: CoraxAi.ApiClient, 2.349.0"
#:package CoraxAi.ApiClient@2.349.0
#addin nuget:?package=CoraxAi.ApiClient&version=2.349.0
#tool nuget:?package=CoraxAi.ApiClient&version=2.349.0
Corax AI API Client
Official .NET client for the Corax API, generated from the Corax OpenAPI specification.
The package version tracks the Corax API version it was generated from, so
CoraxAi.ApiClient 2.321.0 targets Corax API v2.321.0.
Install
dotnet add package CoraxAi.ApiClient
Requires .NET 8 or later. The package ships both a net8.0 and a net10.0 build, so
.NET 10 apps get assemblies and dependencies built for .NET 10. .NET 9 apps resolve the
net8.0 build.
Getting started
The client integrates with Microsoft.Extensions.DependencyInjection. Register it once, then
inject the API interface you need.
using CoraxAi.ApiClient.Api;
using CoraxAi.ApiClient.Client;
using CoraxAi.ApiClient.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
var host = Host.CreateDefaultBuilder(args)
.ConfigureApi((context, options) =>
{
// Pass an empty prefix: ApiKeyToken defaults to "Bearer ", which is not
// what the X-API-Key header expects.
options.AddTokens(new ApiKeyToken(
Environment.GetEnvironmentVariable("CORAX_API_KEY")!,
ClientUtils.ApiKeyHeader.X_API_Key,
prefix: ""));
// The Corax API declares both API-key and bearer security schemes, so every API
// class takes a provider for each. Register both even when only one is used.
options.AddTokens(new BearerToken(string.Empty));
// The OpenAPI specification ships no server list, so the base address is always
// your Corax deployment's URL.
options.AddApiHttpClients(client =>
client.BaseAddress = new Uri(Environment.GetEnvironmentVariable("CORAX_BASE_URL")!));
})
.Build();
var projects = host.Services.GetRequiredService<IProjectsApi>();
var response = await projects.ListProjectsAsync(page: 1, size: 20);
foreach (var project in response.Ok()?.Embedded ?? [])
Console.WriteLine(project.Name);
Paged responses follow HAL: the items are on Embedded, with paging metadata on Page.
To authenticate with a bearer token instead, give BearerToken the real value and leave the
API key empty:
options.AddTokens(new BearerToken(accessToken));
options.AddTokens(new ApiKeyToken(string.Empty, ClientUtils.ApiKeyHeader.X_API_Key, prefix: ""));
Responses
Each operation has two forms:
| Call | On a non-success status |
|---|---|
ListProjectsAsync(...) |
returns a response object; inspect IsOk / StatusCode |
ListProjectsOrDefaultAsync(...) |
returns null |
Ok() returns the deserialized success payload, or null if the response was not a success.
var response = await projects.ListProjectsAsync();
if (!response.IsOk)
{
Console.Error.WriteLine($"{(int)response.StatusCode} {response.ReasonPhrase}");
return;
}
var page = response.Ok()!;
Retries and timeouts
AddApiHttpClients exposes the IHttpClientBuilder, so Polly policies attach as usual:
options.AddApiHttpClients(
client => client.BaseAddress = new Uri("https://api.corax.ai"),
builder => builder
.AddRetryPolicy(2)
.AddTimeoutPolicy(TimeSpan.FromSeconds(5))
.AddCircuitBreakerPolicy(10, TimeSpan.FromSeconds(30)));
Links
- Source and issues
- Release notes
- TypeScript client:
@coraxai/api-client
This package is generated; please report problems against the corax-ai-client repository rather than editing the sources directly.
| 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 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Hosting (>= 10.0.1)
- Microsoft.Extensions.Http (>= 10.0.1)
- Microsoft.Extensions.Http.Polly (>= 10.0.1)
- Microsoft.Net.Http.Headers (>= 10.0.1)
-
net8.0
- Microsoft.Extensions.Hosting (>= 8.0.1)
- Microsoft.Extensions.Http (>= 8.0.1)
- Microsoft.Extensions.Http.Polly (>= 8.0.20)
- Microsoft.Net.Http.Headers (>= 8.0.17)
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 |
|---|---|---|
| 2.349.0 | 0 | 10/6/2026 |
| 2.348.0 | 43 | 10/5/2026 |
| 2.347.0 | 45 | 10/5/2026 |
| 2.346.0 | 50 | 10/5/2026 |
| 2.345.0 | 47 | 10/5/2026 |
| 2.344.0 | 55 | 10/2/2026 |
| 2.343.0 | 51 | 10/2/2026 |
| 2.342.0 | 53 | 10/1/2026 |
| 2.341.0 | 86 | 9/28/2026 |
| 2.340.0 | 91 | 9/25/2026 |
| 2.339.0 | 91 | 9/25/2026 |
| 2.338.0 | 87 | 9/24/2026 |
| 2.337.0 | 87 | 9/24/2026 |
| 2.336.0 | 89 | 9/24/2026 |
| 2.335.0 | 89 | 9/23/2026 |
| 2.334.0 | 88 | 9/23/2026 |
| 2.333.0 | 91 | 9/23/2026 |
| 2.332.0 | 92 | 9/22/2026 |
| 2.331.0 | 90 | 9/21/2026 |
| 2.330.0 | 97 | 9/17/2026 |