Welcome to the new Golem Cloud Docs! 👋
Documentation
Runtime API

Runtime API

The Golem Runtime API allows you to access additional functionality from within your program.

The Runtime API is completely open source so anyone can provide an implementation of it. When you run your program in Golem we provide an implementation that supports durable execution.

The Runtime API is provided as a host interface, so you can consume it from any language. We expect that over time language specific libraries will leverage the Runtime API to provide an even more ergonomic experience in select languages.

The entire host interface is available at https://github.com/golemcloud/golem-wit (opens in a new tab). If you have questions about any of the interfaces or would like to see additional interfaces supported please feel free to open an issue!

To use it in your program include the content of wit/deps from golem-wit in your the wit/deps folder in your project. Then in your wit file you can import it as import golem:api/host@0.2.0.

This will allow you to call the Golem Runtime API from whatever language you are using. For instance, to use the Golem Runtime API in Rust, you would just add use golem::api::host::* to your imports.

💡

For Rust we also have a library called golem-rust (opens in a new tab) that provides a set of higher level idiomatic Rust wrappers for Golem specific functionality, as well as exporting bindings for both the official WASI interfaces and Golem's runtime API. When using this library it is not necessary to manually add the wit/deps folder from golem-wit to your project.