Base44 SDK Adds Metered Connectors and a callApi() Method

Base44View original changelog

Base44 added support for metered connectors to its SDK. These are platform connectors backed by paid third-party APIs, where Base44 attaches the credential server-side and charges each call to the workspace's credits. Developers call them with the new callApi() method and get a creditsCharged value back with every response, which makes per-call cost trackable.

Key Takeaways

  • Metered connectors let apps call paid third-party APIs with no token handling, because Base44 attaches the credential server-side.
  • The cost of each call is charged to the workspace's credits, so usage shows up in the same place as other Base44 spend.
  • The new callApi() method on the connectors module replaces the fetch-a-token-then-request pattern for these connectors.
  • Every response carries creditsCharged, which allows per-call cost tracking inside the app.
  • Provider errors come back as structured data instead of thrown exceptions, so failures are handled by inspecting the response.
  • Returning errors as data also helps developers avoid blindly retrying non-idempotent requests.

Paid third-party APIs without handling credentials

Base44 added support for metered connectors to its SDK. A metered connector is a platform connector backed by a paid third-party API. Base44 attaches the credential on the server side, so an app never has to fetch or store a token. The cost of each call is charged to the workspace's credits.

The new callApi() method

Apps call a metered connector through the new callApi() method on the connectors module. Before this change, a developer who wanted to use a connector's API fetched a token and made the request directly. With metered connectors that step goes away. Base44 makes the request with its own credential and bills the call to the workspace.

Cost tracking and error handling

Every response includes a creditsCharged field, so an app can record what each call cost. This matters for paid APIs, where cost can differ a lot between endpoints.

Provider errors are returned as structured data rather than thrown as exceptions. A developer checks the response instead of wrapping each call in a try/catch. Base44 says this makes failures simpler to handle and helps avoid retrying non-idempotent requests, such as ones that create a record or send a message, which could otherwise run twice.

Where to find the details

The SDK reference for the connectors module covers callApi(), the ConnectorApiResponse type, and a dedicated section on metered connectors.