The docs for the replicate HTTP API say that the response includes a metrics object with a predict_time attribute.
It would be useful to log this to the SQLite database (in addition to the duration_ms field that is already logged, and which is apparently measured by the client), since it is the prediction time on the server that is used for the billing calculation.
On further thought, it looks like the charges for each API request are obtained by rounding to the nearest second, so the duration_ms is close enough for.
The docs for the replicate HTTP API say that the response includes a
metrics
object with apredict_time
attribute.It would be useful to log this to the SQLite database (in addition to the
duration_ms
field that is already logged, and which is apparently measured by the client), since it is the prediction time on the server that is used for the billing calculation.