T Backend Developer Guide
Welcome to T Backend! This guide helps you integrate with the T API and understand the core request flows.
Quick Links
Base URL:
https://api-v2.fluxpointstudios.comSwagger API Docs: API Docs
Support:
[email protected]· Discord
Authentication
API Key
All authenticated requests use an api-key header:
curl -s https://api-v2.fluxpointstudios.com/health \
-H "api-key: YOUR_API_KEY_HERE"If you need an API key, contact [email protected] or reach out on Discord.
Pay‑Per‑Call (x402)
If you omit api-key on protected endpoints, the server may return:
402 Payment Requiredwith an invoice payloadYou 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.
Public API Surface
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.
1) Chat (POST /chat)
POST /chat)Send a message and receive a reply. Use session_id to preserve context across turns.
Basic example
Structured output (optional)
If you want a JSON object back (when the assistant returns JSON), set output=structured (query param) or output_mode="structured" (body):
Streaming (Server‑Sent Events)
Set "stream": true to stream tokens as SSE (client must support SSE):
Image input (optional)
Provide image_data as a base64 data URI:
2) Token Analysis (POST /token-analysis)
POST /token-analysis)Analyze a token by ticker and policy id (Cardano).
Notes:
The endpoint may cache results for performance.
You can bypass cache using
x-bypass-cache: 1.
3) Images (/images/*)
/images/*)Generate (POST /images/generate)
POST /images/generate)Edit (POST /images/edit)
POST /images/edit)input_imagesis a list of base64 imagesEach image is validated to <= 25MB
Upload + edit (POST /images/upload-and-edit)
POST /images/upload-and-edit)Use this if you want to upload an image file directly instead of base64. Refer to Swagger docs for the exact multipart form fields.
Variations (POST /images/variations)
POST /images/variations)This endpoint is API-key only (not pay-per-call). Refer to Swagger docs for the request format.
Payments & Access Control (x402)
What a 402 invoice looks like
When payment is required, you’ll get HTTP 402 with a body like:
Key fields:
payTo: destination addressamountUnits+decimals: what to payasset+chain: network/asset label
Revenue share / split outputs (optional)
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.
Paying + retrying
After you pay, retry the original request with:
X-Invoice-Id: <invoiceId>X-Payment: <tx_hash_or_signed_cbor>
Example (retrying /chat):
Payment helpers
Poll invoice status:
Check prepaid balance (ADA partners):
Operational Notes
Request IDs
You may send X-Request-Id and the server will echo X-Request-ID back on responses. This helps correlate logs and support requests.
Common status codes
401: missing/invalid
api-key402: 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
Troubleshooting
1) “401 Unauthorized”
Ensure
api-keyheader is present and correct.Confirm the key is active (contact support if unsure).
2) “402 Payment Required”
Read the
invoiceId,asset,amountUnits,decimals, andpayTo.Pay on-chain.
Retry with
X-Invoice-Id+X-Payment.
3) “wallet_address_required_for_prepaid_batches”
Some partner billing modes require
X-Wallet-Addressso prepaid balance can be tracked.
Debug tip
Additional Resources
Swagger docs: API Docs
You’re Ready
Quick checklist:
Last updated

