I agree with @Anupam Chand, API response differs based on the type of subscription that you are currently using.
To retrieve the usage cost of a subscription within specific duration,
you need to include $filter
in query that works with only Enterprise Agreement (EA) or a pay-as-you-go subscriptions and not supported by
Microsoft Customer Agreements subscription.
If you have Enterprise Agreement (EA) or a pay-as-you-go subscription, you can make use of below query by including $filter
to retrieve the usage cost of a subscription within specific duration:
GET https://management.azure.com/subscriptions/<subID>/providers/Microsoft.Consumption/usageDetails?$filter=properties/usageStart ge '2023-06-01' and properties/usageEnd le '2023-06-02'&$top=1000&api-version=2019-10-01
I have one Azure account with pay-as-you-go subscription like below:

When I ran below query by including $filter
with different dates, I got different results successfully like this:
QUERY 1:
GET https://management.azure.com/subscriptions/<subID>/providers/Microsoft.Consumption/usageDetails?$filter=properties/usageStart ge '2023-07-01' and properties/usageEnd le '2023-07-02'&$top=1000&api-version=2019-10-01
Response:

QUERY 2:
GET https://management.azure.com/subscriptions/<subID>/providers/Microsoft.Consumption/usageDetails?$filter=properties/usageStart ge '2023-07-01' and properties/usageEnd le '2023-07-04'&$top=1000&api-version=2019-10-01
Response:

Reference:
Manage Azure costs with automation - Microsoft Cost Management