Pay-As-You-Go APIs for Autonomous AI Agents

Equip your LLM agents and workflows with on-demand access to 1,400+ public API integrations. Define prices, manage developer credits, and cash out instantly with Pakistan's native Easypaisa checkout.

Core Middleware
Micro-Payment Proxy

Every API request from your AI agents is routed through our low-latency gateway. It checks API keys, validates balances, routes requests, and deducts credits in real-time.

Payment gateway
Easypaisa Wallet Native

Fully integrated checkout enabling Pakistani developers to fund accounts using Easypaisa Mobile Wallet. Supports secure hash checking and server-to-server callbacks.

Developer Centric
Dynamic Admin Controls

Administrative portal to view entire call histories, track individual API popularity, configure profit margins, and update prices per call in real time.

API Catalog

Search and view pricing for all active API integrations connected to the proxy gateway.

๐Ÿ”

Welcome to AgentAPIs

Register or log in to manage your AI agent keys and top up credits.

Tip: Admin users can log in using admin@apimarket.com and password admin123.

Developer Portal

Configure credentials, test API endpoints, and view logs.

Gateway Authorization

Use this key inside your LLM agent's HTTP request header to authenticate proxy routing.

agent_key_placeholder ๐Ÿ“‹

๐Ÿ”’ Safety Instruction for Agents

Instruct your AI Agents to check their remaining wallet balance using metadata response headers. If the headers contain X-Agent-Remaining-Balance and the amount drops below 5 PKR, direct the agent to notify the user via chat dialog to avoid runtime failures.

Interactive Code Sandbox

Perform real API tests through the proxy and watch the balance decrement instantly.

Code Client snippet

                                
Output terminal
// Run a test request on the left to see the output format...

Recent Proxy Logs

Audit log for your API keys detailing request types, responses, and charges.

API Called Status Code Charged Cost Time (UTC)

Admin Catalog Manager

Adjust individual prices per call, view overall transaction metrics, and manage user limits.

Set Cost per API Call

API Integration Cost per Call Actions

Global System Usage Log

User API Status Cost Date

Integration Guide

Configure your LLMs, LangChain agents, or custom backend services to query the marketplace proxy.

1. Base URL & Header Credentials

All proxy endpoints use the standard marketplace host base. You must attach your custom developer key as an HTTP header name: X-Agent-API-Key.

Header Key: X-Agent-API-Key
Base Request Endpoint: http://127.0.0.1:8000/api/proxy/{API_NAME}

2. Error Handlers

If an API request fails, the proxy forwards the original error status code where possible. However, if the agent runs out of wallet balance, the proxy returns a specific 402 Payment Required code.

Status Code Error Description Remediation Step
401 Unauthorized: API Key is invalid or missing. Ensure the header X-Agent-API-Key matches the key in your developer dashboard.
402 Payment Required: Wallet balance is below the per-call price of target API. Prompt user to top up credits in PKR using Easypaisa.
404 Not Found: Target API name does not exist in seed. Open the explore tab and double check spelling of API name.

3. LangChain Example Integration

Implement a custom python function inside LangChain tools or custom tools to make the call:

from langchain.agents import tool
import requests

@tool
def call_marketplace_api(api_name: str, query_params: dict = None) -> str:
    """Call a marketplace public API and pay per use. api_name should match explore catalog."""
    url = f"http://127.0.0.1:8000/api/proxy/{api_name}"
    headers = {
        "X-Agent-API-Key": "YOUR_DEVELOPER_API_KEY"
    }
    
    try:
        response = requests.get(url, headers=headers, params=query_params)
        if response.status_code == 402:
            return "Payment Required: Please notify user to top up their Easypaisa wallet."
        return response.text
    except Exception as e:
        return f"Error connecting to proxy: {str(e)}"