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.
Get started in under 30 seconds. No configuration, no setup, no complexity. Just ask and get intelligent AI responses.
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
Automatically discovers your API keys and selects the best model for each task
Analyzes your prompt and routes to the optimal model with reasoning
Common AI patterns ready to use. Copy, paste, and customize for your needs.
const chat = await RelayPlane.examples.chatbot(
"Hello! How can you help me?",
{
personality: "You are a helpful coding assistant",
budget: "moderate"
}
);
const summary = await RelayPlane.examples.summarize(
longDocument,
{
length: "brief",
focus: "key findings"
}
);
const review = await RelayPlane.examples.codeReview(
myCode,
{
language: "typescript",
focus: "security"
}
);
const translation = await RelayPlane.examples.translate(
"Hello world",
"Spanish",
{ tone: "formal" }
);
8+ Examples Available: chatbot, summarize, codeReview, translate, research, creativeWriting, dataAnalysis, explain, and more!
When things go wrong, get helpful suggestions instead of cryptic error messages.
ā 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
Clear guidance on setting up API keys with copy-paste solutions
Automatic fallback suggestions and retry guidance
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
// 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
npm install @relayplane/sdk
# 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"
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: [...] });
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[];
};
}>
Ready-to-use patterns for common AI tasks.
chatbot(message, options)
summarize(text, options)
codeReview(code, options)
translate(text, language, options)
research(topic, options)
creativeWriting(prompt, options)
dataAnalysis(data, options)
explain(topic, options)
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!
RelayPlane.ask()
RelayPlane.examples.*
for common patterns