Build Powerful AI Agents, Faster.

Focus on your unique application logic. Let Toolstream handle the complexities of tool integration, authentication, and security.

Focus on What Matters

Stop writing boilerplate code for third-party API integrations. We handle the OAuth flows, token management, and API-specific request formats, so you can focus on building your agent's core intelligence.

Secure by Design

Your users' credentials are a huge liability. We provide a secure vault with AES-256 encryption and a zero-human-access architecture, giving you and your users peace of mind.

Model Agnostic

Our simple, RESTful API works with any LLM. Whether you're using OpenAI, Gemini, Anthropic, or a fine-tuned local model, Toolstream is your universal tool-use layer.

Scalable & Reliable

Built on serverless infrastructure, Toolstream scales with your application. From a single user to enterprise-level demand, our API is ready to perform reliably.

A Simple, Powerful API

Integrating Toolstream is straightforward. Once your agent decides which tool to use, your backend makes a single, authenticated call to our `/execute` endpoint.

import requests
import json

# Your secure API Key (from Developer Settings)
API_KEY = "ts_sec_..." 

# The structured request from your LLM or application logic
payload = {
  "connection_name": "My-Work-Jira",
  "tool_call": {
    "name": "jira_tool.add_comment",
    "arguments": {
      "task_key": "PROJ-123",
      "body": "The analysis is complete. The results are attached."
    }
  }
}

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

# Make the API call to toolstream.dev
response = requests.post(
    "https://toolstream.dev/v1/tools/execute", 
    headers=headers, 
    data=json.dumps(payload)
)

# Pass the result back to your agent for the next step
tool_result = response.json()
print(tool_result)

Your application receives the tool's output, ready to be fed back into your LLM to generate the final, context-aware response for your user.

Handling User Approvals (Human-in-the-Loop)

For sensitive actions, users can require that a tool execution be verified. When this happens, our API will respond with an HTTP 428 Precondition Required status instead of executing the tool.

Your application must be designed to handle this response, present the details to the user for approval, and then resubmit the request with an approval flag.

Example HITL Workflow

1. Initial Request: Your agent attempts to send an email.

# The is_approved_execution flag is omitted or false by default
payload = {
  "connection_name": "My Gmail",
  "tool_call": {
    "name": "gmail_tool.send_email",
    "arguments": { "recipient": "team@example.com", "subject": "Update", "body": "..." }
  }
}
response = requests.post(...)

2. API Response (428): Because the user has flagged `send_email` for verification, Toolstream returns an error.

# response.status_code will be 428
# response.json() will look like this:
{
  "detail": {
    "error": "Human in the Loop Approval Required",
    "message": "The tool 'gmail_tool.send_email' requires user approval...",
    "tool_call": {
      "name": "gmail_tool.send_email",
      "arguments": { "recipient": "team@example.com", ... }
    },
    "remedy": "Re-submit the request with 'is_approved_execution: true'..."
  }
}

3. Application Logic: Your backend handles the error, shows the `tool_call` from the error response to your user, and gets their confirmation.

if response.status_code == 428:
    error_data = response.json().get("detail", {})
    tool_to_approve = error_data.get("tool_call")
    
    # In your application, you would show this to the user in your UI
    print(f"Please approve this action: {tool_to_approve}")
    user_approval = input("Type 'yes' to approve: ")

    if user_approval.lower() == 'yes':
        # Resubmit with the approval flag
        approved_payload = {
            "connection_name": payload["connection_name"],
            "tool_call": tool_to_approve,
            "is_approved_execution": True  # The crucial flag
        }
        
        final_response = requests.post(
            "https://toolstream.dev/v1/tools/execute",
            headers=headers,
            data=json.dumps(approved_payload)
        )
        print("Action approved and executed:", final_response.json())

Ready to Start Building?

Sign up to get your API key and free credits. Explore our tools and start integrating in minutes.

Get Your API Key