Scrawn LogoScrawn Docs
SDK Reference

Overview

SDK reference for Scrawn functions, pricing DSL, and production patterns

Everything you need to integrate Scrawn into your application.

Configuration

scrawn() is the factory that creates your billing instance:

// scrawn/biller.ts
import { scrawn } from "@scrawn/core";
import { TAGS, EXPRESSIONS } from "./pricerefs";

export const biller = scrawn({
  apiKey: process.env.SCRAWN_KEY,
  baseURL: process.env.SCRAWN_BASE_URL,
  httpUrl: process.env.SCRAWN_HTTP_URL,
  tags: TAGS,
  expressions: EXPRESSIONS,
});

The factory accepts a single config object:

Prop

Type

Functions

The core methods you call in your code to track usage, bill AI tokens, and collect payments.

Reference & Guides

Pricing expressions, production patterns, and framework integration.