Skip to content

Cost Optimization

UniCraft helps you minimize AI costs while maintaining quality through intelligent cost optimization features.

  • Real-time price monitoring across all providers
  • Automatic switching to cheaper alternatives
  • Price alerts and notifications
  • Detailed cost breakdown by provider and model
  • Usage patterns and trends analysis
  • Cost forecasting and budgeting
  • Set spending limits per project or organization
  • Automatic throttling when approaching limits
  • Cost alerts and notifications

Choose the most cost-effective model for your use case:

const response = await unicraft.chat.completions.create({
messages: [{ role: "user", content: "Hello" }],
model: "auto", // Automatically selects cost-optimized model
max_cost: 0.01, // Maximum cost per request
quality_threshold: 0.8, // Minimum quality requirement
});

Process multiple requests together to reduce costs:

const batch = await unicraft.batch.create({
requests: [
{ messages: [{ role: "user", content: "Request 1" }] },
{ messages: [{ role: "user", content: "Request 2" }] },
],
model: "auto",
});

Implement intelligent caching to reduce redundant API calls:

const response = await unicraft.chat.completions.create({
messages: [{ role: "user", content: "Hello" }],
cache: true,
cache_ttl: 3600, // Cache for 1 hour
});

Monitor your spending in real-time through the UniCraft dashboard:

  • Daily, weekly, and monthly cost trends
  • Provider comparison charts
  • Cost per request analysis

Set up cost alerts to stay within budget:

  • Daily spending limits
  • Unusual usage pattern detection
  • Provider price change notifications

Generate detailed cost reports:

  • Export data to CSV/JSON
  • Custom date ranges
  • Provider and model breakdowns
  1. Use Auto Model Selection: Let UniCraft choose the most cost-effective model
  2. Implement Caching: Cache responses for frequently asked questions
  3. Batch Similar Requests: Group similar requests together
  4. Monitor Usage: Regularly review usage patterns and costs
  5. Set Budget Limits: Use spending controls to prevent overspending