If you use the access_token, it's not likely to last long enough, as the developer would have to re-auth frequently.
I run a developer API. Supabase handles user/developer accounts as well as the data, and I use a GQL server in front to handle requests for that data. A developer generates an API key (via a Postgres function), and then they send this key along with all requests to the API.
The GQL server:
- Checks that the key exists and belongs to a user
- Stores details of the request, which can be used for analytics but also allows calculation of how many API calls they've used in the current billing period
If the key is invalid or they've exceeded their API call quota, an error is returned.
Developers can have multiple keys, and this provides a way for them to perform analytics but also to revoke a key should they need to.