Skip to main content

Official Python SDK for NEXUS AI Agent Marketplace - Discover, test, and integrate APIs for AI agents

Project description

NEXUS AI Agent Marketplace - Python SDK

The official Python SDK for integrating AI agents with the NEXUS marketplace. Discover, test, and use 29+ premium APIs with simple pay-per-request pricing.

Features

  • 🔍 Service Discovery - Search and filter 29+ production-ready APIs
  • 🆓 Free Sandbox - 50 free calls per tool to test before you pay
  • 💰 Pay-per-Request - Only pay for what you use with x402 payments
  • 🔌 MCP Compatible - Works with any MCP-compatible agent
  • Async Support - Both sync and async clients available
  • 🔗 Framework Integration - LangChain, LlamaIndex, AutoGPT ready

Installation

pip install nexus-agent-sdk

For async support:

pip install nexus-agent-sdk[async]

Quick Start

from nexus_sdk import NexusClient

# Initialize client
client = NexusClient()

# Discover available tools
tools = client.list_tools()
print(f"Found {len(tools['tools'])} tools")

# Try a tool for free (sandbox mode)
result = client.execute_sandbox(
    tool_name="weather-forecast-api",
    parameters={"location": "San Francisco"},
    agent_id="my-agent-001"
)
print(result)

Available APIs

Category Examples Price Range
AI/ML Sentiment, Translation, NER, Summarization 0.4 - 2.0 credits
Finance Crypto prices, Stock data, Forex rates 0.1 - 0.5 credits
Data News, Company info, WHOIS lookup 0.2 - 1.5 credits
Utility Weather, Geocoding, Email validation 0.1 - 0.8 credits
Communication SMS, Email sending 0.5 - 2.0 credits

Usage Examples

Search for Services

# Search by keyword
results = client.search(query="weather")

# Filter by category
ai_services = client.search(category="ai")

# Get sandbox-enabled services only
free_to_try = client.search(sandbox=True)

# Combined filters
results = client.search(
    protocol="mcp",
    category="finance",
    max_price=1.0,
    limit=10
)

Use Sandbox (Free Tier)

Every tool offers 50 free sandbox calls:

# No payment required!
result = client.execute_sandbox(
    tool_name="sentiment-analysis",
    parameters={"text": "I love this product!"},
    agent_id="my-agent"
)

print(result)
# {'sentiment': 'positive', 'score': 0.95, 'remaining_calls': 49}

Make Paid Calls

# Generate payment proof
proof = client.generate_payment_proof(
    agent_id="my-agent",
    amount=0.5
)

# Execute with payment
result = client.execute_tool(
    tool_name="weather-forecast-api",
    parameters={"location": "Tokyo"},
    agent_id="my-agent",
    payment_proof=proof['proof']
)

Async Client

import asyncio
from nexus_sdk import AsyncNexusClient

async def main():
    async with AsyncNexusClient() as client:
        # All methods are async
        tools = await client.list_tools()
        result = await client.execute_sandbox(
            tool_name="crypto-price-tracker",
            parameters={"symbol": "BTC"},
            agent_id="async-agent"
        )
        print(result)

asyncio.run(main())

Framework Integrations

LangChain

from langchain.tools import Tool
from nexus_sdk import NexusClient

client = NexusClient()

# Create LangChain tools from NEXUS services
tools = []
for service in client.list_tools()['tools']:
    tool = Tool(
        name=service['name'],
        description=service['description'],
        func=lambda params, sid=service['service_id']: 
            client.execute_sandbox(sid, params, "langchain-agent")
    )
    tools.append(tool)

LlamaIndex

from llama_index.tools import FunctionTool
from nexus_sdk import NexusClient

client = NexusClient()

tools = []
for service in client.list_tools()['tools']:
    tool = FunctionTool.from_defaults(
        fn=lambda **kwargs: client.execute_sandbox(
            service['service_id'], kwargs, "llamaindex-agent"
        ),
        name=service['name'],
        description=service['description']
    )
    tools.append(tool)

API Reference

Client Methods

Method Description
list_tools() List all available MCP tools
search(**filters) Search services with filters
execute_sandbox(tool, params, agent_id) Free sandbox call
execute_tool(tool, params, agent_id, proof) Paid tool execution
trending(limit) Get trending services
get_service(id) Get service details
get_service_metrics(id) Get usage metrics

Error Handling

from nexus_sdk import NexusClient, NexusError, NexusRateLimitError

client = NexusClient()

try:
    result = client.execute_sandbox(...)
except NexusRateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
except NexusError as e:
    print(f"Error: {e.message}")

Getting Started Credits

New agents automatically receive 100 free credits on first API call, plus 50 free sandbox calls per tool. No credit card required!

Support

License

MIT License - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexus_agent_sdk-1.0.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexus_agent_sdk-1.0.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file nexus_agent_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: nexus_agent_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for nexus_agent_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 86b2ccb0d6d3286286e5eee34c49c379a6ed89e126d90db943a577c825dcfb4d
MD5 e63789c28429994fd8ad3c5754cbd681
BLAKE2b-256 3134423cda8aeb3b15602684a4091c8cd992b8d244125e0f988a7bde8d818ed6

See more details on using hashes here.

File details

Details for the file nexus_agent_sdk-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nexus_agent_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26782192b089d1f3ab3e13e775037c1c5e2497ac5d840de4f0aa3d31a9dd5fa1
MD5 73958dcaf9cdfde4e28838ae06bafaa3
BLAKE2b-256 2c2674806b2296e93484a3279d30c91bf80ee49265882589ced3152258e12b79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page