/optimize/{optimization_run_id}/costs

Get LLM usage costs for a specific prompt optimization run.

This endpoint returns the total cost and detailed usage records for all LLM requests made during a prompt optimization run. Use this to track costs associated with optimizing prompts for different target models.

Cost Breakdown:

  • Total cost across all models used in the optimization
  • Individual usage records with provider, model, tokens, and costs
  • Timestamps for each LLM request

Access Control:

  • Only accessible by the user who created the optimization run
  • Requires prompt optimization access
Path Params
string
required
Responses

401

Authentication failed

403

Access denied - optimization run does not belong to user

404

Optimization run not found

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json