FAQ
What will the pricing be like?
During beta, using the API will be free of charge. Exact cost is TBD, but we will likely charge for this API on a per-use basis, with a monthly free allowance. If you need a rough estimate: a full hour of processing will likely cost a few dollars, which translates to a month of syncing (depending on the use case).
What if I need to use a language other than TypeScript / JavaScript?
Right now, we only offer a JavaScript SDK, but since it's built on WebSocket messages, we could provide a pleasant DX experience for other languages in the future.
What if I need REST?
The Server API uses streaming WebSockets, so it works well for batch processing or LLMs. If you really need to use a REST protocol, you can see how you could expose the API as REST endpoints in the example here. Don’t forget to add strong authentication.
What happens if my script errors part way through?
The Server API is not in any way transactional. It is possible that your script may error part way through, and so you should add error handling to your scripts and handle partial failures, should they happen.
How does this API work?
The underlying infrastructure is quite novel.
Your code runs in a true v8 sandbox on the server for optimal security (as we have to execute user code) as well as a full DOM API so we can offer advanced features like image exports.
Instead of http REST methods, it uses a persistent WebSocket connection to allow high performance streaming, which is ideal for LLMs. If you have a hard REST requirement it’s easy to build a small REST layer on top that simply forwards the HTTP actions to the streaming API.
The real-world trade-off for this architecture is that we’ll have cold starts, where the first commands will take a second or two, but blazing-fast subsequent calls. We will also keep the instance warm for a set period, so if you reconnect within that timeframe, it will resume where it left off and avoid a cold start.