CoraxAi.ApiClient 2.349.0

dotnet add package CoraxAi.ApiClient --version 2.349.0
                    
NuGet\Install-Package CoraxAi.ApiClient -Version 2.349.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CoraxAi.ApiClient" Version="2.349.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoraxAi.ApiClient" Version="2.349.0" />
                    
Directory.Packages.props
<PackageReference Include="CoraxAi.ApiClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CoraxAi.ApiClient --version 2.349.0
                    
#r "nuget: CoraxAi.ApiClient, 2.349.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CoraxAi.ApiClient@2.349.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CoraxAi.ApiClient&version=2.349.0
                    
Install as a Cake Addin
#tool nuget:?package=CoraxAi.ApiClient&version=2.349.0
                    
Install as a Cake Tool

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)));

This package is generated; please report problems against the corax-ai-client repository rather than editing the sources directly.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed