Skip to content

Update API billing page (datapoints) #719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
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
35 changes: 31 additions & 4 deletions api-reference/overview/billing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,37 @@ If your execution fails, then no credits are charged. If you execute a query but
| Queries Endpoint | Available on Plus and Premium |
| Webhooks (Alerts) | 1 on Free <br></br> 5 on Plus <br></br> 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:
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:

```math
Credits = Datapoints/1000 = max(rows*columns, ceil(totalbytes/100))/1000
$$
Credits = \frac{Datapoints}{1000} = \frac{\max(\text{rows} * \text{columns}, \lceil \frac{\text{totalbytes}}{100} \rceil)}{1000}
$$

**Byte-Based Calculation Details**

When calculating datapoints based on total bytes, cells that exceed 100 bytes will "spill over" into additional cells. Here's how this works:

**Example Table:**
```
+-----+-----+-----+
| A1 | B1 | C1 |
+-----+-----+-----+
| A2 | B2 | C2 |
+-----+-----+-----+
| A3 | B3 | C3 |
+-----+-----+-----+
```

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).
**Spillover Calculation:** If one cell contains 175 bytes, that cell effectively counts as 2 cells in the datapoint calculation:

- First 100 bytes = 1 cell
- Remaining 75 bytes = 1 additional cell

**Example breakdown:**
- 8 cells of 100 bytes each = 8 cells
- 1 cell of 175 bytes = 2 cells (100 + 75)
- Total: 10 cells

**API Usage Billing**

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).
2 changes: 1 addition & 1 deletion api-reference/queries/endpoint/archive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In Dune context, delete action is replaced by archive as deletion of queries is
</Tip>

<Note>
To access Query endpoints, a [Plus plan](https://dune.com/pricing) or higher is required.
To access Query endpoints, an [Analyst plan](https://dune.com/pricing) or higher is required.
</Note>

<RequestExample>
Expand Down
2 changes: 1 addition & 1 deletion api-reference/queries/endpoint/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openapi: 'POST /v1/query'
---

<Note>
To access Query endpoints, a [Plus plan](https://dune.com/pricing) or higher is required.
To access Query endpoints, an [Analyst plan](https://dune.com/pricing) or higher is required.
</Note>

<RequestExample>
Expand Down
2 changes: 1 addition & 1 deletion api-reference/queries/endpoint/private.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openapi: 'POST /v1/query/{queryId}/private'
---

<Note>
To access Query endpoints, a [Plus plan](https://dune.com/pricing) or higher is required.
To access Query endpoints, an [Analyst plan](https://dune.com/pricing) or higher is required.
</Note>

<RequestExample>
Expand Down
2 changes: 1 addition & 1 deletion api-reference/queries/endpoint/read.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openapi: 'GET /v1/query/{queryId}'
---

<Note>
To access Query endpoints, a [Plus plan](https://dune.com/pricing) or higher is required.
To access Query endpoints, an [Analyst plan](https://dune.com/pricing) or higher is required.
</Note>

<RequestExample>
Expand Down
2 changes: 1 addition & 1 deletion api-reference/queries/endpoint/unarchive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openapi: 'POST /v1/query/{queryId}/unarchive'
---

<Note>
To access Query endpoints, a [Plus plan](https://dune.com/pricing) or higher is required.
To access Query endpoints, an [Analyst plan](https://dune.com/pricing) or higher is required.
</Note>

<Tip>
Expand Down
2 changes: 1 addition & 1 deletion api-reference/queries/endpoint/unprivate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openapi: 'POST /v1/query/{queryId}/unprivate'
---

<Note>
To access Query endpoints, a [Plus plan](https://dune.com/pricing) or higher is required.
To access Query endpoints, an [Analyst plan](https://dune.com/pricing) or higher is required.
</Note>

<RequestExample>
Expand Down
2 changes: 1 addition & 1 deletion api-reference/queries/endpoint/update.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openapi: 'PATCH /v1/query/{queryId}'
---

<Note>
To access Query endpoints, a [Plus plan](https://dune.com/pricing) or higher is required.
To access Query endpoints, an [Analyst plan](https://dune.com/pricing) or higher is required.
</Note>

<RequestExample>
Expand Down