ContentTrue SDK for Elixir

contenttrue_sdk is the official Elixir SDK for the ContentTrue AIGC detection API. It helps developers submit long-form text and retrieve machine generation probability scores from automated detection endpoints.

The package is intentionally lightweight:

Installation

Add the dependency to your mix.exs:

def deps do
  [
    {:contenttrue_sdk, "~> 0.1.0"}
  ]
end

Then fetch dependencies:

mix deps.get

Quick Start

client =
  ContenttrueSDK.new(
    api_key: System.fetch_env!("CONTENTTRUE_API_KEY")
  )

{:ok, response} =
  ContenttrueSDK.score_text(client, "This is the long text you want to inspect.")

response.status
response.body

Built-In Helpers

Score a single text input:

ContenttrueSDK.score_text(client, "Evaluate whether this content looks AI-generated.")

Submit a richer detection payload:

ContenttrueSDK.score_document(client, %{
  text: "Long form content",
  language: "en",
  metadata: %{source: "editor"}
})

Batch score multiple texts:

ContenttrueSDK.batch_score_texts(client, [
  "First article body",
  "Second article body"
])

Configuration

The client accepts these options:

Generic Requests

You can still call lower-level helpers for endpoints not yet wrapped:

ContenttrueSDK.get(client, "/v1/usage")
ContenttrueSDK.request(client, :post, "/v1/detections/custom", body: %{text: "Sample"})

Publishing Notes

Before the next public release, update these items:

Official Links

License

MIT