Phaseo.Sdk 2.1.0

dotnet add package Phaseo.Sdk --version 2.1.0
                    
NuGet\Install-Package Phaseo.Sdk -Version 2.1.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="Phaseo.Sdk" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Phaseo.Sdk" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Phaseo.Sdk" />
                    
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 Phaseo.Sdk --version 2.1.0
                    
#r "nuget: Phaseo.Sdk, 2.1.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 Phaseo.Sdk@2.1.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=Phaseo.Sdk&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Phaseo.Sdk&version=2.1.0
                    
Install as a Cake Tool

Phaseo C# SDK

Official .NET SDK for Phaseo Gateway.

Package ID: Phaseo.Sdk

Installation

dotnet add package Phaseo.Sdk --version 2.0.5

From this monorepo:

dotnet add ./packages/sdk/sdk-csharp/Phaseo.Sdk.csproj

Quick start

using PhaseoSdk;

var client = new Phaseo(
    apiKey: Environment.GetEnvironmentVariable("PHASEO_API_KEY"),
    basePath: Environment.GetEnvironmentVariable("PHASEO_BASE_URL") ?? "https://api.phaseo.app/v1"
);

var response = await client.CreateResponse(new Dictionary<string, object>
{
    ["model"] = "google/gemma-3-27b:free",
    ["input"] = "Reply with: C# SDK works",
});

Console.WriteLine(response?["id"]);

Common methods

  • CreateResponse(...)
  • CreateChatCompletion(...)
  • ListModels(...)
  • ListOrganisations(...) for paginated /organisations discovery
  • ListPricingModels(...) for /pricing/models catalogue pricing discovery
  • CalculatePricing(...) for /pricing/calculate usage estimation
  • ListProviders(...), GetCredits(...), GetActivity(...), and GetAnalytics(...) for provider discovery and management-key usage surfaces
  • ListApiKeys(...) for management-key /keys discovery
  • CreateApiKey(...), UpdateApiKey(id, ...), and DeleteApiKey(id) for management-key API-key lifecycle changes
  • GetApiKey(id) for management-key /keys/{id} lookup
  • ListWorkspaces(...), GetWorkspace(id), CreateWorkspace(...), UpdateWorkspace(id, ...), and DeleteWorkspace(id) for management-key workspace lifecycle management
  • GetCurrentApiKey()
  • Health()
  • GetModelDeprecationInfo(modelId)
  • ValidateModel(modelId)

Model discovery supports the public /models filters, including provider, provider_status, provider_routing_status, model_routing_status, capability_status, provider_availability_status, provider_availability_reason, status, organisation, endpoints, input_types, output_types, params, availability, limit, and offset.

Use provider_availability_reason with availability = "all" when you want rollout-state entries such as preview_only, provider_not_ready, gated, access_limited, region_limited, project_limited, paused, or soft_blocked. Use capability_status with availability = "all" when you want non-routable endpoint mappings such as coming_soon or internal_testing.

var models = await client.ListModels(new Dictionary<string, string>
{
    ["provider"] = "anthropic",
    ["provider_status"] = "beta,not_ready",
    ["provider_availability_reason"] = "preview_only,provider_not_ready",
    ["capability_status"] = "coming_soon,internal_testing",
    ["availability"] = "all",
});

Async job websocket helpers

Batch and video operations can expose a websocket lifecycle stream at /v1/async/{kind}/{id}/ws.

var batchSocketUrl = client.GetBatchWebSocketUrl("batch_123", intervalMs: 1500);
var videoSocketUrl = client.GetVideoWebSocketUrl("video_123", closeOnTerminal: true);
var genericSocketUrl = client.GetAsyncJobWebSocketUrl("video", "video_123");
var resourceSocketUrl = client.AsyncJobs.WebSocketUrl("video", "video_123");

Console.WriteLine(batchSocketUrl);
Console.WriteLine(videoSocketUrl);
Console.WriteLine(genericSocketUrl);
Console.WriteLine(resourceSocketUrl);

Free and paid models

  • Models with :free in the model ID can be called with zero deposited credits.
  • Paid models require available wallet balance.

Environment variables

  • PHASEO_API_KEY (required unless passed in code)
  • PHASEO_BASE_URL (optional, defaults to https://api.phaseo.app/v1)

Regeneration and local checks

  • Regenerate generated client: pnpm openapi:gen:csharp
  • Build: pnpm --filter @phaseo/csharp-sdk build
  • Test: pnpm --filter @phaseo/csharp-sdk test
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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Phaseo.Sdk:

Package Downloads
Phaseo.AgentSdk

Official Phaseo Agent SDK for .NET.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 2,452 7/26/2026