For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • API Reference
      • GETUsage Summary
      • GETUsage By Language
      • GETUsage Activity
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referenceusage

Usage By Language

GET
/api/v1/usage/by-language
GET
/api/v1/usage/by-language
$curl https://api.onepin.ai/api/v1/usage/by-language \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json"
1{
2 "data": {
3 "range": null,
4 "timezone": "America/New_York",
5 "period": {
6 "start": "2024-04-10T00:00:00Z",
7 "end": "2024-04-10T23:59:59Z"
8 },
9 "activity_view": "daily",
10 "languages": [
11 {
12 "locale_code": "en-US",
13 "display_name": "English (United States)",
14 "share": 0.65,
15 "credits": 12500,
16 "characters": 750000,
17 "lines": 15000,
18 "allocation_basis": "characters"
19 },
20 {
21 "locale_code": "es-ES",
22 "display_name": "Spanish (Spain)",
23 "share": 0.25,
24 "credits": 4800,
25 "characters": 280000,
26 "lines": 5600,
27 "allocation_basis": "characters"
28 },
29 {
30 "locale_code": "fr-FR",
31 "display_name": "French (France)",
32 "share": 0.1,
33 "credits": 1900,
34 "characters": 110000,
35 "lines": 2200,
36 "allocation_basis": "characters"
37 }
38 ]
39 },
40 "meta": {
41 "request_id": "a3f47b9e-8c2d-4f1a-9b7e-2d3f5e6a7c8b",
42 "timestamp": "2024-04-11T14:45:00Z"
43 }
44}

Return workspace generated-audio usage grouped by language.

share is a 0..1 fraction. When activity_view is supplied, rows use that tab’s local-calendar period; otherwise they preserve legacy range behavior.

Was this page helpful?
Previous

Usage Activity

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer

Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.

Headers

X-Workspace-Idstring or nullOptional

Query parameters

rangeenumOptionalDefaults to 30d

Rolling local calendar-day range.

Allowed values:
activity_viewenum or nullOptional
Optional activity view period to align language rows with the selected Usage tab. When supplied, range is ignored and range in the response is null.
Allowed values:
timezonestringOptionalDefaults to UTC
IANA timezone for local day bucketing.

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error