v1.2.0 · Live

API Documentation|

Your agent, accessible via a simple HTTP API. Authenticate once, chat forever.

Base URL: sch-provision-api.onrender.com
Auth: X-API-Key header
Format: JSON

Quickstart

Your API key starts with sch_prod_. Find it in your dashboard after activation.

cURL

bash
curl -X POST https://sch-provision-api.onrender.com/v1/agents/YOUR_AGENT_ID/chat \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello, what can you help me with?"}'

Python (httpx)

python
import httpx

r = httpx.post(
    "https://sch-provision-api.onrender.com/v1/agents/YOUR_AGENT_ID/chat",
    headers={"X-API-Key": "YOUR_API_KEY"},
    json={"message": "Hello, what can you help me with?"},
)
print(r.json()["response"])

JavaScript (fetch)

javascript
const res = await fetch(
  "https://sch-provision-api.onrender.com/v1/agents/YOUR_AGENT_ID/chat",
  {
    method: "POST",
    headers: { "X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json" },
    body: JSON.stringify({ message: "Hello!" }),
  }
);
const data = await res.json();
console.log(data.response);
🔑

Authentication

Pass your API key in every request via the X-API-Key header:

http
X-API-Key: sch_prod_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ℹ️API keys begin with sch_prod_. Never expose your key in client-side code. If compromised, contact syntaxcraftershub@gmail.com for immediate revocation.

Error Codes

StatusMeaningAction
401Invalid or expired API keyCheck your key in the dashboard
402Token quota exhaustedUpgrade your plan
403Key not authorised for this agentUse the correct agent ID
422Validation errorCheck request body fields
429Rate limit exceededSlow down — see rate limits
502Inference engine unreachableRetry after a few seconds

All errors return JSON: {"success": false, "error": "description"}

💚

GET /health

GET
/health
Render health check — confirms backend is alive

Response

json
{
  "status": "ok",
  "version": "1.2.0"
}
💡Use this endpoint to pre-warm the Render instance before showing the dashboard. Expect ~30s cold start on free tier.

POST /v1/agents/{agent_id}/chat

POST
/v1/agents/{agent_id}/chat
Send a message to your agent and receive a response

Headers

HeaderRequiredValue
X-API-KeyyesYour sch_prod_… key
Content-Typeyesapplication/json

Request body

FieldTypeRequiredDescription
messagestringyesThe user message to send
session_idstringnoOptional session ID for context grouping
contextobjectnoAdditional key-value context for the agent

Response

json
{
  "response":         "Hello! I can help you with...",
  "tokens_used":      312,
  "tokens_remaining": 499688,
  "latency_ms":       1204
}

cURL example

bash
curl -X POST https://sch-provision-api.onrender.com/v1/agents/AGENT_ID/chat \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Summarise my last 5 support tickets","session_id":"sess_abc123"}'
📊

GET /usage

GET
/usage
Token usage, quota and recent call history for your agent

Response

json
{
  "plan":             "starter",
  "tokens_allocated": 500000,
  "tokens_used":      12500,
  "tokens_remaining": 487500,
  "pct_used":         2.5,
  "expires_at":       "2026-07-01T00:00:00+00:00",
  "status":           "active",
  "recent_calls": [
    {
      "tokens":          312,
      "latency_ms":      1204,
      "created_at":      "2026-05-10T09:30:00Z",
      "message_preview": "Hello, what can you..."
    }
  ]
}

POST /provision

POST
/provision
Create a new agent (status = pending_payment until payment verified)

Request body

FieldTypeRequiredDescription
planstringyesstarter | growth | enterprise
deployment_typestringyescloud | local | hybrid
expiry_monthsintegeryes1–24
problem_descriptionstringyesWhat will this agent do?
client_emailstringnoReceives activation email
client_namestringnoDisplay name

Response

json
{
  "agent_id":         "a1b2c3d4e5f6a7b8",
  "api_key":          "sch_prod_...",
  "endpoint_url":     "https://sch-provision-api.onrender.com/v1/agents/a1b2c3d4e5f6a7b8/chat",
  "plan":             "starter",
  "tokens_allocated": 500000,
  "expires_at":       "2026-06-18T00:00:00+00:00",
  "status":           "pending_payment"
}
🔐

POST /auth/send-otp

POST
/auth/send-otp
Send a one-time password to an email for dashboard authentication
Rate-limited to 5 requests / 15 minutes per email address.

Request body

FieldTypeRequiredDescription
emailstringyesRecipient email address

Response

json
{ "success": true, "message": "OTP sent" }

POST /api/create-order

POST
/api/create-order
Create a Razorpay order for agent payment

Request body

FieldTypeRequiredDescription
planstringyesstarter | growth | enterprise
agent_idstringyesAgent ID from /provision

Response

json
{
  "order_id": "order_PxyzABC123",
  "amount":   1900,
  "currency": "USD",
  "key_id":   "rzp_live_..."
}

Amount is in cents ($1 = 100 cents). Pass order_id and key_id directly to the Razorpay JS SDK checkout.

POST /api/verify-payment

POST
/api/verify-payment
HMAC-SHA256 verify Razorpay signature → activate agent

Request body

FieldTypeRequiredDescription
razorpay_order_idstringyesFrom create-order response
razorpay_payment_idstringyesFrom Razorpay success handler
razorpay_signaturestringyesHMAC-SHA256 signature from Razorpay
agent_idstringyesAgent to activate

Response (success)

json
{
  "success": true,
  "message": "Payment verified. Agent is now active.",
  "status":  "active"
}
↩️

POST /api/refund

POST
/api/refund
Initiate a refund for a completed payment (admin-gated)
This endpoint requires admin authorisation. Contact syntaxcraftershub@gmail.com to initiate a refund.

Request body

FieldTypeRequiredDescription
payment_idstringyesRazorpay payment_id to refund
amountintegernoPartial refund amount in cents (omit for full)
reasonstringnoReason for refund

Response

json
{
  "success":   true,
  "refund_id": "rfnd_PxyzABC123",
  "amount":    99900,
  "status":    "processed"
}
🧾

GET /api/invoice/{agent_id}

GET
/api/invoice/{agent_id}
Download PDF invoice for a paid agent subscription

Path params

ParamDescription
agent_idThe 16-hex agent identifier

Response

Returns application/pdf with the invoice for the agent's most recent payment. Requires X-API-Key header matching the agent.

bash
curl https://sch-provision-api.onrender.com/api/invoice/AGENT_ID \
  -H "X-API-Key: YOUR_KEY" \
  --output invoice.pdf
🔌

MCP Server — run workflows from Claude & Cursor

Every active workflow on your agent is automatically exposed as an MCP tool. Connect Claude Desktop, Claude Code or Cursor to your agent and they can list and run your workflows directly — same run history, approval gates and token accounting as running them from the dashboard. Workflows in draft status stay private; flipping one to active is what publishes it.

Endpoint & auth

http
POST https://sch-provision-api.onrender.com/mcp
Authorization: Bearer sch_prod_YOUR_API_KEY   (or X-API-Key header)

Stateless Streamable HTTP JSON-RPC. Your agent API key is the credential — the same active/expiry gate as the chat endpoint applies.

Claude Code (one command)

bash
claude mcp add --transport http agonix \
  https://sch-provision-api.onrender.com/mcp \
  --header "Authorization: Bearer sch_prod_YOUR_API_KEY"

Claude Desktop / Cursor (config JSON)

json
{
  "mcpServers": {
    "agonix": {
      "type": "http",
      "url": "https://sch-provision-api.onrender.com/mcp",
      "headers": { "Authorization": "Bearer sch_prod_YOUR_API_KEY" }
    }
  }
}

What the client sees

Each active workflow appears as a tool named wf_<id>_<name> accepting a free-form JSON object as the workflow's trigger input. A call returns the run id, success flag, tokens used and node outputs. If the workflow hits an approval node, the call returns paused_for_approval: true and the run waits for your approve/reject in the dashboard — a human stays in the loop even when another AI triggered the run.

🧠

AI layer & data

Which model runs your agent depends on its plan. Free tiers route to a fast open model with automatic fallbacks so a single provider outage never takes your agent down; enterprise routes to Anthropic Claude.

PlanPrimary modelFallback order
trial / starter / growthNVIDIA NIM · Llama 3.3 70B→ Gemini Flash → Claude
enterpriseAnthropic Claude Sonnet→ Gemini Pro

Token accounting. Every call sums input + output (+ cache) tokens against your monthly allocation. Past the allocation you may continue into overage at $0.002 / 1,000 tokens up to a hard ceiling of 2× your quota, after which the agent returns 402 until you upgrade or the quota renews. Usage is visible in real time at GET /usage.

Data handling. Agent input and output pass a guardrail layer: card numbers, national IDs and API keys/tokens are redacted before any model sees them and again before a response leaves the API; emails and phone numbers are stripped from the stored usage-log preview. Prompt-injection attempts are logged, not silently executed. Connector and MCP credentials are encrypted at rest (Fernet). Conversation memory is stored per-agent (pgvector) to give continuity across runs and is never shared across tenants.

Connectors. 30 apps have live actions today (CRM, payments, comms, productivity, e-commerce) plus a universal HTTP action for any public API, and external MCP servers can be registered to add their tools. Browse the full catalog at /connectors/actions.

Token Quotas

PlanTokens / monthPrice
starter500,000$19/mo
growth2,000,000$59/mo
enterprise10,000,000Custom

Tokens count input + output + cache tokens. Quotas reset on renewal and do not roll over. You receive an email alert at 80% usage and again at 100% (when the agent pauses).

🚦

Rate Limits

EndpointLimit
/v1/agents/{id}/chat60 requests / minute
/usage60 requests / minute
/provision10 requests / minute
/api/create-order10 requests / minute
/auth/send-otp5 requests / 15 minutes (per email)

Limits are per IP. When exceeded you receive 429 Too Many Requests with a Retry-After header in seconds.