> For the complete documentation index, see [llms.txt](https://guides.ia.numerique.gouv.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.ia.numerique.gouv.fr/albert-api/api-reference/liste-des-endpoint/usage.md).

# Usage

## Get Usages

> Get daily usage buckets for the current user.

```json
{"openapi":"3.1.0","info":{"title":"Albert API","version":"0.8.0"},"tags":[{"name":"Usage"}],"servers":[{"url":"https://albert.api.etalab.gouv.fr"}],"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"EndpointUsage":{"type":"string","enum":["/v1/audio/transcriptions","/v1/chat/completions","/v1/embeddings","/v1/ocr","/v1/rerank","/v1/search"],"title":"EndpointUsage"},"UsagesResponse":{"properties":{"object":{"type":"string","const":"list","title":"Object","description":"Type of the object.","default":"list"},"total":{"type":"integer","title":"Total","description":"Total number of usage buckets."},"offset":{"type":"integer","title":"Offset","description":"Offset of the usage buckets list."},"limit":{"type":"integer","title":"Limit","description":"Limit of the usage buckets list."},"data":{"items":{"$ref":"#/components/schemas/UsageBucketResponse"},"type":"array","title":"Data","description":"List of daily usage buckets."}},"additionalProperties":true,"type":"object","required":["total","offset","limit","data"],"title":"UsagesResponse"},"UsageBucketResponse":{"properties":{"object":{"type":"string","const":"usage.bucket","title":"Object","description":"Type of the object.","default":"usage.bucket"},"start_time":{"type":"integer","title":"Start Time","description":"UTC start of the day bucket, as Unix timestamp."},"end_time":{"type":"integer","title":"End Time","description":"UTC exclusive end of the day bucket, as Unix timestamp."},"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Sum of prompt tokens in the bucket."},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Sum of completion tokens in the bucket."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Sum of total tokens in the bucket."},"cost":{"type":"number","title":"Cost","description":"Sum of request costs in the bucket."},"requests":{"type":"integer","title":"Requests","description":"Number of successful requests in the bucket."},"impacts":{"$ref":"#/components/schemas/api__infrastructure__fastapi__schemas__usage__EnvironmentalImpacts"}},"additionalProperties":true,"type":"object","required":["start_time","end_time","prompt_tokens","completion_tokens","total_tokens","cost","requests"],"title":"UsageBucketResponse"},"api__infrastructure__fastapi__schemas__usage__EnvironmentalImpacts":{"properties":{"kWh":{"type":"number","title":"Kwh","description":"Energy consumption in kWh.","default":0},"kgCO2eq":{"type":"number","title":"Kgco2Eq","description":"Carbon footprint in kgCO2eq (global warming potential).","default":0}},"additionalProperties":true,"type":"object","title":"EnvironmentalImpacts"},"api__infrastructure__fastapi__documentation__HTTPExceptionModel":{"properties":{"status_code":{"type":"integer","title":"Status Code"},"detail":{"type":"string","title":"Detail"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers"}},"type":"object","required":["status_code","detail"],"title":"HTTPExceptionModel"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/usage":{"get":{"tags":["Usage"],"summary":"Get Usages","description":"Get daily usage buckets for the current user.","operationId":"get_usages_v1_usage_get","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of usage buckets to skip.","default":0,"title":"Offset"},"description":"Number of usage buckets to skip."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of usage buckets to return.","default":10,"title":"Limit"},"description":"Maximum number of usage buckets to return."},{"name":"start_time","in":"query","required":true,"schema":{"type":"integer","description":"Start time as Unix timestamp.","title":"Start Time"},"description":"Start time as Unix timestamp."},{"name":"end_time","in":"query","required":true,"schema":{"type":"integer","description":"End time as Unix timestamp.","title":"End Time"},"description":"End time as Unix timestamp."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/EndpointUsage"},{"type":"null"}],"description":"The endpoint to get usage for.","title":"Endpoint"},"description":"The endpoint to get usage for."},{"name":"models","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Router names to filter usage by.","title":"Models"},"description":"Router names to filter usage by."},{"name":"key_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Key ID to filter usage by.","title":"Key Id"},"description":"Key ID to filter usage by."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsagesResponse"}}}},"401":{"description":"Invalid authentication scheme.<br>Invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"403":{"description":"Your account has expired. Please contact support to renew your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get Usages

> Get daily usage buckets for the current user.

```json
{"openapi":"3.1.0","info":{"title":"Albert API","version":"0.8.0"},"tags":[{"name":"Usage"}],"servers":[{"url":"https://albert.api.etalab.gouv.fr"}],"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}},"schemas":{"EndpointUsage":{"type":"string","enum":["/v1/audio/transcriptions","/v1/chat/completions","/v1/embeddings","/v1/ocr","/v1/rerank","/v1/search"],"title":"EndpointUsage"},"UsagesResponse":{"properties":{"object":{"type":"string","const":"list","title":"Object","description":"Type of the object.","default":"list"},"total":{"type":"integer","title":"Total","description":"Total number of usage buckets."},"offset":{"type":"integer","title":"Offset","description":"Offset of the usage buckets list."},"limit":{"type":"integer","title":"Limit","description":"Limit of the usage buckets list."},"data":{"items":{"$ref":"#/components/schemas/UsageBucketResponse"},"type":"array","title":"Data","description":"List of daily usage buckets."}},"additionalProperties":true,"type":"object","required":["total","offset","limit","data"],"title":"UsagesResponse"},"UsageBucketResponse":{"properties":{"object":{"type":"string","const":"usage.bucket","title":"Object","description":"Type of the object.","default":"usage.bucket"},"start_time":{"type":"integer","title":"Start Time","description":"UTC start of the day bucket, as Unix timestamp."},"end_time":{"type":"integer","title":"End Time","description":"UTC exclusive end of the day bucket, as Unix timestamp."},"prompt_tokens":{"type":"integer","title":"Prompt Tokens","description":"Sum of prompt tokens in the bucket."},"completion_tokens":{"type":"integer","title":"Completion Tokens","description":"Sum of completion tokens in the bucket."},"total_tokens":{"type":"integer","title":"Total Tokens","description":"Sum of total tokens in the bucket."},"cost":{"type":"number","title":"Cost","description":"Sum of request costs in the bucket."},"requests":{"type":"integer","title":"Requests","description":"Number of successful requests in the bucket."},"impacts":{"$ref":"#/components/schemas/api__infrastructure__fastapi__schemas__usage__EnvironmentalImpacts"}},"additionalProperties":true,"type":"object","required":["start_time","end_time","prompt_tokens","completion_tokens","total_tokens","cost","requests"],"title":"UsageBucketResponse"},"api__infrastructure__fastapi__schemas__usage__EnvironmentalImpacts":{"properties":{"kWh":{"type":"number","title":"Kwh","description":"Energy consumption in kWh.","default":0},"kgCO2eq":{"type":"number","title":"Kgco2Eq","description":"Carbon footprint in kgCO2eq (global warming potential).","default":0}},"additionalProperties":true,"type":"object","title":"EnvironmentalImpacts"},"api__infrastructure__fastapi__documentation__HTTPExceptionModel":{"properties":{"status_code":{"type":"integer","title":"Status Code"},"detail":{"type":"string","title":"Detail"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers"}},"type":"object","required":["status_code","detail"],"title":"HTTPExceptionModel"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/me/usage":{"get":{"tags":["Usage"],"summary":"Get Usages","description":"Get daily usage buckets for the current user.","operationId":"get_usages_v1_me_usage_get","deprecated":true,"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of usage buckets to skip.","default":0,"title":"Offset"},"description":"Number of usage buckets to skip."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of usage buckets to return.","default":10,"title":"Limit"},"description":"Maximum number of usage buckets to return."},{"name":"start_time","in":"query","required":true,"schema":{"type":"integer","description":"Start time as Unix timestamp.","title":"Start Time"},"description":"Start time as Unix timestamp."},{"name":"end_time","in":"query","required":true,"schema":{"type":"integer","description":"End time as Unix timestamp.","title":"End Time"},"description":"End time as Unix timestamp."},{"name":"endpoint","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/EndpointUsage"},{"type":"null"}],"description":"The endpoint to get usage for.","title":"Endpoint"},"description":"The endpoint to get usage for."},{"name":"models","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Router names to filter usage by.","title":"Models"},"description":"Router names to filter usage by."},{"name":"key_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Key ID to filter usage by.","title":"Key Id"},"description":"Key ID to filter usage by."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsagesResponse"}}}},"401":{"description":"Invalid authentication scheme.<br>Invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"403":{"description":"Your account has expired. Please contact support to renew your account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__infrastructure__fastapi__documentation__HTTPExceptionModel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guides.ia.numerique.gouv.fr/albert-api/api-reference/liste-des-endpoint/usage.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
