Skip to content

feat(admin): add get_api_credits endpoint (DX-6100)#49

Merged
johnpmitsch merged 1 commit into
mainfrom
dx-6100-add-get_api_credits-to-the-admin-sdk-client
Jul 7, 2026
Merged

feat(admin): add get_api_credits endpoint (DX-6100)#49
johnpmitsch merged 1 commit into
mainfrom
dx-6100-add-get_api_credits-to-the-admin-sdk-client

Conversation

@johnpmitsch

Copy link
Copy Markdown
Collaborator

Summary

Adds a new admin client method get_api_credits(chain), wrapping GET /v0/api-credits/{chain}. It returns the per-method API credit costs for a chain, resolved for the calling account's billing version.

The method accepts the same chain slugs returned by list_chains (e.g. ethereum), so the two compose. An unknown chain slug surfaces as a 404 ApiError.

Exposed across all four language layers (Rust, Python, Node, Ruby) following the existing path-param GET pattern, with new ApiCredit and GetApiCreditsResponse types, surface-file exports, RBS signature, examples, and per-language READMEs.

Test plan

  • Core wiremock tests cover the happy path, unknown-slug 404, and API error (cargo test -p quicknode-sdk --lib — 222 passing).
  • cargo check and just lint clean.
  • just node-build, just python-build, just ruby-build all pass; generated Node/Python type surfaces verified to include the new method and types.

Closes DX-6100

Adds `get_api_credits` to the admin client, wrapping
`GET /v0/api-credits/{chain}`. Returns the per-method API credit costs
for a chain, resolved for the calling account's billing version. Accepts
the same chain slugs as `list_chains` (e.g. `ethereum`), so the two
compose. An unknown chain slug surfaces as a 404 `ApiError`.

Exposed across all four language layers following the existing
path-param GET pattern:

- Core: new `api_credits.rs` with `ApiCredit` and
  `GetApiCreditsResponse` types plus wiremock tests (happy path,
  unknown-slug 404, API error).
- Python (`get_api_credits`), Node (`getApiCredits`), Ruby
  (`get_api_credits`) bindings, surface files, RBS signature, and
  per-language READMEs.
- Example usage added to all four admin examples.
@johnpmitsch johnpmitsch merged commit ac8d944 into main Jul 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants