Skip to main content

⚠️ Solace Agent Mesh plugins in Python are now deprecated

👋 Thank you to everyone who's used the Solace Agent Mesh plugins! This Python version is now deprecated — it's no longer under active development and won't receive new features, bug fixes or security updates.

🚀 Check out the new version of Solace Agent Mesh → https://docs.solace.com/Agent-Mesh/agent-mesh.htm

🖥️ A free edition of the Solace Agent Mesh desktop app is available: https://solace.com/products/agent-mesh/download

These packages remain installable; the repository will be archived (read-only) for reference.

Rest Gateway SAM Plugin

About Solace Agent Mesh

Solace Agent Mesh (SAM) is an open-source framework for building event-driven, multi-agent AI systems where specialized agents collaborate on complex tasks. It provides a standardized way for agents to communicate, share data, and integrate with external systems while keeping components loosely coupled and production-ready.

SAM helps you:

  • Build event-driven multi-agent systems on Solace Event Mesh
  • Connect agents, tools, gateways, and services through a common runtime
  • Extend projects with installable plugins such as sam-rest-gateway

Learn more in the Solace Agent Mesh documentation and the main project repository.

Overview

The Solace Agent Mesh (SAM) REST API Gateway provides a standard, robust, and secure HTTP-based entry point for programmatic and system-to-system integrations. It allows external clients to submit tasks to SAM agents, manage files, and discover agent capabilities using a familiar RESTful interface.

The gateway is designed to be highly configurable and supports two distinct operational modes to cater to both modern, asynchronous workflows and legacy, synchronous systems.

Key Features

  • Dual API Versions: Supports both a modern asynchronous API (v2) and a deprecated synchronous API (v1) for backward compatibility.
  • Asynchronous by Default: The v2 API uses a "202 Accepted + Poll" pattern, ideal for long-running agent tasks.
  • Delegated Authentication: Integrates with an external authentication service via bearer tokens for secure access.
  • File Handling: Supports file uploads for tasks and provides download URLs for generated artifacts.
  • Dynamic Configuration: All gateway behaviors, including server settings and authentication, are configured via the main SAM Host YAML file.

Installation

Once the plugin is installed (e.g., from PyPI or a local wheel file):

sam plugin add <your-new-component-name> --plugin sam-rest-gateway

This will create a new component configuration at configs/plugins/<your-new-component-name-kebab-case>.yaml.

Configuration

The gateway is configured within the app_config section of its app definition in your main SAM Host YAML file.

Example Configuration:

# In your main SAC config file, under the 'apps:' list
- name: my_rest_gateway_app
  app_module: solace_agent_mesh.gateway.rest.app
  app_base_path: src
  broker:
    # Standard A2A Control Plane broker connection details
    <<: *broker_connection
  app_config:
    # --- Base Gateway Config ---
    namespace: "my-org/dev"
    gateway_id: "rest-gw-01"
    artifact_service:
      type: "filesystem"
      base_path: "/tmp/sam_artifacts"
    identity_service:
      type: "local_file"
      file_path: "config/users.json"

    # --- REST Gateway Specific Config ---
    rest_api_server_host: "0.0.0.0"
    rest_api_server_port: 8080
    sync_mode_timeout_seconds: 60 # Timeout for the v1 synchronous API

    # --- Authentication Config ---
    enforce_authentication: true
    external_auth_service_url: "http://my-auth-server:8080"

Configuration Parameters

  • rest_api_server_host (string, optional, default: "127.0.0.1"): Host address for the embedded FastAPI server.
  • rest_api_server_port (integer, optional, default: 8080): Port for the embedded FastAPI server.
  • sync_mode_timeout_seconds (integer, optional, default: 60): Timeout in seconds for synchronous v1 API calls.
  • enforce_authentication (boolean, optional, default: false): If true, all API endpoints (except /health and /api/health) will require a valid bearer token.
  • external_auth_service_url (string, optional): URL of the external authentication service for token validation. Required if enforce_authentication is true.

API Documentation

The REST Gateway provides interactive API documentation (Swagger UI) for both of its API versions. The documentation is generated automatically from the code and is the single source of truth for all endpoints, parameters, and data models.

v2 API (Asynchronous)

The v2 API is the recommended interface for all new integrations. It is non-blocking and suitable for tasks of any duration.

Workflow:

  1. Client sends POST /api/v2/tasks with the agent task details.
  2. Gateway immediately responds with 202 Accepted and a taskId.
  3. Client polls GET /api/v2/tasks/{taskId} until it receives a 200 OK with the final result.
  4. If the result contains artifacts, the client uses the endpoints under /api/v2/artifacts to download them.

v1 API (Legacy, Synchronous - DEPRECATED)

The v1 API is provided for backward compatibility with systems that cannot handle an asynchronous workflow. It is not recommended for new development and may be removed in a future version.

Workflow:

  1. Client sends POST /api/v1/invoke with the agent task details.
  2. The gateway holds the HTTP connection open, waiting for the agent to complete the task.
  3. The gateway returns a 200 OK with the final result in the response body, including any artifact content embedded as base64.

Warning: This endpoint is subject to the sync_mode_timeout_seconds configuration and is not suitable for long-running tasks.

Health Check

The gateway provides a health check endpoint to verify its operational status. This endpoint bypasses authentication.

  • URL: http://localhost:8080/health
  • Alternate URL (for backward compatibility): http://localhost:8080/api/health

Metadata

Release files for sam-rest-gateway 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for sam-rest-gateway 0.2.3
File Interpreter ABI Platform
sam_rest_gateway-0.2.3-py3-none-any.whl Python 3 none any Details

Release files / sam_rest_gateway-0.2.3-py3-none-any.whl

Download URL sam_rest_gateway-0.2.3-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
506f807a2f2b59938d3dd85a3bf0155001c9e3a769a1c4294e065f10a5c7eefd
BLAKE2b-256 checksum
How to use checksums
a2153c7eda4a3526f8fdc8c47b293603dc0f3688d4b53de991c7e61cf97fdab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.3 This release

1 release file

0.2.1

1 release file

0.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page