Skip to documentation
Open dashboard
On this page

Text Chat

Use text models directly and track actual input, output and cache usage.

Text models#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_text_models/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "input": {}}'
Configuration
curl --version

Text rates are maximum display rates. Actual input, output and cache usage are billed separately.

Quote a text message#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_text_quote/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "body": {      "model": "tong_5c5b990cb58f50dd87ef1ef6",      "prompt": "Write a short scene at blue hour.",      "maxOutputTokens": 1024    }  }}'
Configuration
curl --version

Send a text message#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_text_submit/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \  -d '{  "input": {    "body": {      "quoteId": "000000000000000000000002"    }  }}'
Configuration
curl --version

Text conversation history#

curl -X POST 'https://platform.tongai.io/v1/tools/tong_text_history/operations' \  -H "Authorization: Bearer $TONG_API_KEY" \  -H "Content-Type: application/json" \  -d '{  "input": {    "params": {      "id": "aaaaaaaaaaaaaaaaaaaaaaaa"    }  }}'
Configuration
curl --version

Consumed credits and wallet debits are separate. Text Chat can use a previously funded balance.