Simple Prompting, Optimized Results
Stop wrestling with complex prompt engineering. Just describe your desired output, and OptimalQuery handles the rest — enhancing quality, reducing costs, and boosting performance.
Just Write Your Prompt, We'll Handle The Rest
No LLM expertise needed. Simply tell us what response you want, and our system automatically optimizes your prompt for better results and lower costs.
Intelligent Optimization
Intelligent prompt enhancement using proven patterns for superior results.
Cost Efficiency
Smart optimization reduces token usage, lowering your API expenses.
Self-Improving
Learns from successful prompts to continually refine optimization strategies.
See How Simple It Is
Your Simple Request (Using Templates)
1. Define the Template:
POST /api/v1/templates { "name": "Meeting Reschedule Email", "content": "Write a professional email to reschedule a meeting about {{topic}} to next week. Suggest {{day}} as a possible day." }
2. Call the Template:
POST /api/v1/completions { "template_id": "YOUR_TEMPLATE_ID", "inputs": { "topic": "Project Alpha Sync", "day": "Tuesday" } }
Simply define your desired output structure in a template, then call it with dynamic inputs.
What We Do Behind the Scenes
✓ Automatic Optimizations:
- Apply context-specific enhancements
- Structure prompt for clarity and effectiveness
- Inject relevant constraints and guidelines
- Optimize for token efficiency
- Ensure desired tone and style
We apply best practices automatically.
Quick Integration (2 Steps)
Step 1: Create a Template
Define your prompt structure once via API or UI. Use your API key (get from dashboard after signup).
curl 'https://optimalquery.com/api/v1/templates' \ -H 'X-API-Key: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ --data-raw '{ "name": "Story Generator", "content": "Give me {{number}} short fun stories about {{topic}} in JSON format. Expected array of strings like [\"story 1\", \"story 2\"]." }'
Note: The API will return a `template_id` (e.g., "9cd62d8f-...") after creation. (You can also create and manage templates through the dashboard UI.)
Step 2: Call the Template
Use the `template_id` and provide dynamic inputs.
curl 'https://optimalquery.com/api/v1/completions' \ -H 'X-API-Key: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ --data-raw '{ "template_id": "YOUR_TEMPLATE_ID", "inputs": { "number": "5", "topic": "space travel" } }'
Sample Response (for Story Generator Template Call):
[ { "story": "Captain Luna and her crew set out on a mission to explore a distant galaxy. Along the way, they encountered a group of friendly aliens who helped them navigate through a dangerous asteroid field." }, { "story": "During a routine spacewalk, astronaut Mark accidentally dropped his sandwich out of the airlock. To his surprise, a passing alien spaceship caught it and returned it to him, sparking an intergalactic friendship." }, { "story": "On their way to a new planet, the spaceship's navigation system malfunctioned, causing them to warp through time and space. They ended up in a parallel universe where everything was upside down." }, { "story": "As the crew approached a mysterious black hole, they noticed strange gravitational anomalies affecting their ship. To escape its pull, they had to use their wits and teamwork to slingshot around it and back to safety." }, { "story": "During a routine cargo delivery mission, the crew stumbled upon a hidden planet filled with ancient ruins and artifacts. They uncovered a long-lost civilization's secrets and made a groundbreaking discovery that changed the course of history." } ]
Data-Driven Prompt Improvement
OptimalQuery is designed to automatically collect samples of successful responses and use them to improve future optimizations, creating a virtuous cycle of prompt enhancement.
Leverage Successful Samples
- High-quality responses are automatically sampled
- Each sample links original prompt, optimized query, and response
- Usage statistics provide context for optimization analysis
- Review samples in the dashboard after sign up
Build Robust Test Suites
- Convert high-performing samples to test cases with one click (in dashboard)
- Test cases lock in templates, inputs, and expected outputs
- New optimizations are validated against existing test cases
- Ensure consistent quality and prevent regressions as the system evolves
How It Works
You make API calls with simple prompts
System collects successful samples
Convert good samples to test cases (in dashboard)
System improves optimization based on test cases
Ready to optimize your prompts?
Sign up today and start getting better results with less effort.