Report the tokens this computer’s assistants used, per UTC day
PUT
/v1/usage/sources/{sourceId}
const url = 'https://app.skillpouch.net/v1/usage/sources/example';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"rows":[{"input":1,"output":1,"cache_read":1,"cache_write":1,"day":"example","assistant":"example","model":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://app.skillpouch.net/v1/usage/sources/example \ --header 'Content-Type: application/json' \ --data '{ "rows": [ { "input": 1, "output": 1, "cache_read": 1, "cache_write": 1, "day": "example", "assistant": "example", "model": "example" } ] }'sourceId names the logs the counts come from and stays the same across logins. Rows are never added up: each keeps the larger of its stored and reported total, so sending the same logs again changes nothing.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”sourceId
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
rows
required
Array<object>
object
input
required
integer
output
required
integer
cache_read
required
integer
cache_write
required
integer
day
required
string
assistant
required
string
model
required
string
Example generated
{ "rows": [ { "input": 1, "output": 1, "cache_read": 1, "cache_write": 1, "day": "example", "assistant": "example", "model": "example" } ]}Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
ok
required
boolean
data
required
object
stored
required
integer
meta
required
object
request_id
required
string
next_cursor
string | null
Example
{ "ok": true}