Developer tools

Ship the idea. Skip the ceremony.

TypeScript, Python, or your terminal. A few lines to get a decision. The rest is up to your imagination.

Before your first call

Create an API key in the console, then set it in your server or shell environment.

Environment
export MS_API_KEY="your-api-key"

TypeScript

Your labels.
Your types.

Result types follow the labels you supply. Inspect the winning label, the full score distribution, and confidence without unpacking an HTTP response.

Install
npm install @cloudraker/milliseconds

TypeScript reference
TypeScript
import { DecisionMachine } from '@cloudraker/milliseconds';

const dm = new DecisionMachine(); // reads MS_API_KEY
const result = await dm.classify('I was charged twice.', {
  billing: 'payments, invoices, charges and refunds',
  shipping: 'delivery, tracking and packages',
  account: 'login, passwords and profile settings',
});

console.log(result.label);
console.log(result.probability, result.confidence);

Python

From a notebook
to your pipeline.

Use sync or async clients for classification, extraction, and source checks. Keep your labels, schemas, and thresholds in code.

Install
pip install cloudraker-milliseconds

Python reference
Python
from milliseconds import DecisionMachine

with DecisionMachine() as dm:  # reads MS_API_KEY
    result = dm.classify('I was charged twice.', {
        'billing': 'payments, invoices, charges and refunds',
        'shipping': 'delivery, tracking and packages',
        'account': 'login, passwords and profile settings',
    })
    print(result.label)
    print(result.probability, result.confidence)

dm1 CLI

Your terminal
can make the call.

Read text from a file or a pipe. Write JSON for another program. Use exit codes to gate a script and inspect token usage on stderr.

Install
npm install -g @cloudraker/milliseconds

dm1 reference
dm1
dm1 classify "I was charged twice." \
  billing="payments, invoices, charges and refunds" \
  shipping="delivery, tracking and packages" \
  account="login, passwords and profile settings" \
  --json --usage

Keep building

The next useful link.

Take a working example into your project, then evaluate it on your own inputs.

Using an OpenAI client? The API supports JSON-schema extraction and tool-call requests through its compatibility endpoint. Read the supported request shapes.