Skip to content

Writesonic

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official Writesonic 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

Usage

1
2
3
using Writesonic;

using var client = new WritesonicClient(apiKey);

ChatSonic

Basic example showing how to use the ChatSonic conversational AI chatbot.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
using var client = new WritesonicClient(apiKey);

// Send a question to ChatSonic with Google search integration:
var response = await client.ChatSonicAsync(
    engine: ChatSonicEngine.Premium,
    language: ChatSonicLanguage.En,
    numCopies: 1,
    request: new ChatSonicRequest
    {
        InputText = "What is Writesonic?",
        EnableGoogleResults = true,
        EnableMemory = false,
    });

Image Generation

Example showing how to generate images with Photosonic.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
using var client = new WritesonicClient(apiKey);

// Generate an image from a text description:
var response = await client.GenerateImageAsync(
    request: new GenerateImageRequest
    {
        Prompt = "A futuristic city skyline at sunset with flying cars",
        NumImages = 1,
        ImageWidth = 512,
        ImageHeight = 512,
    });

Support

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

Acknowledgments

JetBrains logo

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