Local SDK agent.get_usage() returns feature_unavailable while run.usage succeeds

Where does the bug appear (feature/product)?

Cursor SDK

Describe the Bug

I am on the Ultra plan and trying to use the agent.get_usage() method in 1.0.36 python sdk as documented at Cursor Python SDK | Cursor Documentation. But it throws a feature_unavailable exception:
InternalServerError: internal: [feature_unavailable] This feature is not available for your account
Status code=500

This is the same result on every retry. I also tried with agent id set to agent-<uuid>, so this is not the bare-UUID invalid_argument error. I have tried with different models and API keys.

The installed SDK sends that call to GET /v1/agents/{agentId}/usage. The Python docs for agent.get_usage() say a local agent returns a per-turn breakdown, and that cost stays None until billing settles. This call never returns a body. run.usage is the live token count and is present. get_usage() is the billed usage and dollar cost, and that is the call being rejected.

What works

  • Both run.usage and result.usage return the same token counts:
    TokenUsage(input_tokens=8683, output_tokens=39, cache_read_tokens=3392, cache_write_tokens=0, total_tokens=12114, reasoning_tokens=None)

Steps to Reproduce

I have tried with different models and API keys, as well as with setting the agent id
user = await client.me(api_key=“…”)
agent = await client.agents.create(model=“composer-2.5”, api_key=api_key, local=LocalAgentOptions(cwd=cwd))
run = await agent.send(prompt)
result = await run.wait()
usage = await agent.get_usage()

Expected Behavior

As documented on Cursor Python SDK | Cursor Documentation, agent.get_usage() should succeed and return the billed record for that agent. It should not raise.

Operating System

MacOS

Version Information

Python cursor-sdk version 1.0.36

For AI issues: add Request ID with privacy disabled

Request ID: 0e7899df-24de-4764-add9-f4966821657e

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey @Adnan_Boz, thanks for the report and the clear repro.

agent.get_usage() for local agents isn’t generally available yet. It’s still being rolled out gradually, so on accounts where it isn’t enabled the server returns feature_unavailable. The SDK currently surfaces that as an internal 500, which is misleading, and our docs page doesn’t mention the rollout yet. I’ve passed both of those along to the team, along with your request for access.

In the meantime:

  • run.usage / result.usage gives you the token counts per run, as you’ve seen.
  • Billed cost for SDK runs shows on https://cursor.com/dashboard/usage under the SDK tag.
  • agent.get_usage() does work today for cloud agents, if that fits your workflow.

I’ll update this thread when local support rolls out more broadly!

Hi @Colin , thank you for the quick reply. A note in the docs would go a long way. Or maybe in the release notes.

Thanks,

Adnan

Let me see if I can get a note in the docs. Working on it!

Updated!