Programmatic access to the same Smart-Money / PTS chart-analysis engine that powers the PTS Wizard app. Send a chart image, receive a structured trade setup (direction, entry, stop, targets, conviction) as clean JSON.
https://xmajcsacxnqnkcjxnljp.supabase.co/functions/v1
Every request must carry your API key (prefix juice_live_). Use either header:
Authorization: Bearer juice_live_xxxxxxxxxxxxxxxxxxxx
x-api-key: juice_live_xxxxxxxxxxxxxxxxxxxx
Keys are issued by us per account. Treat a key like a password — it grants billable
access. If a key leaks, tell us and we revoke it immediately. A revoked key returns
401 on the next call.
POST /v1-analyze — two ways to call it:
Mode A — send your own chart: include a base64 image.
Mode B — symbol only (we fetch the chart): omit image and send
symbol + style; our servers capture a dark-theme TradingView
chart (scalp → 15m, swing → 4h) and analyze it. Nothing for you to render or maintain.
| Field | Type | Required | Notes |
|---|---|---|---|
image | string | mode A | Base64 of the chart. Bare base64 or a full data:image/png;base64,… URL both work. Omit to use mode B. |
symbol | string | mode B | TradingView format passes through verbatim (BINANCE:BTCUSDT); bare symbols (BTCUSDT, BTCUSD) default to Binance. Optional in mode A (enables live-price context + tracking). |
style | string | mode B | scalp (15m chart) or swing (4h chart). |
timeframe | string | no | e.g. 15m, 1h, 4h, 1D. In mode B this overrides style's default chart timeframe. |
mediaType | string | no | Mode A only: e.g. image/png, image/jpeg. Inferred from a data-URL if omitted. |
reference | string | no | Your own id/label (≤64 chars), echoed back on the ledger row. |
curl -X POST https://xmajcsacxnqnkcjxnljp.supabase.co/functions/v1/v1-analyze \
-H "x-api-key: juice_live_xxxxxxxxxxxxxxxxxxxx" \
-H "content-type: application/json" \
-d '{"symbol":"BINANCE:BTCUSDT","style":"scalp","reference":"user-123"}'
Mode-B specific errors: 422 unknown_symbol (no chart exists for that
symbol), 502 chart_fetch_failed (transient capture failure — retry shortly;
the call is not billed against your quota), 502 analysis_truncated
(rare engine hiccup — retry; not billed).
About 422 no_setup: this is a real, honest answer — the methodology
found no edge on the current chart (e.g. mid-range chop) and refuses to invent a trade.
Treat it as a "no trade right now" verdict in your product, not as a failure.
{
"id": "8b1c…",
"signal": {
"instrument": "BTCUSD",
"timeframe": "4h",
"bias": "bullish",
"entry": 61250,
"sl": 60100,
"tp": 63400,
"targets": [63400, 64900, 66200],
"strength": 72,
"patterns": ["bullish OB", "liquidity sweep"],
"reasoning": "Swept Asian lows then reclaimed the 4h order block…"
},
"tracking": { "status": "waiting_entry", "symbol": "XBTUSD" },
"usage": { "used": 143, "limit": 1000, "remaining": 857 }
}
signal is the structured setup. bias is bullish /
bearish / neutral; strength is 0–100 conviction;
targets is ordered nearest-first. Treat unknown fields as additive — ignore any you don't use.
id is the ledger id — pass it to the lookup endpoint (§4) to fetch the graded
outcome later. tracking is null when a setup can't be
auto-tracked (e.g. neutral bias, or a symbol we can't price); the analysis is still returned.
usage reflects your account's monthly quota after this call.
GET /v1-analyze/{id} — where {id} is the id from an
analyze response. Returns only signals belonging to your account.
{
"signal": {
"id": "8b1c…",
"instrument": "BTCUSD", "symbol": "XBTUSD", "timeframe": "4h",
"direction": "long", "entry": 61250, "sl": 60100,
"targets": [63400, 64900, 66200], "strength": 72,
"status": "open", "outcome": null, "result_r": null,
"created_at": "2026-06-28T09:12:00Z", "closed_at": null
}
}
status: waiting_entry → open →
tp1_hit…tp4_hit → terminal (stopped /
target_hit / expired), or untrackable.
outcome: win / loss / expired /
null (still live).
result_r: realized reward-to-risk (R multiple) once closed.
All errors are JSON: { "error": "<code>", "detail"?: "…" }.
| HTTP | error | Meaning |
|---|---|---|
| 400 | missing_image / invalid_json_body / missing_signal_id | Bad request. |
| 401 | unauthorized | Missing, malformed, invalid, or revoked key. |
| 402 | quota_exceeded | Monthly quota used up (used/limit included). |
| 403 | account_suspended | Account disabled — contact us. |
| 422 | no_setup | The chart yielded no structured setup. Not billed. |
| 429 | rate_limited | Too many requests/min (limit, reset_at included). Not billed. |
| 502 | upstream_error | Model error. Auto-refunded — not billed. |
| 500 | internal_error | Unexpected — retry; alert us if it persists. |
Only successful 200 analyses with a setup count against your monthly quota.