Billing my users by usage + percentage

It looks like the most common way to charge users’ on sites that use AI APIs is either to implement your own credit system, which I think a lot of sites are doing these days and each have their own way of measuring these, or I could just charge a premium on the actual cost of using AI (e.g. Cursor does this in some situations).
And in my situation, because of the specific nature of my product, I would like to do the latter, but I have to implement the system of billing and metering myself.

Writing the code to track this manually is certainly doable, but it seems like either something that OpenAI should provide (I had higher hopes for the Costs API) or there should be some open source solution.

In an ideal world the Costs API would work such that I could break it down by metadata that I send per request, so that I could then tag requests with e.g. a user ID and then I could query for the cost grouped by metadata tags.

Does anyone have any insight on this topic?

I’m biased, but would recommend this: Usage-based billing | Stripe Documentation

3 Likes

Hola buenes noches:
Estoy leyendo vuestras preocupaciones y vuestras inquietudes y me quedo un poco asombrado.
Corregirme si estoy equivocado, todos ustedes utilizan sus herramientas paracrear, las automatizaciones, los agentes IA, o cualquier otro servicio quedan ustedes, las realiza en sus sus herramientas(las de ustedes) y luego ¿cobran por en consumo que cada cliente gasta? Es así o estoy equivocado.

Si es así creo que es un gran error. Yo trabajo dando los servivios que requiere o necesita el cliente; PERO LOS REALIZO EN SUS HERRAMIENTAS, QUE PANGAN ELLOS ( los clientes). y Yo cobro el servicio que les doy y el mantenimiento de las mismas.
un Saludo de Juan
Mcjhon Ai