Skip to content

Quick Start

This guide will have you translating text in under 5 minutes.

Prerequisites

You'll need:

  • A modern web browser (Chrome 90+, Firefox 88+, Safari 15+, Edge 90+)
  • OR Node.js 18+ / Python 3.9+ for CLI/SDK usage

Step 1: Get Your API Key

  1. Visit pauhu.ai
  2. Click Get Started or Sign Up
  3. Create your account (email + password, or SSO)
  4. Your API key will be shown in the dashboard
# Install the CLI
npm install -g @pauhu/cli

# Login (opens browser for authentication)
pauhu auth login

# Your API key is now stored securely
pauhu auth status

Step 2: Translate Your First Text

  1. Open pauhu.ai
  2. Type or paste text in the input area
  3. Select source language (or auto-detect)
  4. Select target language
  5. Click Translate

Your translation appears instantly. That's it!

# Translate text directly
pauhu translate "Hello, world!" --to fi

# Output: Hei, maailma!
# Translate a file
pauhu translate document.txt --to sv --output document_sv.txt
from pauhu import Pauhu

# Initialize client
client = Pauhu()  # Uses PAUHU_API_KEY env var

# Translate text
result = client.translate(
    text="Hello, world!",
    target="fi"
)

print(result.text)  # Hei, maailma!
import { Pauhu } from '@pauhu/sdk';

// Initialize client
const pauhu = new Pauhu();  // Uses PAUHU_API_KEY env var

// Translate text
const result = await pauhu.translate({
  text: 'Hello, world!',
  target: 'fi'
});

console.log(result.text);  // Hei, maailma!
curl -X POST https://api.pauhu.ai/v1/translate \
  -H "Authorization: Bearer $PAUHU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello, world!",
    "source": "en",
    "target": "fi"
  }'

Response:

{
  "text": "Hei, maailma!",
  "source": "en",
  "target": "fi",
  "confidence": 0.98,
  "model": "opus-mt-en-fi",
  "characters": 13
}

Step 3: Explore Advanced Features

Language Detection

Don't know the source language? Pauhu auto-detects it:

result = client.translate(
    text="Bonjour le monde!",
    target="en"
    # source is auto-detected
)

print(result.detected_language)  # fr
print(result.text)  # Hello, world!
curl -X POST https://api.pauhu.ai/v1/detect \
  -H "Authorization: Bearer $PAUHU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Bonjour le monde!"}'

Response:

{
  "language": "fr",
  "confidence": 0.99,
  "alternatives": [
    {"language": "fr-CA", "confidence": 0.01}
  ]
}

Batch Translation

Translate multiple texts efficiently:

results = client.translate_batch(
    texts=[
        "Hello",
        "How are you?",
        "Goodbye"
    ],
    target="fi"
)

for r in results:
    print(r.text)
# Hei
# Mitä kuuluu?
# Näkemiin
curl -X POST https://api.pauhu.ai/v1/translate/batch \
  -H "Authorization: Bearer $PAUHU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "texts": ["Hello", "How are you?", "Goodbye"],
    "target": "fi"
  }'

Document Translation

Translate entire documents (PDF, DOCX, etc.):

# Upload and translate a document
job = client.documents.translate(
    file="contract.pdf",
    target="de"
)

# Wait for completion
result = job.wait()

# Download translated document
result.download("contract_de.pdf")
# Translate a PDF document
pauhu translate contract.pdf --to de --output contract_de.pdf

# Translate multiple files
pauhu translate *.docx --to sv --output-dir translations/

Real-time Translation

For live translation (chat, streaming):

# WebSocket connection for real-time translation
async with client.realtime(target="fi") as stream:
    await stream.send("Hello")
    result = await stream.receive()
    print(result.text)  # Hei
// WebSocket for real-time translation
const stream = await pauhu.realtime({ target: 'fi' });

stream.on('translation', (result) => {
  console.log(result.text);
});

stream.send('Hello');

Step 4: Enable Offline Mode (Optional)

For offline capability, download models to your browser:

  1. Open pauhu.ai
  2. Go to SettingsOffline Mode
  3. Select language pairs to download
  4. Click Download Models

Models are stored in your browser's IndexedDB. Translation works without internet.

# Download offline models
pauhu models download en-fi en-sv en-de

# List downloaded models
pauhu models list --local

# Translate offline
pauhu translate "Hello" --to fi --offline

What's Next?

  • Full Installation Guide

    Detailed installation options for all platforms.

    Installation

  • API Reference

    Complete API documentation with all endpoints.

    API Reference

  • Translation Guide

    Advanced translation features and best practices.

    Translation Guide

  • Security & Encryption

    Learn about client-side encryption.

    Security Guide

Common Issues

Translation takes too long

For large documents, use batch translation or document API which processes in the background. Real-time translation is optimized for short texts.

Language not detected correctly

Short texts (<20 characters) may have incorrect detection. For best results:

  • Provide more context (longer text)
  • Explicitly specify source language
  • Use domain-specific models for technical content
API key not working
  1. Check key is correctly copied (no extra spaces)
  2. Verify key in dashboard at pauhu.ai/settings
  3. Check rate limits haven't been exceeded
  4. Ensure key has correct permissions
Offline mode not working
  1. Check models are fully downloaded (Settings → Offline Mode)
  2. Verify browser supports IndexedDB
  3. Ensure sufficient storage space (models can be 50-200 MB each)
  4. Try clearing browser cache and re-downloading

Get Help