Augustus.AI 0.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Augustus.AI --version 0.2.2
                    
NuGet\Install-Package Augustus.AI -Version 0.2.2
                    
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="Augustus.AI" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Augustus.AI" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="Augustus.AI" />
                    
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 Augustus.AI --version 0.2.2
                    
#r "nuget: Augustus.AI, 0.2.2"
                    
#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 Augustus.AI@0.2.2
                    
#: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=Augustus.AI&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=Augustus.AI&version=0.2.2
                    
Install as a Cake Tool

Augustus.AI ๐Ÿค–

An AI-powered API simulator library for .NET that generates realistic mock responses using OpenAI, with intelligent caching for test frameworks.

NuGet NuGet Downloads .NET License

๐ŸŒŸ Features

  • AI-Powered Responses: Uses OpenAI to generate realistic API responses based on your instructions
  • Intelligent Caching: Automatically caches generated responses in JSON files for faster subsequent calls
  • Multi-Framework Support: Works with xUnit, NUnit, and MSTest
  • Easy Integration: Simple fluent API for quick setup in your tests
  • Configurable: Customizable OpenAI models, caching options, and ports
  • Multiple .NET Versions: Supports .NET 6.0, 7.0, 8.0, 9.0, and 10.0

๐Ÿš€ Quick Start

Installation

dotnet add package Augustus.AI

Basic Usage

using Augustus.Extensions;

public class ApiTests
{
    [Fact]
    public async Task Should_Return_Customer_Data()
    {
        // Arrange
        var simulator = this.CreateStripeSimulator(options => 
        {
            options.OpenAIApiKey = "your-openai-api-key";
            options.EnableCaching = true;
        })
        .WithInstruction("Customer cus_123 exists with name 'John Doe'")
        .WithInstruction("Customer has email john.doe@example.com");

        await simulator.StartAsync();

        // Act
        var client = simulator.CreateClient();
        var response = await client.GetAsync("/v1/customers/cus_123");

        // Assert
        response.StatusCode.Should().Be(HttpStatusCode.OK);
        var content = await response.Content.ReadAsStringAsync();
        content.Should().Contain("John Doe");
        
        await simulator.StopAsync();
    }
}

๐Ÿ“– Documentation

Configuration Options

var options = new APISimulatorOptions
{
    OpenAIApiKey = "your-api-key",           // Required: Your OpenAI API key
    OpenAIEndpoint = "",                     // Optional: Custom OpenAI endpoint
    OpenAIModel = "gpt-5-mini",              // Optional: Model to use (default: gpt-5-mini)
    EnableCaching = true,                    // Optional: Enable response caching (default: true)
    CacheFolderPath = "./mocks",             // Optional: Cache folder path (default: ./mocks)
    Port = 9001                              // Optional: Simulator port (default: 9001)
};

Extension Methods

Augustus provides convenient extension methods for popular APIs:

// Pre-configured simulators
var stripeSimulator = this.CreateStripeSimulator();
var paypalSimulator = this.CreatePayPalSimulator();
var twilioSimulator = this.CreateTwilioSimulator();
var slackSimulator = this.CreateSlackSimulator();

// Generic simulator
var customSimulator = this.CreateAPISimulator("MyAPI");

Fluent API

Chain methods for clean, readable test setup:

var simulator = this.CreateAPISimulator("GitHub")
    .WithInstruction("Repository octocat/Hello-World exists")
    .WithInstruction("It has 1000 stars and 500 forks")
    .WithInstructions(
        "Return realistic GitHub API responses",
        "Include proper JSON structure",
        "Use appropriate HTTP status codes"
    );

await simulator.StartSimulatorAsync(); // Extension method

๐Ÿงช Test Framework Examples

xUnit

using Augustus.Extensions;

public class StripeTests
{
    [Fact]
    public async Task Customer_Should_Exist()
    {
        var simulator = this.CreateStripeSimulator(options => 
        {
            options.OpenAIApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
        });

        // Test implementation...
    }
}

NUnit

using Augustus.Extensions;
using NUnit.Framework;

[TestFixture]
public class GitHubTests
{
    private APISimulator simulator;

    [SetUp]
    public void Setup()
    {
        simulator = this.CreateAPISimulator("GitHub", options => 
        {
            options.OpenAIApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
            options.Port = 9002;
        });
    }

    [TearDown]
    public async Task TearDown()
    {
        await simulator?.StopAsync();
    }

    [Test]
    public async Task Repository_Should_Return_Data()
    {
        // Test implementation...
    }
}

MSTest

using Augustus.Extensions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class SlackTests
{
    private APISimulator simulator;

    [TestInitialize]
    public void Initialize()
    {
        simulator = this.CreateSlackSimulator(options => 
        {
            options.OpenAIApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY");
            options.Port = 9003;
        });
    }

    [TestCleanup]
    public async Task Cleanup()
    {
        await simulator?.StopAsync();
    }

    [TestMethod]
    public async Task Message_Should_Post_Successfully()
    {
        // Test implementation...
    }
}

๐Ÿ“ Caching System

Augustus automatically caches AI-generated responses in JSON files:

{
  "RequestHash": "A1B2C3D4E5F6G7H8",
  "Response": "{\\"id\\": \\"cus_123\\", \\"name\\": \\"John Doe\\"}",
  "OriginalRequest": "curl -X GET http://localhost:9001/v1/customers/cus_123",
  "Instructions": [
    "You are a Stripe API simulator",
    "Customer cus_123 exists with name 'John Doe'"
  ],
  "Timestamp": "2024-01-15T10:30:00Z"
}

Cache Management

// Clear all cached responses
simulator.ClearCache();

// Disable caching for a specific test
var simulator = this.CreateAPISimulator("MyAPI", options => 
{
    options.EnableCaching = false;
});

๐Ÿ”ง Advanced Usage

Custom Instructions

Provide detailed instructions to get better AI responses:

simulator
    .WithInstruction("You are simulating a payment processing API")
    .WithInstruction("All payments should have a unique transaction ID")
    .WithInstruction("Use realistic credit card data (test cards only)")
    .WithInstruction("Return proper HTTP status codes (200 for success, 400 for invalid data)")
    .WithInstruction("Include timestamps in ISO 8601 format")
    .WithInstruction("Payment amounts should be in cents (e.g., 2000 = $20.00)");

Environment Variables

Set up your OpenAI API key using environment variables:

# Windows
set OPENAI_API_KEY=your-api-key-here

# Linux/macOS
export OPENAI_API_KEY=your-api-key-here
var simulator = this.CreateAPISimulator("MyAPI", options => 
{
    options.OpenAIApiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY") 
        ?? throw new InvalidOperationException("OPENAI_API_KEY environment variable is required");
});

๐Ÿ“ฆ Releases

Augustus is automatically published to NuGet.org when a new GitHub release is created.

For Users

Visit Augustus.AI on NuGet.org to see the latest versions and release notes.

For Contributors

See .github/RELEASE.md for detailed information on:

  • How releases are automated
  • Version numbering conventions
  • How to create a new release

๐Ÿ› ๏ธ Building from Source

  1. Clone the repository
  2. Ensure you have .NET 8.0+ SDK installed (supports .NET 6.0 through 10.0)
  3. Run the tests:
dotnet test
  1. Build the package:
dotnet pack

๐Ÿ“ Best Practices

  1. Use Environment Variables: Store your OpenAI API key in environment variables, not in code
  2. Enable Caching: Keep caching enabled for faster test execution and reduced API costs
  3. Specific Instructions: Provide detailed, specific instructions for better AI responses
  4. Unique Ports: Use different ports for different test classes to avoid conflicts
  5. Cleanup Resources: Always call StopAsync() in test cleanup methods

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ› Support

If you encounter any issues or have questions:

  1. Check the documentation
  2. Search existing issues
  3. Create a new issue if needed

๐ŸŽฏ Roadmap

  • Support for more AI providers (Anthropic Claude, Google Gemini)
  • Request/Response validation
  • Performance metrics and analytics
  • Docker support
  • Integration with popular API testing tools

Made with โค๏ธ for the .NET testing community

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on Augustus.AI:

Package Downloads
Augustus.AI.Reqnroll

Reqnroll integration for Augustus API simulator. Automatically places mock caches next to feature files and organizes by scenario.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 182 3/28/2026
0.7.0 96 3/23/2026
0.6.0 80 3/22/2026
0.5.2 79 3/22/2026
0.5.1 95 3/20/2026
0.4.0 116 3/16/2026
0.3.0 110 3/15/2026
0.2.4 114 3/14/2026
0.2.3 86 3/13/2026
0.2.2 86 3/11/2026
0.2.1 112 3/7/2026
0.2.0 104 3/2/2026
0.1.1 105 12/29/2025