# ConsumptionLog

## Gets the Consumption Log objects for a specific Tenant in a specific date interval.

> Access to Consumption Log objects not belonging to the current logged in user> \
> is granted only to administrative users.

````json
{"openapi":"3.0.1","info":{"title":"Memori.ai Web API V2","version":"v2"},"paths":{"/api/v2/TenantConsumptionLogs/{strToken}/{tenantName}/{strType}/{strDateFrom}/{strDateTo}":{"get":{"tags":["ConsumptionLog"],"summary":"Gets the Consumption Log objects for a specific Tenant in a specific date interval.","description":"Access to Consumption Log objects not belonging to the current logged in user\r\nis granted only to administrative users.","operationId":"ConsumptionLog-GetTenantConsumptionLogs","parameters":[{"name":"strToken","in":"path","description":"The login token","required":true,"schema":{"type":"string"}},{"name":"tenantName","in":"path","description":"The name of the Tenant","required":true,"schema":{"type":"string"}},{"name":"strType","in":"path","description":"Type of consumption (i.e. granularity), it may either be Daily or Monthly","required":true,"schema":{"type":"string"}},{"name":"strDateFrom","in":"path","description":"The optional begin of the date interval, in UTC time, in the format yyyyMMdd","schema":{"type":"string"}},{"name":"strDateTo","in":"path","description":"The optional end of the date interval, in UTC time, in the format yyyyMMdd","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}}}}}}}},"components":{"schemas":{"ListConsumptionLogsResponse":{"type":"object","properties":{"consumptionLogs":{"type":"array","items":{"$ref":"#/components/schemas/ConsumptionLogSpecs"},"description":"The list of Consumption Logs objects.","nullable":true},"requestID":{"type":"integer","description":"Progressive number of the request (since the Server started).\r\nUse this number, together with the RequestDateTime property,\r\nto report an anomalous reponse.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous reponse.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is indicative of the actual\r\nerror.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Response of a List Consumption Logs request."},"ConsumptionLogSpecs":{"type":"object","properties":{"consumptionLogID":{"type":"string","description":"ID of the Consumption Log object.\r\nUnique and assigned by the system.","nullable":true},"from":{"type":"string","description":"Begin of the date interval of the Consumption Log.","format":"date-time"},"to":{"type":"string","description":"End of the date interval of the Consumption Log.","format":"date-time"},"type":{"type":"string","description":"Type of Consumption Log. <br> May be one of the following:<ul> <li><code>Daily</code></li> <li><code>Monthly</code></li> </ul>","nullable":true},"userID":{"type":"string","description":"ID of the associated User object.","nullable":true},"userName":{"type":"string","description":"Name of the associated User object.","nullable":true},"tenantName":{"type":"string","description":"Name of the Tenant of the associated User object.","nullable":true},"memoriID":{"type":"string","description":"ID of the associated Memori object.","nullable":true},"memoriName":{"type":"string","description":"Name of the associated Memori object.","nullable":true},"totalSessions":{"type":"integer","description":"Total number of sessions consumed in the interval.\r\nThese sessions are NOT counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"validSessions":{"type":"integer","description":"Number of valid sessions consumed in the interval.\r\nThese sessions ARE counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"completions":{"type":"integer","description":"Number of completions consumed in the interval using\r\na chargeable (i.e. non-custom) Completion Config.\r\nThese completions ARE counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"deepThoughtValidSessions":{"type":"integer","description":"Number of valid sessions consumed in the interval,\r\nwith Deep Thought enabled.\r\nThese sessions ARE counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"deepThoughtCompletions":{"type":"integer","description":"Number of completions consumed in the interval,\r\nwith Deep Thought enabled, using a chargeable (i.e. non-custom) Completion Config.\r\nThese completions ARE counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"importedSize":{"type":"integer","description":"Number of characters imported in the interval using\r\na chargeable (i.e. non-custom) Completion Config.\r\nThis size IS counted towards the maximum size of imported characters\r\navailable for the month.","format":"int64"},"nonChargeableCompletions":{"type":"integer","description":"Number of completions consumed in the interval using\r\na non-chargeable (i.e. custom) Completion Config.\r\nThese completions are NOT counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"nonChargeableDeepThoughtCompletions":{"type":"integer","description":"Number of completions consumed in the interval,\r\nwith Deep Thought enabled, using a non-chargeable (i.e. custom) Completion Config.\r\nThese completions are NOT counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"nonChargeableImportedSize":{"type":"integer","description":"Number of characters imported in the interval using\r\na non-chargeable (i.e. custom) Completion Config.\r\nThis size is NOT counted towards the maximum size of imported characters\r\navailable for the month.","format":"int64"},"promptTokens":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Number of prompt tokens consumed in the interval.\r\nThe key is a string formatted as ```\"provider|endpoint|API-key|model|charge|purpose\"```,\r\nwhere:<ul><li>```provider``` is the name of the Completion Provider (e.g. \"OpenAI\")</li><li>```endpoint``` is the end-point of the Completion Provider</li><li>```API-key``` is the obfuscated API key used by the Completion Provider</li><li>```model``` is the model used by the Completion Provider (e.g. \"gpt-4o)</li><li>```charge``` is a flag indicating if the token consumption comes from a chargeable\r\n(i.e. non-custom) or non-chargeable (i.e. custom) Completion Config (\"$\" for chargeable, empty otherwise)</li><li>```purpose``` is the purpose of the prompt (e.g. \"QA\" for question answering,\r\n\"DT\" for Deep Thought, \"IE\" for import/export etc.)</li></ul>\r\nThe value is the corresponding prompt tokens count.","nullable":true},"completionTokens":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Number of completion tokens consumed in the interval.\r\nThe key is a string formatted as ```\"provider|endpoint|API-key|model|charge|purpose\"```,\r\nwhere:<ul><li>```provider``` is the name of the Completion Provider (e.g. \"OpenAI\")</li><li>```endpoint``` is the end-point of the Completion Provider</li><li>```API-key``` is the obfuscated API key used by the Completion Provider</li><li>```model``` is the model used by the Completion Provider (e.g. \"gpt-4o\")</li><li>```charge``` is a flag indicating if the token consumption comes from a chargeable\r\n(i.e. non-custom) or non-chargeable (i.e. custom) Completion Config (\"$\" for chargeable, empty otherwise)</li><li>```purpose``` is the purpose of the prompt (e.g. \"QA\" for question answering,\r\n\"DT\" for Deep Thought, \"IE\" for import/export etc.)</li></ul>\r\nThe value is the corresponding completion tokens count.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Consumption Log object."}}}}
````

## Gets the Consumption Log objects for a specific User in a specific date interval.

> Access to Consumption Log objects not belonging to the current logged in user> \
> is granted only to administrative users.

````json
{"openapi":"3.0.1","info":{"title":"Memori.ai Web API V2","version":"v2"},"paths":{"/api/v2/UserConsumptionLogs/{strToken}/{strUserID}/{strType}/{strDateFrom}/{strDateTo}":{"get":{"tags":["ConsumptionLog"],"summary":"Gets the Consumption Log objects for a specific User in a specific date interval.","description":"Access to Consumption Log objects not belonging to the current logged in user\r\nis granted only to administrative users.","operationId":"ConsumptionLog-GetUserConsumptionLogs","parameters":[{"name":"strToken","in":"path","description":"The login token","required":true,"schema":{"type":"string"}},{"name":"strUserID","in":"path","description":"The ID of the User object","required":true,"schema":{"type":"string"}},{"name":"strType","in":"path","description":"Type of consumption (i.e. granularity), it may either be Daily or Monthly","required":true,"schema":{"type":"string"}},{"name":"strDateFrom","in":"path","description":"The optional begin of the date interval, in UTC time, in the format yyyyMMdd","schema":{"type":"string"}},{"name":"strDateTo","in":"path","description":"The optional end of the date interval, in UTC time, in the format yyyyMMdd","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}}}}}}}},"components":{"schemas":{"ListConsumptionLogsResponse":{"type":"object","properties":{"consumptionLogs":{"type":"array","items":{"$ref":"#/components/schemas/ConsumptionLogSpecs"},"description":"The list of Consumption Logs objects.","nullable":true},"requestID":{"type":"integer","description":"Progressive number of the request (since the Server started).\r\nUse this number, together with the RequestDateTime property,\r\nto report an anomalous reponse.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous reponse.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is indicative of the actual\r\nerror.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Response of a List Consumption Logs request."},"ConsumptionLogSpecs":{"type":"object","properties":{"consumptionLogID":{"type":"string","description":"ID of the Consumption Log object.\r\nUnique and assigned by the system.","nullable":true},"from":{"type":"string","description":"Begin of the date interval of the Consumption Log.","format":"date-time"},"to":{"type":"string","description":"End of the date interval of the Consumption Log.","format":"date-time"},"type":{"type":"string","description":"Type of Consumption Log. <br> May be one of the following:<ul> <li><code>Daily</code></li> <li><code>Monthly</code></li> </ul>","nullable":true},"userID":{"type":"string","description":"ID of the associated User object.","nullable":true},"userName":{"type":"string","description":"Name of the associated User object.","nullable":true},"tenantName":{"type":"string","description":"Name of the Tenant of the associated User object.","nullable":true},"memoriID":{"type":"string","description":"ID of the associated Memori object.","nullable":true},"memoriName":{"type":"string","description":"Name of the associated Memori object.","nullable":true},"totalSessions":{"type":"integer","description":"Total number of sessions consumed in the interval.\r\nThese sessions are NOT counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"validSessions":{"type":"integer","description":"Number of valid sessions consumed in the interval.\r\nThese sessions ARE counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"completions":{"type":"integer","description":"Number of completions consumed in the interval using\r\na chargeable (i.e. non-custom) Completion Config.\r\nThese completions ARE counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"deepThoughtValidSessions":{"type":"integer","description":"Number of valid sessions consumed in the interval,\r\nwith Deep Thought enabled.\r\nThese sessions ARE counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"deepThoughtCompletions":{"type":"integer","description":"Number of completions consumed in the interval,\r\nwith Deep Thought enabled, using a chargeable (i.e. non-custom) Completion Config.\r\nThese completions ARE counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"importedSize":{"type":"integer","description":"Number of characters imported in the interval using\r\na chargeable (i.e. non-custom) Completion Config.\r\nThis size IS counted towards the maximum size of imported characters\r\navailable for the month.","format":"int64"},"nonChargeableCompletions":{"type":"integer","description":"Number of completions consumed in the interval using\r\na non-chargeable (i.e. custom) Completion Config.\r\nThese completions are NOT counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"nonChargeableDeepThoughtCompletions":{"type":"integer","description":"Number of completions consumed in the interval,\r\nwith Deep Thought enabled, using a non-chargeable (i.e. custom) Completion Config.\r\nThese completions are NOT counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"nonChargeableImportedSize":{"type":"integer","description":"Number of characters imported in the interval using\r\na non-chargeable (i.e. custom) Completion Config.\r\nThis size is NOT counted towards the maximum size of imported characters\r\navailable for the month.","format":"int64"},"promptTokens":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Number of prompt tokens consumed in the interval.\r\nThe key is a string formatted as ```\"provider|endpoint|API-key|model|charge|purpose\"```,\r\nwhere:<ul><li>```provider``` is the name of the Completion Provider (e.g. \"OpenAI\")</li><li>```endpoint``` is the end-point of the Completion Provider</li><li>```API-key``` is the obfuscated API key used by the Completion Provider</li><li>```model``` is the model used by the Completion Provider (e.g. \"gpt-4o)</li><li>```charge``` is a flag indicating if the token consumption comes from a chargeable\r\n(i.e. non-custom) or non-chargeable (i.e. custom) Completion Config (\"$\" for chargeable, empty otherwise)</li><li>```purpose``` is the purpose of the prompt (e.g. \"QA\" for question answering,\r\n\"DT\" for Deep Thought, \"IE\" for import/export etc.)</li></ul>\r\nThe value is the corresponding prompt tokens count.","nullable":true},"completionTokens":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Number of completion tokens consumed in the interval.\r\nThe key is a string formatted as ```\"provider|endpoint|API-key|model|charge|purpose\"```,\r\nwhere:<ul><li>```provider``` is the name of the Completion Provider (e.g. \"OpenAI\")</li><li>```endpoint``` is the end-point of the Completion Provider</li><li>```API-key``` is the obfuscated API key used by the Completion Provider</li><li>```model``` is the model used by the Completion Provider (e.g. \"gpt-4o\")</li><li>```charge``` is a flag indicating if the token consumption comes from a chargeable\r\n(i.e. non-custom) or non-chargeable (i.e. custom) Completion Config (\"$\" for chargeable, empty otherwise)</li><li>```purpose``` is the purpose of the prompt (e.g. \"QA\" for question answering,\r\n\"DT\" for Deep Thought, \"IE\" for import/export etc.)</li></ul>\r\nThe value is the corresponding completion tokens count.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Consumption Log object."}}}}
````

## Gets the Consumption Log objects for a specific Memori in a specific date interval.

> Access to Consumption Log objects not belonging to the current logged in user> \
> is granted only to administrative users.

````json
{"openapi":"3.0.1","info":{"title":"Memori.ai Web API V2","version":"v2"},"paths":{"/api/v2/MemoriConsumptionLogs/{strToken}/{strMemoriID}/{strType}/{strDateFrom}/{strDateTo}":{"get":{"tags":["ConsumptionLog"],"summary":"Gets the Consumption Log objects for a specific Memori in a specific date interval.","description":"Access to Consumption Log objects not belonging to the current logged in user\r\nis granted only to administrative users.","operationId":"ConsumptionLog-GetMemoriConsumptionLogs","parameters":[{"name":"strToken","in":"path","description":"The login token","required":true,"schema":{"type":"string"}},{"name":"strMemoriID","in":"path","description":"The ID of the Memori object","required":true,"schema":{"type":"string"}},{"name":"strType","in":"path","description":"Type of consumption (i.e. granularity), it may either be Daily or Monthly","required":true,"schema":{"type":"string"}},{"name":"strDateFrom","in":"path","description":"The optional begin of the date interval, in UTC time, in the format yyyyMMdd","schema":{"type":"string"}},{"name":"strDateTo","in":"path","description":"The optional end of the date interval, in UTC time, in the format yyyyMMdd","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ListConsumptionLogsResponse"}}}}}}}},"components":{"schemas":{"ListConsumptionLogsResponse":{"type":"object","properties":{"consumptionLogs":{"type":"array","items":{"$ref":"#/components/schemas/ConsumptionLogSpecs"},"description":"The list of Consumption Logs objects.","nullable":true},"requestID":{"type":"integer","description":"Progressive number of the request (since the Server started).\r\nUse this number, together with the RequestDateTime property,\r\nto report an anomalous reponse.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous reponse.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is indicative of the actual\r\nerror.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Response of a List Consumption Logs request."},"ConsumptionLogSpecs":{"type":"object","properties":{"consumptionLogID":{"type":"string","description":"ID of the Consumption Log object.\r\nUnique and assigned by the system.","nullable":true},"from":{"type":"string","description":"Begin of the date interval of the Consumption Log.","format":"date-time"},"to":{"type":"string","description":"End of the date interval of the Consumption Log.","format":"date-time"},"type":{"type":"string","description":"Type of Consumption Log. <br> May be one of the following:<ul> <li><code>Daily</code></li> <li><code>Monthly</code></li> </ul>","nullable":true},"userID":{"type":"string","description":"ID of the associated User object.","nullable":true},"userName":{"type":"string","description":"Name of the associated User object.","nullable":true},"tenantName":{"type":"string","description":"Name of the Tenant of the associated User object.","nullable":true},"memoriID":{"type":"string","description":"ID of the associated Memori object.","nullable":true},"memoriName":{"type":"string","description":"Name of the associated Memori object.","nullable":true},"totalSessions":{"type":"integer","description":"Total number of sessions consumed in the interval.\r\nThese sessions are NOT counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"validSessions":{"type":"integer","description":"Number of valid sessions consumed in the interval.\r\nThese sessions ARE counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"completions":{"type":"integer","description":"Number of completions consumed in the interval using\r\na chargeable (i.e. non-custom) Completion Config.\r\nThese completions ARE counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"deepThoughtValidSessions":{"type":"integer","description":"Number of valid sessions consumed in the interval,\r\nwith Deep Thought enabled.\r\nThese sessions ARE counted towards the maximum number of sessions\r\navailable for the month.","format":"int32"},"deepThoughtCompletions":{"type":"integer","description":"Number of completions consumed in the interval,\r\nwith Deep Thought enabled, using a chargeable (i.e. non-custom) Completion Config.\r\nThese completions ARE counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"importedSize":{"type":"integer","description":"Number of characters imported in the interval using\r\na chargeable (i.e. non-custom) Completion Config.\r\nThis size IS counted towards the maximum size of imported characters\r\navailable for the month.","format":"int64"},"nonChargeableCompletions":{"type":"integer","description":"Number of completions consumed in the interval using\r\na non-chargeable (i.e. custom) Completion Config.\r\nThese completions are NOT counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"nonChargeableDeepThoughtCompletions":{"type":"integer","description":"Number of completions consumed in the interval,\r\nwith Deep Thought enabled, using a non-chargeable (i.e. custom) Completion Config.\r\nThese completions are NOT counted towards the maximum number of completions\r\navailable for the month.","format":"int32"},"nonChargeableImportedSize":{"type":"integer","description":"Number of characters imported in the interval using\r\na non-chargeable (i.e. custom) Completion Config.\r\nThis size is NOT counted towards the maximum size of imported characters\r\navailable for the month.","format":"int64"},"promptTokens":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Number of prompt tokens consumed in the interval.\r\nThe key is a string formatted as ```\"provider|endpoint|API-key|model|charge|purpose\"```,\r\nwhere:<ul><li>```provider``` is the name of the Completion Provider (e.g. \"OpenAI\")</li><li>```endpoint``` is the end-point of the Completion Provider</li><li>```API-key``` is the obfuscated API key used by the Completion Provider</li><li>```model``` is the model used by the Completion Provider (e.g. \"gpt-4o)</li><li>```charge``` is a flag indicating if the token consumption comes from a chargeable\r\n(i.e. non-custom) or non-chargeable (i.e. custom) Completion Config (\"$\" for chargeable, empty otherwise)</li><li>```purpose``` is the purpose of the prompt (e.g. \"QA\" for question answering,\r\n\"DT\" for Deep Thought, \"IE\" for import/export etc.)</li></ul>\r\nThe value is the corresponding prompt tokens count.","nullable":true},"completionTokens":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Number of completion tokens consumed in the interval.\r\nThe key is a string formatted as ```\"provider|endpoint|API-key|model|charge|purpose\"```,\r\nwhere:<ul><li>```provider``` is the name of the Completion Provider (e.g. \"OpenAI\")</li><li>```endpoint``` is the end-point of the Completion Provider</li><li>```API-key``` is the obfuscated API key used by the Completion Provider</li><li>```model``` is the model used by the Completion Provider (e.g. \"gpt-4o\")</li><li>```charge``` is a flag indicating if the token consumption comes from a chargeable\r\n(i.e. non-custom) or non-chargeable (i.e. custom) Completion Config (\"$\" for chargeable, empty otherwise)</li><li>```purpose``` is the purpose of the prompt (e.g. \"QA\" for question answering,\r\n\"DT\" for Deep Thought, \"IE\" for import/export etc.)</li></ul>\r\nThe value is the corresponding completion tokens count.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Consumption Log object."}}}}
````


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aisuru.com/api/backend/consumptionlog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
