Coze 0.0.0-dev.15

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

Coze

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official Coze OpenAPI specification using AutoSDK
  • Same day update to support new features
  • Updated and supported automatically if there are no breaking changes
  • All modern .NET features - nullability, trimming, NativeAOT, etc.
  • Support .Net Framework/.Net Standard 2.0
  • Microsoft.Extensions.AI IChatClient support for bot-based chat

Usage

using Coze;

using var client = new CozeClient(apiKey);

Microsoft.Extensions.AI

The SDK implements IChatClient:

using Coze;
using Microsoft.Extensions.AI;

var botId = Environment.GetEnvironmentVariable("COZE_BOT_ID")!;

IChatClient chatClient = new CozeClient(apiKey)
    .WithBotId(botId)
    .WithUserId("demo-user");

var response = await chatClient.GetResponseAsync(
    [new ChatMessage(ChatRole.User, "Reply with only the word ok.")]);

Console.WriteLine(response.Text);

Coze chat is bot-centric. You must provide a bot_id via WithBotId(...), ChatOptions.ModelId, or ChatOptions.AdditionalProperties["bot_id"].

Generate

Basic example showing how to create a client and make a request.

using var client = new CozeClient(apiKey);

Bots

Examples of listing published bots in a workspace.

// To list bots, you need a workspace (space) ID. You can find your workspace ID
// in the Coze dashboard URL when viewing your workspace.
var workspaceId =
    Environment.GetEnvironmentVariable("COZE_WORKSPACE_ID") is { Length: > 0 } value
        ? value
        : throw new AssertInconclusiveException("COZE_WORKSPACE_ID environment variable is not found.");

using var client = new CozeClient(apiKey);

// List published bots in the workspace using `GetSpacePublishedBotsListAsync`.
// This returns bots that have been published and are available for use.
var response = await client.GetSpacePublishedBotsListAsync(
    spaceId: workspaceId,
    pageSize: 10);

// The response contains a `Code` field (0 means success) and a `Data` field
// with the list of bots and total count.

// Each bot in the list has a `BotId`, `BotName`, and optional `Description`.
if (response.Data.SpaceBots is { Count: > 0 } bots)
{
    var firstBot = bots[0];

    Console.WriteLine($"First bot: {firstBot.BotName} (ID: {firstBot.BotId})");
}

Workflows

Examples of listing workflows in a workspace.

// To list workflows, you need a workspace ID. You can find your workspace ID
// in the Coze dashboard URL when viewing your workspace.
var workspaceId =
    Environment.GetEnvironmentVariable("COZE_WORKSPACE_ID") is { Length: > 0 } value
        ? value
        : throw new AssertInconclusiveException("COZE_WORKSPACE_ID environment variable is not found.");

using var client = new CozeClient(apiKey);

// List workflows in the workspace using `OpenAPIGetWorkflowListAsync`.
// The `pageNum` parameter starts at 1 (one-based pagination).
var response = await client.OpenAPIGetWorkflowListAsync(
    workspaceId: workspaceId,
    pageNum: 1,
    pageSize: 10);

// The response contains a `Code` field (0 means success) and a `Data` field
// with the workflow items and pagination info.

// Each workflow has a `WorkflowId`, `WorkflowName`, and optional `Description`.
foreach (var workflow in response.Data.Items)
{
    Console.WriteLine($"Workflow: {workflow.WorkflowName} (ID: {workflow.WorkflowId})");
}

Console.WriteLine($"Has more: {response.Data.HasMore}");

Support

Priority place for bugs: https://github.com/tryAGI/Coze/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Coze/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

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

Product Compatible and additional computed target framework versions.
.NET 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
0.0.0-dev.15 29 4/1/2026
0.0.0-dev.14 27 4/1/2026
0.0.0-dev.13 41 3/29/2026
0.0.0-dev.9 132 3/28/2026
0.0.0-dev.7 44 3/28/2026
0.0.0-dev.6 32 3/28/2026
0.0.0-dev.5 37 3/28/2026
0.0.0-dev.4 37 3/28/2026
0.0.0-dev.3 41 3/28/2026
0.0.0-dev 41 3/28/2026