Get usage and recent charges
curl --request GET \
--url https://code.deepline.com/api/v2/billing/usage \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://code.deepline.com/api/v2/billing/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://code.deepline.com/api/v2/billing/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"org_id": "org_example",
"recent": {
"run_id": null,
"request_id": "request_example",
"total": 1,
"total_is_exact": true,
"total_lower_bound": 1,
"offset": 0,
"limit": 1,
"next_offset": 1,
"next_cursor": null,
"has_more": false,
"incomplete": false,
"entries": [
{
"id": "usage_example",
"provider": "free",
"operation": "simple_company_search",
"status": "completed",
"request_id": "request_example",
"run_id": null,
"credits": 0,
"charge_state": "free",
"charge_finality": "final",
"rough_usd_cost": 0
}
]
}
}{
"error": "<string>"
}{
"error": "Unauthorized"
}{
"error": "<string>"
}{
"error": "<string>"
}Billing
Get usage and recent charges
Reads Deepline usage for the authenticated workspace. Use run_id for one run or request_id for one exact call. Pending holds are not final charges. Recent activity is a bounded view; use the ledger for longer history. Responses are private and uncached.
GET
/
api
/
v2
/
billing
/
usage
Get usage and recent charges
curl --request GET \
--url https://code.deepline.com/api/v2/billing/usage \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://code.deepline.com/api/v2/billing/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://code.deepline.com/api/v2/billing/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"org_id": "org_example",
"recent": {
"run_id": null,
"request_id": "request_example",
"total": 1,
"total_is_exact": true,
"total_lower_bound": 1,
"offset": 0,
"limit": 1,
"next_offset": 1,
"next_cursor": null,
"has_more": false,
"incomplete": false,
"entries": [
{
"id": "usage_example",
"provider": "free",
"operation": "simple_company_search",
"status": "completed",
"request_id": "request_example",
"run_id": null,
"credits": 0,
"charge_state": "free",
"charge_finality": "final",
"rough_usd_cost": 0
}
]
}
}{
"error": "<string>"
}{
"error": "Unauthorized"
}{
"error": "<string>"
}{
"error": "<string>"
}Authentication: workspace API key in
Authorization: Bearer <key>.
Errors
| Status | Meaning |
|---|---|
| 400 | Invalid input or incompatible filters. Correct the request before retrying. |
| 401 | Missing or invalid workspace authentication. |
| 404 | The requested resource was not found in the authenticated workspace. |
| 500 | Server failure. Retry this read; it does not start new work. |
Authorizations
Query Parameters
Response
Usage summary with recent activity, or the exact request lookup.