Skip to Content
Getting StartedQuickstart

Quickstart

Welcome to Trunkate AI. This guide will get you from zero to your first prompt reduction in under 5 minutes.

Prerequisites

Before we begin, ensure you have the following:

  • A GitHub or Google account (for Dashboard access).
  • Node.js v18+ or Python 3.9+ installed.

Get your API Key

All interactions with the Trunkate AI API require a secure API key.

  1. Log in to the Trunkate AI Dashboard .
  2. Navigate to Settings > API Keys.
  3. Click “Generate New Key”.
  4. Copy the key immediately (it is only shown once).

WARNING

Your API key carries your financial identity. Never commit it to a public repository. Use .env files.

Install the SDK

We provide native bindings for TypeScript and Python.

npm install @trunkate/sdk

The “Hello World” of Prompt Optimization

Let’s optimize a Prompt. Instead of sending verbose instructions to the LLM, we will use Trunkate AI to shrink it down.

import { Trunkate } from '@trunkate/sdk'; const client = new Trunkate({ apiKey: process.env.TRUNKATE_API_KEY, budget: 500 // Target max token budget }); async function main() { // 1. Define your long prompt const prompt = "Please kindly summarize the following article in order to help me understand the main core concepts in a very detailed manner..."; // 2. Optimize const { text, stats } = await client.optimize(prompt); console.log("⚡ Optimized Result:", text); console.log("📉 Reduced by:", stats.reduction + "%"); } main();

Next Steps

Now that you’ve run your first optimization, learn how to refine the output further.

Last updated on