Coze 0.0.0-dev.15
dotnet add package Coze --version 0.0.0-dev.15
NuGet\Install-Package Coze -Version 0.0.0-dev.15
<PackageReference Include="Coze" Version="0.0.0-dev.15" />
<PackageVersion Include="Coze" Version="0.0.0-dev.15" />
<PackageReference Include="Coze" />
paket add Coze --version 0.0.0-dev.15
#r "nuget: Coze, 0.0.0-dev.15"
#:package Coze@0.0.0-dev.15
#addin nuget:?package=Coze&version=0.0.0-dev.15&prerelease
#tool nuget:?package=Coze&version=0.0.0-dev.15&prerelease
Coze
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
IChatClientsupport 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
This project is supported by JetBrains through the Open Source Support Program.
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.AI.Abstractions (>= 10.4.1)
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 |