Docs

Other services

Call running deployments by owner/service through berm_lang::call or generated typed calls.

Calling

berm_lang::call(service, tool, args) calls a deployed tool with JSON arguments and answers JSON text:

let forecast = berm_lang::call("alice/weather", "forecast", r#"{"city":"Oslo"}"#)?;

alice/weather identifies a running deployment. Publishing or pulling an image does not change that destination. A bare name reaches a deployment in the calling service's account; local hosts use bare names. For a configurable destination, declare a var.

No calls declaration is needed in crab.toml. Calling a service does not install or deploy it.

For typed calls, crab idl alice/weather saves idls/weather.json with its owner, and berm_lang::declare_service!(weather) generates its types and calls. See Macros.

Access and billing

  • Another account's deployment must be public. Private deployments are accessible within their owning account.
  • The tool must accept service callers: access = "public", "anonymous" or "services".
  • The target sees the calling service's full deployment address through berm_lang::caller().
  • A priced call charges the calling service's account. It does not spend the original outside caller's API-key allowance. The price is retained only when the called tool succeeds.
  • Calls nest at most 4 deep. User and client context follow the chain.
  • A redeploy that breaks a tool a caller used in the last 30 days is refused unless forced. Deploying the caller alongside it does not exempt that use.

To run another service's code inside your own deployment, link its Rust API.