New in v0.2: Zero-Config Wins & Zero-Config AI

RelayPlane SDK

The easiest way to add AI to your app. Zero configuration, intelligent model selection, built-in examples, and automatic optimization. Get from idea to production in minutes.

Zero-Config Win

Get started in under 30 seconds. No configuration, no setup, no complexity. Just ask and get intelligent AI responses.

Install & Use
npm install @relayplane/sdk

import RelayPlane from '@relayplane/sdk';

// That's it! Zero configuration required
const result = await RelayPlane.ask("Explain quantum computing simply");
console.log(result.response.body);
console.log(result.reasoning.rationale); // See why this model was chosen

✨ Auto-Detection

Automatically discovers your API keys and selects the best model for each task

🧠 Intelligent Routing

Analyzes your prompt and routes to the optimal model with reasoning

Ready-to-Use Examples

Common AI patterns ready to use. Copy, paste, and customize for your needs.

šŸ’¬ Chatbot

const chat = await RelayPlane.examples.chatbot(
  "Hello! How can you help me?",
  {
    personality: "You are a helpful coding assistant",
    budget: "moderate"
  }
);

šŸ“„ Summarization

const summary = await RelayPlane.examples.summarize(
  longDocument,
  {
    length: "brief",
    focus: "key findings"
  }
);

šŸ” Code Review

const review = await RelayPlane.examples.codeReview(
  myCode,
  {
    language: "typescript",
    focus: "security"
  }
);

šŸŒ Translation

const translation = await RelayPlane.examples.translate(
  "Hello world",
  "Spanish",
  { tone: "formal" }
);

8+ Examples Available: chatbot, summarize, codeReview, translate, research, creativeWriting, dataAnalysis, explain, and more!

Contextual Error Handling

When things go wrong, get helpful suggestions instead of cryptic error messages.

Example Error Output
āŒ OpenAI API key not found or invalid

šŸ”§ Quick Fix:
export OPENAI_API_KEY="your_api_key_here"

šŸ’” Suggestions:
  • Add OPENAI_API_KEY to your environment variables
  • Or configure RelayPlane hosting with: RelayPlane.configure({ apiKey: "rp_your_key" })
  • Check that your API key is valid and has the right permissions
  • Verify OpenAI account has sufficient credits/quota

šŸ“š Helpful Links:
  • https://docs.relayplane.com/setup/api-keys
  • https://docs.relayplane.com/quick-start

šŸ”‘ API Key Issues

Clear guidance on setting up API keys with copy-paste solutions

⚔ Rate Limits

Automatic fallback suggestions and retry guidance

Advanced Features

Intelligent Model Selection

const result = await RelayPlane.ask(
  "Review this React component for security issues",
  {
    budget: "minimal",      // Cost optimization
    priority: "quality",    // Favor accuracy
    taskType: "coding"      // Hint for better selection
  }
);

// See the reasoning
console.log(result.reasoning.rationale);
// "Selected Claude 3.5 Sonnet because: excellent for 
//  code analysis, estimated $0.003 cost, ~1500ms response time"

console.log(result.reasoning.alternatives);
// Array of alternative model suggestions with reasons

Automatic Optimization

// Configure global optimization
RelayPlane.configure({
  defaultOptimization: {
    enabled: true,
    strategy: "balanced",
    maxRetries: 3,
    enableCache: true,
    cacheTtl: 300
  }
});

// All requests now have:
// āœ… Automatic retries with fallbacks
// āœ… Intelligent caching
// āœ… Cost optimization
// āœ… Performance monitoring

Installation & Quick Setup

1. Install the SDK

npm install @relayplane/sdk

2. Set API Keys (Optional)

# Add any provider's API key - RelayPlane will auto-detect
export OPENAI_API_KEY="your-openai-key"
export ANTHROPIC_API_KEY="your-anthropic-key"
export GOOGLE_API_KEY="your-google-key"

# Or use RelayPlane hosting for all models
export RELAYPLANE_API_KEY="rp_your-key"

3. Start Using

import RelayPlane from '@relayplane/sdk';

// Zero-config magic
const result = await RelayPlane.ask("What is the capital of France?");

// Built-in examples
const summary = await RelayPlane.examples.summarize(document);
const chat = await RelayPlane.examples.chatbot("Hello!");

// Advanced features
const optimized = await RelayPlane.optimize(request);
const chain = await RelayPlane.chain({ steps: [...] });

API Reference

RelayPlane.ask()

Zero-config method for instant AI access with intelligent model selection.

RelayPlane.ask(input: string, options?: {
  budget?: 'unlimited' | 'moderate' | 'minimal';
  priority?: 'speed' | 'balanced' | 'quality';
  taskType?: 'general' | 'coding' | 'creative' | 'analysis' | 'translation';
  stream?: boolean;
  config?: Partial<EnhancedRelayConfig>;
}): Promise<{
  response: RelayResponse;
  reasoning: {
    selectedModel: string;
    rationale: string;
    alternatives: Array<{model: string, reason: string}>;
    detectedCapabilities: string[];
  };
}>

RelayPlane.examples

Ready-to-use patterns for common AI tasks.

Available Examples:

  • • chatbot(message, options)
  • • summarize(text, options)
  • • codeReview(code, options)
  • • translate(text, language, options)

More Examples:

  • • research(topic, options)
  • • creativeWriting(prompt, options)
  • • dataAnalysis(data, options)
  • • explain(topic, options)

Migrating to v0.2

āœ… Fully Backward Compatible

All existing v1.x code continues to work without changes.

// v1.x code still works
const response = await RelayPlane.relay({
      to: 'claude-sonnet-4-20250514',
  payload: { messages: [{ role: 'user', content: 'Hello!' }] }
});

// New v0.2 Zero-Config Wins are additive
const result = await RelayPlane.ask("Hello!"); // New!

šŸŽÆ Recommended: Try the New Features

  • • Replace manual model selection with RelayPlane.ask()
  • • Use RelayPlane.examples.* for common patterns
  • • Benefit from enhanced error handling automatically