get
https://api.notdiamond.ai/v2/prompt/optimizeResults/
Retrieve the complete results of a prompt optimization run, including optimized prompts for all target models.
This endpoint returns the optimized prompts and evaluation metrics for each target model in your optimization request. Call this endpoint after the optimization status is 'completed' to get your optimized prompts.
Response Structure:
- origin_model: Baseline performance of your original prompt on the origin model
- Includes: system_prompt, user_message_template, score, evaluation metrics, cost
- target_models: Array of results for each target model
- Includes: optimized system_prompt, user_message_template, template_fields
- pre_optimization_score: Performance before optimization
- post_optimization_score: Performance after optimization
- Evaluation metrics and cost information
Using Optimized Prompts:
- Extract the
system_promptanduser_message_templatefrom each target model result - Use
user_message_template_fieldsto know which fields to substitute - Apply the optimized prompts when calling the respective target models
- Compare pre/post optimization scores to see improvement
Status Handling:
- If optimization is still processing, target model results will have
result_status: "processing" - Only completed target models will have system_prompt and template values
- Failed target models will have
result_status: "failed"with null values
Cost Information:
- Each model result includes cost in USD for the optimization process
- Costs vary based on model pricing and number of evaluation examples
- Typical range: $0.10 - $2.00 per target model
Best Practices:
- Wait for status 'completed' before calling this endpoint
- Check result_status for each target model
- Validate that post_optimization_score > pre_optimization_score
- Save optimized prompts for production use
- A/B test optimized prompts against originals in production
