Javascript Client

Steamship Javascript Client

The @steamship/client library provides access to Steamship Agents in NodeJS and Browser environments.

It is written in Typescript and available as open-source here (opens in a new tab). It powers Steamship's website (opens in a new tab), our @vercel/ai integration, and our React components


  npm i @steamship/client


First, create a Steamship Client:

import Steamship from "@steamship/client"

const steamship = new Steamship({
    apiKey: "YOUR-API-KEY"

Then, use your client to interact with a Steamship Agent. All you need to know is its BASE_URL.

Every running Steamship Agent has a BASE_URL. This URL always takes the following form:


You can find your Agent's base URL by going to its management console on (opens in a new tab) and clicking on the Connect > Web SDK sidebar panel.


Chat with an Agent using request/response fashion like so.

const response = await steamship.agent.respond({
  url: BASE_URL,
  input: {
    prompt: 'Hi there! Tell me a story!',
    context_id: CONTEXT_ID // Think of this as the chatroom name.

Steamship Agents are stateful. You don't need to worry about providing the chat history. Instead, provide a CONTEXT_ID which looks up this history on the server side.

Steaming Chat

Chat with an Agent in streaming mode like so:

const response = await steamship.agent.respondAsync({
    url: BASE_URL
    input: {
        prompt: "Hi there! Tell me a story!",
        context_id: CONTEXT_ID     // Think of this as the chatroom name.
const stream = await SteamshipStream(response, steamship)

You can parse the streaming response in a number of ways. We suggest starting with SteamshipStream, which will provide you with a Markdown-formatted stream of media content.

HTTP Endpoints

Each running Steamship Agents provides its own HTTP API. What that API does depends on the Agent implementation, but in general, Steamship developers use this API to do things like:

  • Implement webhooks
  • Provide "learning APIs" to upload, e.g. PDFs or text documents
  • Provide settings endpoints

You can call an API method on an agent like so:

const response = await{
  url: BASE_URL,
  path: 'set',
  arguments: {
    arg1: 'Value 1',
    arg2: 'Value 2'
// The response is a web Fetch response.
const json = await response.json();

If you want to make a get request, use steamship.agent.get and append the query params to the path property.