ai icon indicating copy to clipboard operation
ai copied to clipboard

AI.toMarkdown() model used & dashboard improvements

Open Mael-Abgrall opened this issue 5 months ago • 0 comments

Hey folks

I'm using the toMarkdown() to convert PDFs, and I noticed there were tokens in the output, and that on the AI dashboard I had some usage.

In the result from the API, would it be possible to indicate which model has been used to convert to markdown (so that I can track the token usage and price in my analytic suite)

{
  "name": "somatosensory.pdf",
  "mimeType": "application/pdf",
  "format": "markdown",
  "tokens": 926,
  "data": "...",
  "model": "@cf/meta/llama-3.2-1b-instruct" // Good
  "tokens_price": 0.027 // even better
},

cheers

Mael-Abgrall avatar Jul 23 '25 09:07 Mael-Abgrall