Official SDKs for the Opper API.
| SDK | Package | Directory |
|---|---|---|
| Python | opperai |
python/ |
| TypeScript | opperai |
typescript/ |
pip install opperaifrom opperai import Opper
opper = Opper() # uses OPPER_API_KEY env var
result = opper.call("summarize", input="Long article...")
print(result.data)npm install opperaiimport { Opper } from "opperai";
const opper = new Opper(); // uses OPPER_API_KEY env var
const result = await opper.call("summarize", {
input: "Long article...",
});
console.log(result.data);Build AI agents with tool use, streaming, multi-agent composition, and MCP integration.
from opperai import Agent, tool
@tool
def get_weather(city: str) -> str:
"""Get the current weather for a city."""
return f"Sunny, 22°C in {city}"
agent = Agent(
name="weather-assistant",
instructions="You are a helpful weather assistant.",
tools=[get_weather],
)
result = await agent.run("What's the weather in Paris?")
print(result.output)See the Python agent examples for streaming, hooks, MCP integration, and multi-agent patterns.
import { z } from "zod";
import { Agent, tool } from "opperai";
const getWeather = tool({
name: "get_weather",
description: "Get the current weather for a city",
parameters: z.object({ city: z.string() }),
execute: async ({ city }) => `Sunny, 22°C in ${city}`,
});
const agent = new Agent({
name: "weather-assistant",
instructions: "You are a helpful weather assistant.",
tools: [getWeather],
});
const result = await agent.run("What's the weather in Paris?");
console.log(result.output);See the TypeScript agent examples for streaming, hooks, MCP integration, and multi-agent patterns.
See the Python SDK and TypeScript SDK READMEs for full documentation.