Skip to documentation
Open dashboard
On this page

Named references

Reference labels bind to owned asset IDs. Read the selected model’s reference capabilities and preserve the same labels, order and configuration when quoting and submitting.

Reference bindings#

Replace example model IDs, reference fields and capability revisions with values from current discovery. Reference support varies by model and workflow.

Quote with references#

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": "IMAGE_EDIT",      "model": "MODEL_ID_FROM_DISCOVERY",      "inputAssetIds": [        "aaaaaaaaaaaaaaaaaaaaaaaa",        "bbbbbbbbbbbbbbbbbbbbbbbb"      ],      "referenceRequest": {        "prompt": "Keep the subject in @Image1 and use the setting in @Image2.",        "assetIds": [          "aaaaaaaaaaaaaaaaaaaaaaaa",          "bbbbbbbbbbbbbbbbbbbbbbbb"        ],        "direction": {          "version": 1,          "capabilityRevision": "REVISION_FROM_MODEL_CONFIGURATION",          "references": [            {              "id": "subject",              "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa",              "field": "images",              "label": "Image1"            },            {              "id": "setting",              "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb",              "field": "images",              "label": "Image2"            }          ]        }      }    }  }}'
Configuration
curl --version

Submit with references#

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": "cccccccccccccccccccccccc"    },    "body": {      "operation": "IMAGE_EDIT",      "quoteId": "QUOTE_SUBMIT_VALUE",      "prompt": "Keep the subject in @Image1 and use the setting in @Image2.",      "inputAssetIds": [        "aaaaaaaaaaaaaaaaaaaaaaaa",        "bbbbbbbbbbbbbbbbbbbbbbbb"      ],      "parameters": {        "imageModel": "MODEL_ID_FROM_DISCOVERY",        "referenceDirection": {          "version": 1,          "capabilityRevision": "REVISION_FROM_MODEL_CONFIGURATION",          "references": [            {              "id": "subject",              "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa",              "field": "images",              "label": "Image1"            },            {              "id": "setting",              "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb",              "field": "images",              "label": "Image2"            }          ]        }      }    }  }}'
Configuration
curl --version

Assistant references#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_assistant_start/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "message": "Animate @Image1 and preserve the subject in @Image2.",    "attachments": [      "aaaaaaaaaaaaaaaaaaaaaaaa",      "bbbbbbbbbbbbbbbbbbbbbbbb"    ],    "reference_bindings": [      {        "label": "Image1",        "assetId": "aaaaaaaaaaaaaaaaaaaaaaaa"      },      {        "label": "Image2",        "assetId": "bbbbbbbbbbbbbbbbbbbbbbbb"      }    ],    "mode": "guided"  }}'
Configuration
curl --version