Quickstart
Your API key starts with sch_prod_. Find it in your dashboard after activation.
cURL
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)
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)
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:
X-API-Key: sch_prod_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sch_prod_. Never expose your key in client-side code. If compromised, contact syntaxcraftershub@gmail.com for immediate revocation.Error Codes
| Status | Meaning | Action |
|---|---|---|
| 401 | Invalid or expired API key | Check your key in the dashboard |
| 402 | Token quota exhausted | Upgrade your plan |
| 403 | Key not authorised for this agent | Use the correct agent ID |
| 422 | Validation error | Check request body fields |
| 429 | Rate limit exceeded | Slow down — see rate limits |
| 502 | Inference engine unreachable | Retry after a few seconds |
All errors return JSON: {"success": false, "error": "description"}
GET /health
Response
{ "status": "ok", "version": "1.2.0" }
POST /v1/agents/{agent_id}/chat
Headers
| Header | Required | Value |
|---|---|---|
| X-API-Key | yes | Your sch_prod_… key |
| Content-Type | yes | application/json |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| message | string | yes | The user message to send |
| session_id | string | no | Optional session ID for context grouping |
| context | object | no | Additional key-value context for the agent |
Response
{ "response": "Hello! I can help you with...", "tokens_used": 312, "tokens_remaining": 499688, "latency_ms": 1204 }
cURL example
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
Response
{ "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
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| plan | string | yes | starter | growth | enterprise |
| deployment_type | string | yes | cloud | local | hybrid |
| expiry_months | integer | yes | 1–24 |
| problem_description | string | yes | What will this agent do? |
| client_email | string | no | Receives activation email |
| client_name | string | no | Display name |
Response
{ "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
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| string | yes | Recipient email address |
Response
{ "success": true, "message": "OTP sent" }
POST /api/create-order
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| plan | string | yes | starter | growth | enterprise |
| agent_id | string | yes | Agent ID from /provision |
Response
{ "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
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| razorpay_order_id | string | yes | From create-order response |
| razorpay_payment_id | string | yes | From Razorpay success handler |
| razorpay_signature | string | yes | HMAC-SHA256 signature from Razorpay |
| agent_id | string | yes | Agent to activate |
Response (success)
{ "success": true, "message": "Payment verified. Agent is now active.", "status": "active" }
POST /api/refund
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| payment_id | string | yes | Razorpay payment_id to refund |
| amount | integer | no | Partial refund amount in cents (omit for full) |
| reason | string | no | Reason for refund |
Response
{ "success": true, "refund_id": "rfnd_PxyzABC123", "amount": 99900, "status": "processed" }
GET /api/invoice/{agent_id}
Path params
| Param | Description |
|---|---|
| agent_id | The 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.
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
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)
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)
{
"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.
| Plan | Primary model | Fallback order |
|---|---|---|
| trial / starter / growth | NVIDIA NIM · Llama 3.3 70B | → Gemini Flash → Claude |
| enterprise | Anthropic 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
| Plan | Tokens / month | Price |
|---|---|---|
| starter | 500,000 | $19/mo |
| growth | 2,000,000 | $59/mo |
| enterprise | 10,000,000 | Custom |
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
| Endpoint | Limit |
|---|---|
| /v1/agents/{id}/chat | 60 requests / minute |
| /usage | 60 requests / minute |
| /provision | 10 requests / minute |
| /api/create-order | 10 requests / minute |
| /auth/send-otp | 5 requests / 15 minutes (per email) |
Limits are per IP. When exceeded you receive 429 Too Many Requests with a Retry-After header in seconds.