Metadata of responses api

Hello

I’d like to see the cost of particular records that have specific metadata attributes.

Responses Api allows to attach a custom metadata object.
In documentation it says that it can be used in dashboard and via api. But I didn’t find in dashboard (usage) anything like that. Only period and project

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

1 Like

You mean with code like this?

with xxxxx.Client() as client:
    response = client.withredirects.get(
        "http://api-ide.unified-4.api.openai.com/v1/responses?metadata[client]=aleksan",
        headers=headers,
    )
response.raise_for_status()
response_object = resp.json()
responses_list = response_object.get("data")
responses_total = response_object.get("total")
responses_has_more = response_object.get("has_more")
responses_first_id = response_object.get("first_id")
responses_last_id = response_object.get("last_id ")
id_list = [item["id"] for item in responses_list if "id" in item]

id_metadata_map = {item["id"]: item["metadata"]
                   for item in responses_list
                   if "id" in item and "metadata" in item}

Delivering useful data?

{
  "object": "list",
  "data": [
    {
      "id": "resp_6820176c4b54",
      "object": "response",
      "created_at": 1746933612,
      "status": "completed",
      "error": null,
      "incomplete_details": null, # continues...
    }
  ],
  "first_id": "resp_682035ee60176",
  "has_more": true,
  "last_id": "resp_6819490844bc0e",
  "total": 345
}

I’m sorry Dave, I cannot allow that. (code intentionally confabulated)

They really want you not to do anything useful except be a consumer of their web product.


In the dashboard → logs → Responses, you can see metadata that has been set when you view a single logged item that is there from "store": true

And you can awkwardly do a query:

1 Like

This is understandable.

My question is about dashboard, where one can see cost for particular requests. I want to see how much money is used by particular group of requests.

In OpenAi documentation it states that it’s possible to use it in dashboard as well

If you click into a conversation in the responses logs, and expand, you’ll see that there is indeed “tokens” shown for each message. It is tedious to get to, and you can’t see them in aggregate, but token consumption is there, which can be translated to monetary costs.

It also doesn’t seem to be foolproof, and any error like I just discover on one stored “responses” (where others running similar calls have token values) means the whole site cannot be trusted to deliver accuracy.

“Usage” in the dashboard allows you to download a block of API calls, regardless of whether they were stored by Responses, but that also is not as versatile as one might wish. Also not trustworthy to deliver on its promises, because instead of being able to demonstrate the quality of data there, I can only demonstrate a spinning icon of never being able to download.

1 Like