Retrieve daily usage
curl --request GET \
--url https://api.writer.com/api/billing/v1/organization/{organizationId}/consumption/daily \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.writer.com/api/billing/v1/organization/{organizationId}/consumption/daily"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.writer.com/api/billing/v1/organization/{organizationId}/consumption/daily', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"currency": "USD",
"generated_at": "2026-10-20T12:00:00Z",
"days": [
{
"date": "2026-10-01",
"cost_in_cents": 120,
"total_tokens": 4500
},
{
"date": "2026-10-02",
"cost_in_cents": 0,
"total_tokens": 0
}
]
}{
"tpe": "<string>",
"errors": [
{
"key": "<string>",
"description": "<string>"
}
]
}{
"tpe": "<string>",
"errors": [
{
"key": "<string>",
"description": "<string>"
}
]
}Observability API
Retrieve daily usage
Retrieve one row per day of the month with the organization’s total cost and token usage. Days with no usage return zero. Requires an organization API key.
GET
/
api
/
billing
/
v1
/
organization
/
{organizationId}
/
consumption
/
daily
Retrieve daily usage
curl --request GET \
--url https://api.writer.com/api/billing/v1/organization/{organizationId}/consumption/daily \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.writer.com/api/billing/v1/organization/{organizationId}/consumption/daily"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.writer.com/api/billing/v1/organization/{organizationId}/consumption/daily', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"currency": "USD",
"generated_at": "2026-10-20T12:00:00Z",
"days": [
{
"date": "2026-10-01",
"cost_in_cents": 120,
"total_tokens": 4500
},
{
"date": "2026-10-02",
"cost_in_cents": 0,
"total_tokens": 0
}
]
}{
"tpe": "<string>",
"errors": [
{
"key": "<string>",
"description": "<string>"
}
]
}{
"tpe": "<string>",
"errors": [
{
"key": "<string>",
"description": "<string>"
}
]
}Use an organization API key. Team keys and user keys return
403 Forbidden. See Export usage and spend for examples and error handling.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your Writer API key. User keys can't read consumption data.
Query Parameters
Response
Daily series for the organization.
Was this page helpful?