Skip to content

Repository files navigation

billy-sdk

billy-sdk

The easiest AI SDK for Node.js
Generate, modify, validate, analyze, extract, and execute with natural language prompts.

npm version npm downloads License Node version CI Docs


Documentation

Full documentation is available at:

Includes guides for installation, providers, methods, type conversion, CLI, and use cases.


Quick Start

npm install billy-sdk
import billy from "billy-sdk";

const IA = billy();

await IA.create("genera 10 preguntas sobre la biblia");
console.log(IA.results);

Features

🤖 Multi-Provider Groq (default, free), OpenAI, Anthropic — no vendor lock-in
🔄 Type Conversion Automatic parsing to number, array, object, boolean, JSON
🧠 Built-in Memory billy({ memory: 10 }) — automatic conversation history
⛓️ Method Chaining IA.asNumber().short().create("prompt")
🔌 Variable Injection create("prompt {{var}}", { var: value })
📡 Streaming IA.stream() — consume responses in real time
📁 File & Image Handling Extract text from PDFs and images automatically
🛠️ Tool Calling Let the AI call your own functions
⚡ CLI npx billy-sdk config set <key>
🛡️ Retry & Timeout Built-in, configurable

One-Minute Setup

# 1. Install
npm install billy-sdk

# 2. Set API key (Groq is free → https://console.groq.com)
#    Option A: Environment variable (recommended)
export GROQ_API_KEY=gsk_your_key

#    Option B: CLI (saves to ~/.billy-sdk/config.json)
npx billy-sdk config set gsk_your_key

# 3. Use it
echo 'import billy from "billy-sdk"; const IA = billy(); console.log(await IA.create("hola"));' | node

Examples

See the examples/ directory for 18 runnable scripts: invoice extraction, ticket classification, NL-to-SQL, chatbot, sentiment analysis, email generator, summarizer, content moderation, test data generation, and basic RAG.

Requirements

  • Node.js >= 18
  • Internet connection
  • API key (Groq offers a free tier)

License

MIT

About

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages