Inference Logoinference.sh

Agent SDK

Build and interact with AI agents programmatically.


What is the Agent SDK?

The Agent SDK lets you:

  • Use template agents — Chat with agents from your workspace
  • Create ad-hoc agents — Build agents on-the-fly with custom tools
  • Handle tool calls — Execute tools and return results
  • Stream responses — Get real-time message updates

Quick Start

Template Agent

Use an existing agent from your workspace:

python
1from inferencesh import inference23client = inference(api_key="inf_your_key")45agent = client.agent("my-team/support-agent@latest")67response = agent.send_message("How can I reset my password?")8print(response.text)

Ad-hoc Agent

Create an agent on-the-fly:

python
1from inferencesh import inference, tool, string23# Define a tool4calculator = (5    tool("calculator")6    .describe("Perform math calculations")7    .param("expression", string("Math expression"))8    .handler(lambda args: str(eval(args["expression"])))9    .build()10)1112client = inference(api_key="inf_your_key")1314agent = client.agent({15    "core_app": { "ref": "infsh/claude-sonnet-4@latest" },16    "system_prompt": "You are a helpful math assistant.",17    "tools": [calculator]18})1920response = agent.send_message("What is 42 * 17?")21print(response.text)

Next Steps

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.