Welcome to T Backend! This guide helps you integrate with the T API and understand the core request flows.
- Base URL:
https://api-v3.fluxpointstudios.com - Swagger API Docs: API Docs
- Support:
contact@fluxpointstudios.com· Discord
All authenticated requests use an api-key header:
curl -s https://api-v3.fluxpointstudios.com/health \
-H "api-key: YOUR_API_KEY_HERE"If you need an API key, contact contact@fluxpointstudios.com or reach out on Discord.
If you omit api-key on protected endpoints, the server may return:
402 Payment Requiredwith an invoice payload- You pay the invoice on-chain
- You retry the same request with:
X-Invoice-Id: <invoiceId>X-Payment: <tx_hash_or_signed_cbor>
Partner billing (recommended): include X-Partner: <partner_name> and X-Wallet-Address: <addr...> so your pricing/tier rules apply.
The customer-facing Swagger docs are intentionally scoped to:
GET /health,GET /apiPOST /chatPOST /token-analysisPOST /images/*GET/POST /payments/*(when payments are enabled)
If you have additional capabilities enabled for your deployment, you’ll receive separate documentation for those routes.
Send a message and receive a reply. Use session_id to preserve context across turns.
import requests
r = requests.post(
"https://api-v3.fluxpointstudios.com/chat",
headers={"api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={"message": "What is Cardano?", "session_id": "my-session-1"},
)
print(r.json()["reply"])If you want a JSON object back (when the assistant returns JSON), set output=structured (query param) or output_mode="structured" (body):
import requests
r = requests.post(
"https://api-v3.fluxpointstudios.com/chat?output=structured",
headers={"api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={
"message": "Return JSON with keys: summary, risks (array), next_steps (array).",
"session_id": "my-session-2",
"output_mode": "structured",
},
)
print(r.json().get("reply_json"))Set "stream": true to stream tokens as SSE (client must support SSE):
import requests
with requests.post(
"https://api-v3.fluxpointstudios.com/chat",
headers={"api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={"message": "Summarize Cardano in 5 bullets.", "session_id": "sse-1", "stream": True},
stream=True,
) as resp:
resp.raise_for_status()
for line in resp.iter_lines():
if line:
print(line.decode("utf-8"))Provide image_data as a base64 data URI:
import requests
r = requests.post(
"https://api-v3.fluxpointstudios.com/chat",
headers={"api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={
"message": "What’s in this image?",
"session_id": "vision-1",
"image_data": "data:image/png;base64,AAAA...", # your base64
},
)
print(r.json()["reply"])Analyze a token by ticker and policy id (Cardano).
import requests
r = requests.post(
"https://api-v3.fluxpointstudios.com/token-analysis",
headers={"api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={
"token": "SNEK",
"policyId": "279c909f348e533da5808898f87f9a14bb2c3dfbbacccd631d927a3f",
"network": "cardano",
},
)
print(r.json())Notes:
- The endpoint may cache results for performance.
- You can bypass cache using
x-bypass-cache: 1.
import requests
r = requests.post(
"https://api-v3.fluxpointstudios.com/images/generate",
headers={"api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={"prompt": "A futuristic Cardano validator node in space", "size": "1024x1024", "n": 1},
)
data = r.json()
if data.get("success"):
print("images:", len(data.get("images") or []))
else:
print("error:", data)input_imagesis a list of base64 images- Each image is validated to <= 25MB
import requests
r = requests.post(
"https://api-v3.fluxpointstudios.com/images/edit",
headers={"api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={
"prompt": "Add plants and warm natural lighting",
"input_images": ["data:image/png;base64,AAAA..."],
"n": 1,
"size": "1024x1024",
},
)
print(r.json())Use this if you want to upload an image file directly instead of base64. Refer to Swagger docs for the exact multipart form fields.
This endpoint is API-key only (not pay-per-call). Refer to Swagger docs for the request format.
When payment is required, you’ll get HTTP 402 with a body like:
{
"detail": {
"version": "0.1",
"invoiceId": "…",
"chain": "cardano-mainnet",
"asset": "ADA",
"amountUnits": "10000000",
"decimals": 6,
"payTo": "addr1…",
"timeout": 300,
"extra": {
"lovelace": true,
"babel": false,
"partner": "your_partner_name",
"batchTarget": 100
}
}
}Key fields:
payTo: destination addressamountUnits+decimals: what to payasset+chain: network/asset label
If your partner tier has revenue share enabled, the invoice may include detail.extra.outputs / detail.extra.split.
In that case, your payment transaction must include those outputs; the verifier enforces them.
After you pay, retry the original request with:
X-Invoice-Id: <invoiceId>X-Payment: <tx_hash_or_signed_cbor>
Example (retrying /chat):
curl -s https://api-v3.fluxpointstudios.com/chat \
-H "X-Partner: your_partner_name" \
-H "X-Wallet-Address: addr1..." \
-H "X-Invoice-Id: YOUR_INVOICE_ID" \
-H "X-Payment: YOUR_TX_HASH_OR_SIGNED_CBOR" \
-H "Content-Type: application/json" \
-d '{"message":"hello","session_id":"pay-1"}'- Poll invoice status:
curl -s https://api-v3.fluxpointstudios.com/payments/status/YOUR_INVOICE_ID- Check prepaid balance (ADA partners):
curl -s "https://api-v3.fluxpointstudios.com/payments/balance?partner=your_partner_name&wallet=addr1..."You may send X-Request-Id and the server will echo X-Request-ID back on responses. This helps correlate logs and support requests.
- 401: missing/invalid
api-key - 402: payment required (x402 invoice returned)
- 403: forbidden (insufficient privileges)
- 413: payload too large (commonly for image base64 uploads)
- 422: invalid request body
- 5xx: transient server or upstream failures; retry with backoff
- Ensure
api-keyheader is present and correct. - Confirm the key is active (contact support if unsure).
- Read the
invoiceId,asset,amountUnits,decimals, andpayTo. - Pay on-chain.
- Retry with
X-Invoice-Id+X-Payment.
- Some partner billing modes require
X-Wallet-Addressso prepaid balance can be tracked.
import requests
resp = requests.post(url, headers=headers, json=payload)
print(resp.status_code, resp.text)- Swagger docs: API Docs
Quick checklist:
- Get an API key (or partner config for x402)
-
GET /health -
POST /chat -
POST /token-analysis -
POST /images/generate - If using x402: run a full 402 → pay → retry loop
- Generate an image
- Explore the knowledge graphs