Skip to main content
The superglue SDK provides programmatic access to the superglue API for executing and managing tools. Available in TypeScript/JavaScript and Python.

Installation

npm install @superglue/client
pip install superglue-client

Quick start

import { configure, listTools, runTool, getRun } from "@superglue/client";

// Configure before making any API calls
configure({
  baseUrl: "http://localhost:4000/api/v1",
  apiKey: "your-api-key",
});

// List available tools
const response = await listTools({ limit: 10 });
console.log(response.data.data);

// Run a tool
const runResponse = await runTool("my-tool-id", {
  inputs: {
    userId: "user_123",
  },
});

console.log(`Run ID: ${runResponse.data.runId}`);
console.log(`Status: ${runResponse.data.status}`);

// Get run results
const resultResponse = await getRun(runResponse.data.runId);
if (resultResponse.data.status === "success") {
  console.log("Result:", resultResponse.data.data);
}
from superglue_client import SuperglueClient
from superglue_client.api.tools import list_tools, run_tool
from superglue_client.api.runs import get_run
from superglue_client.models import RunRequest, RunRequestInputs

# Initialize client
client = SuperglueClient(
    base_url="http://localhost:4000/api/v1",
    token="your-api-key"
)

# List available tools
tools = list_tools.sync(client=client, limit=10)
print(tools.data)

# Run a tool
inputs = RunRequestInputs.from_dict({"user_id": "user_123"})
body = RunRequest(inputs=inputs)
run = run_tool.sync(
    tool_id="my-tool-id",
    client=client,
    body=body
)

print(f"Run ID: {run.run_id}")
print(f"Status: {run.status.value}")

# Get run results
result = get_run.sync(run_id=run.run_id, client=client)
if result.status.value == "success":
    print("Result:", result.data)

Authentication

Get your API key from the superglue dashboard under Settings → API Keys.
import { configure } from '@superglue/client';

configure({
  baseUrl: 'https://api.superglue.com/v1',
  apiKey: 'your-api-key'
});
client = SuperglueClient(
    base_url="https://api.superglue.com/v1",
    token="your-api-key"
)

TypeScript support

The SDK is fully typed with TypeScript. All types are auto-generated from the OpenAPI specification.
import { getTool } from "@superglue/client";
import type { Tool, Run, RunRequest } from "@superglue/client";

// Assumes configure() has been called (see Quick start above)
const response = await getTool("my-tool-id");
const tool: Tool = response.data;
from superglue_client.api.tools import get_tool
from superglue_client.models import Tool, Run, RunRequest

tool: Tool = get_tool.sync(tool_id="my-tool-id", client=client)

Next steps

Methods Reference

Complete API reference for all SDK methods

Types Reference

TypeScript and Python type definitions