{% extends "public/base.html" %} {% block title %}{{ t('docs.page_title') if t else 'API Documentation — AgenticTrade' }}{% endblock %} {% block meta_description %}{{ t('docs.meta_desc') if t else 'AgenticTrade API documentation. Build AI agents that discover and consume API services autonomously with USDC payments. Quick start, SDK, and full endpoint reference.' }}{% endblock %} {% block og_title %}{{ t('docs.page_title') if t else 'API Documentation — AgenticTrade' }}{% endblock %} {% block og_description %}{{ t('docs.subtitle') if t else 'Build AI agents that discover and consume services autonomously. Full API reference with code examples.' }}{% endblock %} {% block tw_title %}{{ t('docs.page_title') if t else 'API Documentation — AgenticTrade' }}{% endblock %} {% block tw_description %}{{ t('docs.subtitle') if t else 'Build AI agents that discover and consume services autonomously. Full API reference with code examples.' }}{% endblock %} {% block json_ld %} {% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{{ t('docs.subtitle') if t else 'Build AI agents that discover and consume services autonomously.' }}
https://agentictrade.io/api/v1
{{ t('docs.quickstart_desc') if t else 'Get your agent calling services in 3 steps:' }}
curl -X POST https://agentictrade.io/api/v1/keys \
-H "Content-Type: application/json" \
-d '{"owner_id": "my-agent-001", "role": "buyer"}'
# Response:
# {"key_id": "acf_a1b2c3...", "secret": "Sp8vKq9w...", "role": "buyer"}
# Save the secret — it won't be shown again!
curl https://agentictrade.io/api/v1/discover
# Returns all active services with pricing, categories, and free tier info
curl -X POST https://agentictrade.io/api/v1/proxy/{service_id}/api/scan \
-H "Authorization: Bearer acf_a1b2c3:Sp8vKq9w..." \
-H "Content-Type: application/json"
# The marketplace handles payment automatically.
# Response headers include billing info:
# X-ACF-Amount: 0.50
# X-ACF-Free-Tier: true
{{ t('docs.auth_desc') if t else 'All authenticated endpoints use Bearer token authentication:' }}
Authorization: Bearer {key_id}:{secret}
{{ t('docs.auth_example') if t else 'Example:' }}
Authorization: Bearer acf_a1b2c3d4e5f6g7h8:Sp8vKq9wRx2yZaA_B1C2D3E4F5G6H7
| {{ t('docs.role_header') if t else 'Role' }} | {{ t('docs.role_can_do') if t else 'Can Do' }} |
|---|---|
buyer | {{ t('docs.role_buyer_desc') if t else 'Call services via proxy, check balance, view usage' }} |
provider | {{ t('docs.role_provider_desc') if t else 'Register and manage services, view earnings' }} |
admin | {{ t('docs.role_admin_desc') if t else 'Full platform access' }} |
| {{ t('docs.tier') if t else 'Tier' }} | {{ t('docs.limit') if t else 'Limit' }} |
|---|---|
| {{ t('docs.tier_default') if t else 'Default' }} | {{ t('docs.requests_per_min_60') if t else '60 requests / minute' }} |
| {{ t('docs.tier_maximum') if t else 'Maximum' }} | {{ t('docs.requests_per_min_300') if t else '300 requests / minute' }} |
{{ svc.description[:120] }}{% if svc.description|length > 120 %}...{% endif %}
{{ svc.id }}
{{ t('docs.endpoint_list_services_desc') if t else 'Returns all registered services with pricing info. No authentication required.' }}
| {{ t('docs.param') if t else 'Param' }} | {{ t('docs.type') if t else 'Type' }} | {{ t('docs.description') if t else 'Description' }} |
|---|---|---|
category | string | {{ t('docs.param_category_desc') if t else 'Filter by category' }} |
query | string | {{ t('docs.param_query_desc') if t else 'Search by name/description' }} |
limit | int | {{ t('docs.param_limit_desc') if t else 'Max results (default: 50)' }} |
offset | int | {{ t('docs.param_offset_desc') if t else 'Pagination offset' }} |
curl https://agentictrade.io/api/v1/services?category=crypto-analysis
{{ t('docs.endpoint_advanced_discovery_desc') if t else 'Enhanced discovery with filtering, sorting, and tag matching.' }}
| {{ t('docs.param') if t else 'Param' }} | {{ t('docs.type') if t else 'Type' }} | {{ t('docs.description') if t else 'Description' }} |
|---|---|---|
tags | string | {{ t('docs.param_tags_desc') if t else 'Comma-separated tag filter' }} |
min_price | float | {{ t('docs.param_min_price_desc') if t else 'Minimum price per call' }} |
max_price | float | {{ t('docs.param_max_price_desc') if t else 'Maximum price per call' }} |
sort | string | {{ t('docs.param_sort_desc') if t else 'Sort by: price, name, created' }} |
curl "https://agentictrade.io/api/v1/discover?tags=crypto&max_price=1.0&sort=price"
{{ t('docs.endpoint_list_categories_desc') if t else 'Returns available service categories with service counts.' }}
curl https://agentictrade.io/api/v1/discover/categories
{{ t('docs.proxy_desc') if t else 'Proxies your request to the service provider. Supports GET, POST, PUT, PATCH, DELETE.' }}
| {{ t('docs.param') if t else 'Param' }} | {{ t('docs.description') if t else 'Description' }} |
|---|---|
service_id | {{ t('docs.param_service_id_desc') if t else 'UUID of the target service' }} |
path | {{ t('docs.param_path_desc') if t else 'The API path on the provider' }} (e.g., api/scan) |
| {{ t('docs.header') if t else 'Header' }} | {{ t('docs.description') if t else 'Description' }} |
|---|---|
X-ACF-Usage-Id | {{ t('docs.header_usage_id_desc') if t else 'Unique usage record ID' }} |
X-ACF-Amount | {{ t('docs.header_amount_desc') if t else 'Amount charged (USDC)' }} |
X-ACF-Free-Tier | true {{ t('docs.header_free_tier_desc') if t else 'if free tier was used' }} |
X-ACF-Latency-Ms | {{ t('docs.header_latency_desc') if t else 'Request latency in milliseconds' }} |
curl -H "Authorization: Bearer {key_id}:{secret}" \
"https://agentictrade.io/api/v1/proxy/{{ demo_service_id }}/api/demo"
# Returns real-time crypto scan results
curl -X POST -H "Authorization: Bearer {key_id}:{secret}" \
"https://agentictrade.io/api/v1/proxy/{{ scanner_service_id }}/api/scan"
# Triggers a full market scan with your strategy
curl -X POST -H "Authorization: Bearer {key_id}:{secret}" \
-H "Content-Type: application/json" \
-d '{"symbol": "BTC/USDT", "strategy": "bb_squeeze", "timeframe": "4h"}' \
"https://agentictrade.io/api/v1/proxy/{{ backtest_service_id }}/api/backtest"
# Returns win rate, profit factor, equity curve, trade list
{{ t('docs.endpoint_usage_stats_desc') if t else 'Returns total calls, spend, and average latency for the authenticated buyer.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/usage/me
# {"buyer_id": "my-agent", "total_calls": 42, "total_spent_usd": "12.50", "avg_latency_ms": 35}
{{ t('docs.billing_desc') if t else 'Services are pre-paid. Deposit funds to your account, then call services.' }}
curl https://agentictrade.io/api/v1/balance/my-agent-001
# {"buyer_id": "my-agent-001", "balance": 50.0, "total_deposited": 100.0, "total_spent": 50.0}
{{ t('docs.add_funds_desc') if t else 'Creates a crypto payment invoice via NOWPayments. Supports USDT, USDC, BTC, ETH, and 100+ cryptocurrencies.' }}
curl -X POST https://agentictrade.io/api/v1/deposits \
-H "Content-Type: application/json" \
-d '{"buyer_id": "my-agent-001", "amount": 50}'
# {"deposit_id": "...", "amount": 50, "status": "pending",
# "checkout_url": "https://nowpayments.io/payment/?iid=...",
# "message": "Pay $50 at the checkout URL..."}
{{ t('docs.add_funds_note') if t else 'After payment confirms, your balance is automatically credited via IPN webhook.' }}
| {{ t('docs.field') if t else 'Field' }} | {{ t('docs.type') if t else 'Type' }} | {{ t('docs.required') if t else 'Required' }} | {{ t('docs.description') if t else 'Description' }} |
|---|---|---|---|
owner_id | string | {{ t('docs.yes') if t else 'Yes' }} | {{ t('docs.field_owner_id_desc') if t else 'Your agent/user identifier' }} |
role | string | {{ t('docs.no') if t else 'No' }} | {{ t('docs.field_role_desc') if t else 'buyer (default) or provider' }} |
curl -X POST https://agentictrade.io/api/v1/keys \
-H "Content-Type: application/json" \
-d '{"owner_id": "my-trading-bot", "role": "buyer"}'
# {"key_id": "acf_...", "secret": "...", "role": "buyer", "rate_limit": 60}
# IMPORTANT: Save the secret! It cannot be retrieved later.
{{ t('docs.provider_desc') if t else 'Endpoints for service providers to manage their services, view earnings, and track health. All require provider-role authentication.' }}
{{ t('docs.endpoint_provider_overview_desc') if t else 'Returns service count, total calls, revenue, and settlement status for the authenticated provider.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/provider/dashboard
{{ t('docs.endpoint_list_your_services_desc') if t else 'Returns all services owned by the authenticated provider with usage stats.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/provider/services
{{ t('docs.endpoint_service_analytics_desc') if t else 'Detailed analytics for a specific service: total calls, revenue, success rate, daily breakdown.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/provider/services/{service_id}/analytics
{{ t('docs.endpoint_earnings_desc') if t else 'Returns total earned, settled, pending amounts, and settlement history.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/provider/earnings
{{ t('docs.endpoint_health_scores_desc') if t else 'Returns health scores for all your services based on latency, error rate, and uptime.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/provider/health
{{ t('docs.endpoint_test_service_desc') if t else 'Tests connectivity to your service endpoint. Returns reachability, latency, and status code.' }}
curl -X POST -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/provider/services/{service_id}/test
{{ t('docs.endpoint_onboarding_desc') if t else 'Track your onboarding progress: API key creation, service registration, first traffic, first settlement.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/provider/onboarding
{{ t('docs.settlements_desc') if t else 'Admin endpoints for managing provider payouts.' }}
{{ t('docs.endpoint_create_settlement_desc') if t else 'Creates a new settlement for a provider. Requires admin role.' }}
curl -X POST -H "Authorization: Bearer {key_id}:{secret}" \
-H "Content-Type: application/json" \
-d '{"provider_id": "prov-001", "period_start": "2026-01-01", "period_end": "2026-02-01"}' \
https://agentictrade.io/api/v1/settlements
{{ t('docs.endpoint_list_settlements_desc') if t else 'Lists all settlements, optionally filtered by provider or status.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/settlements
{{ t('docs.endpoint_execute_payment_desc') if t else 'Marks a settlement as paid and triggers the on-chain transfer.' }}
curl -X PATCH -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/settlements/{settlement_id}/pay
{{ t('docs.referrals_desc') if t else 'Referral program endpoints for generating and tracking referral codes.' }}
{{ t('docs.endpoint_create_referral_desc') if t else 'Generates a unique referral code for the authenticated user.' }}
curl -X POST -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/referrals/code
{{ t('docs.endpoint_apply_referral_desc') if t else 'Apply a referral code during registration to link accounts.' }}
curl -X POST -H "Content-Type: application/json" \
-d '{"code": "REF-ABC123"}' \
https://agentictrade.io/api/v1/referrals/apply
{{ t('docs.endpoint_list_referrals_desc') if t else 'Lists all referrals made by the authenticated user.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/referrals
{{ t('docs.endpoint_referral_stats_desc') if t else 'Aggregated referral statistics: total referrals, conversion rate, and earnings.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/referrals/stats
{{ t('docs.webhooks_desc') if t else 'Subscribe to real-time event notifications.' }}
{{ t('docs.endpoint_create_webhook_desc') if t else 'Registers a new webhook endpoint to receive event notifications.' }}
| {{ t('docs.field') if t else 'Field' }} | {{ t('docs.type') if t else 'Type' }} | {{ t('docs.description') if t else 'Description' }} |
|---|---|---|
url | string | {{ t('docs.webhook_url_desc') if t else 'HTTPS endpoint to receive events' }} |
events | array | {{ t('docs.webhook_events_desc') if t else 'Event types to subscribe' }}: usage.created, settlement.completed, etc. |
curl -X POST -H "Authorization: Bearer {key_id}:{secret}" \
-H "Content-Type: application/json" \
-d '{"url": "https://myapp.com/webhooks", "events": ["usage.created"]}' \
https://agentictrade.io/api/v1/webhooks
{{ t('docs.endpoint_list_webhooks_desc') if t else 'Lists all registered webhooks for your account.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/webhooks
{{ t('docs.endpoint_delete_webhook_desc') if t else 'Removes a webhook subscription.' }}
curl -X DELETE -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/webhooks/{webhook_id}
{{ t('docs.audit_desc') if t else 'Security audit endpoints for tracking platform activity. Requires admin role.' }}
{{ t('docs.endpoint_audit_log_desc') if t else 'Returns the security audit log with filtering options.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/admin/audit
{{ t('docs.endpoint_audit_summary_desc') if t else 'Aggregated audit statistics: event counts by type and time period.' }}
curl -H "Authorization: Bearer {key_id}:{secret}" \
https://agentictrade.io/api/v1/admin/audit/summary
{{ t('docs.sdk_desc') if t else 'Use the bundled SDK for seamless integration:' }}
from sdk.client import ACFClient client = ACFClient( base_url="https://agentictrade.io", api_key="acf_xxx:secret_yyy", ) # Discover services services = client.list_services(category="crypto-analysis") # Call a service through the proxy result = client.proxy( service_id="{{ scanner_service_id }}", path="api/scan", method="POST", ) print(result["results"])
{{ t('docs.agent_guide_desc') if t else 'How an autonomous agent uses AgenticTrade:' }}
GET /api/v1/discover — {{ t('docs.agent_step1_desc') if t else 'finds services matching its task.' }}
GET /api/v1/balance/{buyer_id} — {{ t('docs.agent_step2_desc') if t else 'ensures sufficient funds.' }}
POST /api/v1/proxy/{service_id}/{path} — {{ t('docs.agent_step3_desc') if t else 'marketplace handles payment.' }}
{{ t('docs.agent_step4_desc') if t else 'Response body from the provider + billing headers from the marketplace.' }}
| {{ t('docs.pricing_service') if t else 'Service' }} | {{ t('docs.pricing_price') if t else 'Price' }} | {{ t('docs.pricing_free_tier') if t else 'Free Tier' }} | {{ t('docs.pricing_payment') if t else 'Payment' }} |
|---|---|---|---|
| {{ svc.name }} | {% if svc.price_per_call == 0 or svc.price_per_call == '0' or svc.price_per_call == '0.0' %} {{ t('docs.pricing_free') if t else 'FREE' }} {% else %} ${{ svc.price_per_call }} USDC {% endif %} | {% if svc.free_tier_calls %}{{ svc.free_tier_calls }} {{ t('docs.pricing_calls') if t else 'calls' }}{% else %}{{ t('docs.pricing_always_free') if t else 'Always free' }}{% endif %} | {{ t('docs.pricing_crypto') if t else 'Crypto (100+ coins)' }} |