Pricing for API is charged along two dimensions. All details can be found at dune.com/pricing

If your execution fails, then no credits are charged. If you execute a query but never pull the results, you are only charged for the execution.

DimensionCharge
Executions10 credits per medium query engine executions
20 credits per large query engine executions
Datapoints (Results)1 credit per 1,000 datapoints on Free
1 credit per 5,000 datapoints on Plus
1 credit per 25,000 datapoints on Premium
Storage1MB on Free
15GB on Plus
50GB on Premium
Queries EndpointAvailable on Plus and Premium
Webhooks (Alerts)1 on Free
5 on Plus
50 on Premium

A datapoint applies to query results after the query is run, and can in most cases be thought of rows * columns with an additional limit of 100 avg bytes per cell in a set of results. This can be expressed as:

Credits=Datapoints/1000=max(rowscolumns,ceil(totalbytes/100))/1000Credits = Datapoints/1000 = max(rows*columns, ceil(totalbytes/100))/1000

Any API usage billing will be based on what account the API key is associated with. If you use your team api key to call a public query belonging to yourself, the billing will be associated to the team (and vice versa).