Quickstart
Create an API key, find a model, quote a request and follow its result.
1. Create an API key#
Create a key for your server. Permissions apply to the account that owns it.
Create API keyKeep keys on your server. Start with read-only permissions and add only what your integration needs.
export TONG_API_KEY="YOUR_TONG_API_KEY"Paid tools also require credits:spend. Delete permissions are separate.
2. Discover a model#
Replace example model IDs, reference fields and capability revisions with values from current discovery. Reference support varies by model and workflow.
curl -X POST 'https://platform.tongai.io/v1/tools/tong_workflows/operations' \ -H "Authorization: Bearer $TONG_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "input": { "query": { "operation": "TEXT_TO_VIDEO" } }}'Configuration
curl --version3. Quote the configuration#
Quote first, then submit the exact quoted model and configuration. Poll the returned operation until it succeeds, fails, or needs your review.
curl -X POST 'https://platform.tongai.io/v1/tools/tong_generation_quote/operations' \ -H "Authorization: Bearer $TONG_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \ -d '{ "input": { "body": { "operation": "TEXT_TO_IMAGE", "model": "tong_ea55aff4f3b5c8aba3a35569", "routingParameters": { "ratio": "16:9" } } }}'Configuration
curl --versionUse the quote submission value returned for this exact configuration.
4. Submit the request#
Examples use the public endpoint. Replace sample IDs with your own.
curl -X POST 'https://platform.tongai.io/v1/tools/tong_generation_submit/operations' \ -H "Authorization: Bearer $TONG_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \ -d '{ "input": { "params": { "id": "000000000000000000000001" }, "body": { "quoteId": "fixture-image-quote-token", "prompt": "A quiet street at blue hour", "operation": "TEXT_TO_IMAGE", "inputAssetIds": [], "parameters": { "textToImageModel": "tong_ea55aff4f3b5c8aba3a35569", "ratio": "16:9" } } }}'Configuration
curl --versionKeep one UUID for each intended action and reuse it after a timeout or retry. A different input with the same UUID is rejected.
5. Follow the result#
An accepted request is not a finished generation. Track the saved job until its output is ready.
curl 'https://platform.tongai.io/v1/operations/e8aa0a87-6cd9-42eb-975a-b72bf43218c8' \ -H "Authorization: Bearer $TONG_API_KEY"Configuration
curl --version{ "id": "e8aa0a87-6cd9-42eb-975a-b72bf43218c8", "tool": "tong_generation_submit", "category": "generation", "channel": "api", "state": "queued", "status": "accepted", "stage": "admission", "dispatch_status": "pending", "created_at": "2026-10-22T09:00:00.000Z", "updated_at": "2026-10-22T09:00:00.000Z", "detail_expires_at": null, "detail_expired": false, "timing": { "dispatch_started_at": null, "acknowledged_at": null, "completed_at": null, "dispatch_acknowledgement_ms": null, "end_to_end_ms": null }, "review": null, "result": null, "error": null, "billing": { "status": "pending", "usage_credits": "0.000000", "wallet_debited_credits": "0.000000" }}