Autenticación, endpoints del gateway y arranque rápido con curl — mismo lenguaje visual que la home.
Base URL: https://api.agentflowhub.com
All requests require an API key. Send it in one of these headers:
Authorization: Bearer afhub_live_abc123 # or X-API-Key: afhub_live_abc123
All responses include gateway metadata in headers:
X-Gateway: agentflow X-Gateway-Plan: pro X-Gateway-Latency: 142ms X-RateLimit-Limit: 60 X-RateLimit-Remaining: 58 X-RateLimit-Reset: 1711540800
/gateway/agent-farmfree/gateway/agent-farmfree/gateway/agentsfree/gateway/agents/:idfree/gateway/agentspro/gateway/agents/:idpro/gateway/modelsfree/gateway/modelsfree/gateway/embeddings/embedpro/gateway/embeddings/searchpro/gateway/embeddings/uploadpro/gateway/embeddings/ragpro/gateway/embeddings/stats/:agentIdpro/gateway/embeddings/files/:agentIdpro/gateway/embeddings/filepro/gateway/agent-farmfree/gateway/analyze-healthfree/gateway/analyze-plethysmographyfree# 1. Get your API key from /dashboard
# 2. Execute an agent
curl -X POST https://api.agentflowhub.com/gateway/agent-farm \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent": "health-monitor", "input": {"spo2": 98, "heartRate": 72}}'
# 3. Generate embeddings
curl -X POST https://api.agentflowhub.com/gateway/embeddings/embed \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"texts": ["Water quality in rural areas"]}'
# 4. RAG query
curl -X POST https://api.agentflowhub.com/gateway/embeddings/rag \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agentId": "AGENT_ID", "query": "What are the safe pH levels?"}'
# 5. Check your usage
curl https://api.agentflowhub.com/api/gateway/usage \
-H "Authorization: Bearer YOUR_API_KEY"Comandos curl para crear los productos y precios de suscripción via API de Stripe. Reemplaza $SK con tu STRIPE_SECRET_KEY.
# Paso 1 — crear producto PROD=$(curl -s https://api.stripe.com/v1/products \ -u "$SK:" -d "name=Starter" | grep -o '"id": "prod_[^"]*"' | cut -d'"' -f4) # Paso 2 — crear precio recurrente curl -s https://api.stripe.com/v1/prices \ -u "$SK:" \ -d "product=$PROD" \ -d "unit_amount=1900" \ -d "currency=usd" \ -d "recurring[interval]=month" \ -d "nickname=Starter" # → guarda el "id": "price_..." del response
PROD=$(curl -s https://api.stripe.com/v1/products \ -u "$SK:" -d "name=Growth" | grep -o '"id": "prod_[^"]*"' | cut -d'"' -f4) curl -s https://api.stripe.com/v1/prices \ -u "$SK:" \ -d "product=$PROD" \ -d "unit_amount=4900" \ -d "currency=usd" \ -d "recurring[interval]=month" \ -d "nickname=Growth"
PROD=$(curl -s https://api.stripe.com/v1/products \ -u "$SK:" -d "name=Business" | grep -o '"id": "prod_[^"]*"' | cut -d'"' -f4) curl -s https://api.stripe.com/v1/prices \ -u "$SK:" \ -d "product=$PROD" \ -d "unit_amount=12900" \ -d "currency=usd" \ -d "recurring[interval]=month" \ -d "nickname=Business"
curl -s https://api.stripe.com/v1/prices?active=true \ -u "$SK:" | grep -E '"id"|"nickname"|"unit_amount"|"active"'
# En .env: STRIPE_PRICE_STARTER=price_1TJMpV2dx33YwrpgWgTjdajP STRIPE_PRICE_GROWTH=price_1TJMpj2dx33YwrpgGzX9mZ9J STRIPE_PRICE_BUSINESS=price_1TJMpk2dx33YwrpgebJGEbUx # Reiniciar servidor para que tome los nuevos valores npm run dev
Incrusta un widget de conversación en cualquier página HTML con el script y una llamada a AgentFlowhub.init.
<script src="https://hub.agentflowhub.com/widget.js"></script>
<script>
window.AgentFlowhub.init({
agentId: "YOUR_AGENT_ID",
token: "YOUR_WIDGET_TOKEN",
theme: "dark",
position: "bottom-right"
});
</script>