Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pages/generative-apis/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,29 @@ Note that:
- Cockpits are isolated by Projects, hence you first need to select the right project in the Scaleway console before accessing Cockpit to see your token consumption for this Project (you can see the `project_id` in the Cockpit URL: `https://{project_id}.dashboard.obs.fr-par.scw.cloud/`.
- Cockpit graphs can take up to 1 hour to update token consumption, see [Troubleshooting](https://www.scaleway.com/en/docs/generative-apis/troubleshooting/fixing-common-issues/#tokens-consumption-is-not-displayed-in-cockpit-metrics) for further details.

## How can I give access to token consumption to my users outside of Scaleway?
If your users do not have a Scaleway account, you can still give them access to their Generative API usage consumption by either:
- Providing them an access to Grafana inside [Cockpit](https://console.scaleway.com/cockpit/overview). You can create dedicated [Grafana users](https://console.scaleway.com/cockpit/users) with read-only access (**Viewer** Role). Note that these users will still have access to all other Cockpit dashboards for this project.
- Collecting consumption data from the [Billing API](https://www.scaleway.com/en/developers/api/billing/#path-consumption-get-monthly-consumption) and exposing it to your users. Consumption can be detailed by Projects.
- Collecting consumption data from [Cockpit data sources](https://console.scaleway.com/cockpit/dataSource) and exposing it to your users. As an example, you can query consumption using the following query:
```curl
curl -G 'https://{data-source-id}.metrics.cockpit.fr-par.scw.cloud/prometheus/api/v1/query_range' \
--data-urlencode 'query=generative_apis_tokens_total{resource_name=~".*",type=~"(input_tokens|output_tokens)"}' \
--data-urlencode 'start=2025-03-15T20:10:51.781Z' \
--data-urlencode 'end=2025-03-20T20:10:51.781Z' \
--data-urlencode 'step=1h' \
-H "Authorization: Bearer $COCKPIT_TOKEN" | jq
```
Make sure that you replace the following values:
- `data-source-id`: ID of your [Scaleway metrics data source](https://console.scaleway.com/cockpit/dataSource)
- `$COCKPIT_TOKEN`: your [Cockpit token](https://console.scaleway.com/cockpit/tokens)
- `start` and `end` time properties: your specific time range

You can see your token consumption in [Scaleway Cockpit](https://console.scaleway.com/cockpit/). You can access it from the Scaleway console under the [Metrics tab](https://console.scaleway.com/generative-api/metrics).
Note that:
- Cockpits are isolated by Projects. You first need to select the right Project in the Scaleway console before accessing Cockpit to see your token consumption for the desired Project (you can see the `project_id` in the Cockpit URL: `https://{project_id}.dashboard.obs.fr-par.scw.cloud/`.
- Cockpit graphs can take up to 1 hour to update token consumption, see [Troubleshooting](/generative-apis/troubleshooting/fixing-common-issues/#tokens-consumption-is-not-displayed-in-cockpit-metrics) for further details.

## Can I configure a maximum billing threshold?
Currently, you cannot configure a specific threshold after which your usage will blocked. However:
- You can [configure billing alerts](/billing/how-to/use-billing-alerts/) to ensure you are warned when you hit specific budget thresholds.
Expand Down