Viewing personal API usage

My account_Developer.png

API usage seems to be missing from my personal account.
It should be there, according to https://cad.onshape.com/help/Content/Plans/developer-myaccount.htm. I do have an API key created, and I have used it for calls which should count against limits, so it's not just skipping the table because there's nothing to display.
I do see usage in company settings > developer for API keys created there, but that doesn't include my personal API key usage either.

Relatedly, is there a way to use the API itself to retrieve usage and limits? I can't find an endpoint for it in the docs.

Thanks!

Tagged:

Comments

  • Matt_Shields
    Matt_Shields Member, Onshape Employees Posts: 1,007 PRO

    If you are a part of a company, e.g. Pro Disco, your API usage is tracked at the company level.

    And I'm not aware of a way to track API usage via API.

  • chigozie
    chigozie Member Posts: 6 ✭

    Thanks, I am on Pro Discovery.

    Curiously, the calls I make with my personal key are not being tracked on the company level API usage viewer, either. I have a key created in My account > Developer which I made ~100 calls with. The API usage table in My account > Developer is not visible, and the one in Company settings > Developer showed 0/2500 requests. Creating an API key in Company settings > Developer and using that one does increment the requests.

  • chigozie
    chigozie Member Posts: 6 ✭

    I think I have found the answer to both of my questions.

    There is an undocumented API endpoint. I don't think API key/secret key auth has permission to access it, but when logged into Onshape in the browser it can be accessed:

    https://cad.onshape.com/api/v13/metrics/api/summary?startDate=2025-09-14T00:00:00.000Z

    startDate is required.

    keyCount in the response appears to be the requests made by my personal API keys (excluding requests made by company keys).

    Adding ownerId=AAAA to the query params, where AAAA is the company id returned from the /companies endpoint, shows only the requests made by company API keys (excluding requests made by personal keys). This is what is displayed in the API usage table, and the reason I couldn't see my personal key usage reflected.