Create conversation
tong_conversation_createCreate a saved resource in your Tong account using the fields below.
/v1/tools/tong_conversation_create/operationsRequest example#
curl -X POST 'https://platform.tongai.io/v1/tools/tong_conversation_create/operations' \ -H "Authorization: Bearer $TONG_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \ -d '{ "input": { "body": { "title": "Blue hour film" } }}'Configuration
curl --versionPermissions#
Use a server-side API key for your account, or OAuth for each customer’s account. Never send keys in prompts or tool arguments.
conversations:writeRequest body#
REST requests wrap the tool arguments in input. MCP calls send the same arguments directly.
bodyobjectRequiredShow nested fields
titlestringOptionalMinimum length: 1 characters.
Maximum length: 100 characters.
"Blue hour film"Request headers#
Authorization: Bearer $TONG_API_KEYContent-Type: application/jsonIdempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03Keep one UUID for each intended action and reuse it after a timeout or retry. A different input with the same UUID is rejected.
Response fields#
An accepted request is not a finished generation. Track the saved job until its output is ready.
Accepted means the request was saved. Read its operation to follow execution.
{ "id": "e8aa0a87-6cd9-42eb-975a-b72bf43218c8", "tool": "tong_conversation_create", "category": "conversation", "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" }}idstringRequiredThe unique ID of the saved operation.
A UUID, for example e8aa0a87-6cd9-42eb-975a-b72bf43218c8.
toolstringRequiredcategorystringRequiredchannelstringRequired"api""mcp"statestringRequiredThe current execution state of the saved work.
"queued""running""waiting""needs_review""paused""reconciling""succeeded""failed""cancelled"statusstringRequiredThe overall status to use when tracking the operation.
"accepted""running""needs_review""paused""reconciling""succeeded""failed""cancelled"stagestringRequiredThe current phase of the operation.
"admission""dispatch""review""generation""reconciliation""complete"dispatch_statusstringRequiredWhether the tool accepted the request. An acknowledgement does not mean generation is complete.
"pending""unknown""acknowledged"created_atstringRequiredISO 8601 date and time, for example 2026-10-22T09:00:00Z.
updated_atstringRequiredISO 8601 date and time, for example 2026-10-22T09:00:00Z.
detail_expires_atstring | nullRequiredWhen stored operation details expire. A null value means no expiry is currently set.
ISO 8601 date and time, for example 2026-10-22T09:00:00Z.
detail_expiredbooleanRequiredWhether the stored operation details have expired.
timingobjectRequiredTimestamps and elapsed times for tracking this operation.
Show nested fields
dispatch_started_atstring | nullRequiredISO 8601 date and time, for example 2026-10-22T09:00:00Z.
acknowledged_atstring | nullRequiredISO 8601 date and time, for example 2026-10-22T09:00:00Z.
completed_atstring | nullRequiredISO 8601 date and time, for example 2026-10-22T09:00:00Z.
dispatch_acknowledgement_msnumber | nullRequiredMinimum: 0.
end_to_end_msnumber | nullRequiredMinimum: 0.
reviewJSON | nullRequiredReview information when the operation needs human input; otherwise null.
resultJSON | nullRequiredThe output returned by this tool, or null while no output is available.
errorobject | nullRequiredThe public error code if the operation failed; otherwise null.
Show nested fields
codestringRequiredbillingobjectRequiredCustomer credit usage and wallet charges. Output readiness and billing settlement are separate.
Show nested fields
statusstringRequired"none""pending""settled""released""reconciling"usage_creditsstringRequiredA decimal string with six decimal places, for example 1.250000.
wallet_debited_creditsstringRequiredA decimal string with six decimal places, for example 1.250000.
released_creditsstringOptionalA decimal string with six decimal places, for example 1.250000.
refunded_creditsstringOptionalA decimal string with six decimal places, for example 1.250000.
unfunded_creditsstringOptionalA decimal string with six decimal places, for example 1.250000.
pending_creditsstringOptionalA decimal string with six decimal places, for example 1.250000.
tokensobjectOptionalShow nested fields
inputnumberOptionalMinimum: 0.
outputnumberOptionalMinimum: 0.
cachednumberOptionalMinimum: 0.
cache_writenumberOptionalMinimum: 0.
componentsobject[]OptionalShow nested fields
idstringOptionalsource_idstringRequiredtoolstringRequiredmodelstring | nullRequiredchannelstringRequired"api""mcp"credential_idstringRequiredkindstringRequired"text_pool""reasoning""generation"usage_creditsstringRequiredA decimal string with six decimal places, for example 1.250000.
wallet_debited_creditsstringRequiredA decimal string with six decimal places, for example 1.250000.
evidence_atstringOptionalISO 8601 date and time, for example 2026-10-22T09:00:00Z.
updated_atstringOptionalISO 8601 date and time, for example 2026-10-22T09:00:00Z.
quoteobjectOptionalThe quoted configuration, price and submission values, when a quote is available.
Show nested fields
idstringRequiredA UUID, for example e8aa0a87-6cd9-42eb-975a-b72bf43218c8.
operation_idstringRequiredA UUID, for example e8aa0a87-6cd9-42eb-975a-b72bf43218c8.
toolstringRequiredoperationstring | nullRequiredmodelstring | nullRequiredconfigurationobjectRequiredsubmit_valuestringRequiredsubmit_fieldstringRequiredquoted_creditsstring | nullRequiredA decimal string with six decimal places, for example 1.250000.
expires_atstring | nullRequiredISO 8601 date and time, for example 2026-10-22T09:00:00Z.
MCP call#
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "tong_conversation_create", "arguments": { "body": { "title": "Blue hour film" } }, "_meta": { "io.tongai/idempotency-key": "45be69f1-c266-4a09-a82c-bf3c6303eb03" } }}REST requests wrap the tool arguments in input. MCP calls send the same arguments directly.
Response
{ "jsonrpc": "2.0", "id": 1, "result": { "structuredContent": { "id": "e8aa0a87-6cd9-42eb-975a-b72bf43218c8", "tool": "tong_conversation_create", "category": "conversation", "channel": "mcp", "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" } }, "content": [ { "type": "text", "text": "{\"id\":\"e8aa0a87-6cd9-42eb-975a-b72bf43218c8\",\"tool\":\"tong_conversation_create\",\"category\":\"conversation\",\"channel\":\"mcp\",\"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\"}}" } ] }}Errors and limits#
| HTTP | Error | Recovery |
|---|---|---|
400 | Invalid requestREQUEST_INVALID | Correct the fields identified by the error before trying again. |
401 | Invalid credentialCREDENTIAL_INVALID | Check the credential, its expiry and whether it has been revoked. |
402 | Insufficient creditsINSUFFICIENT_CREDITS | Add credits to the account that owns the credential, then continue the saved work. |
403 | Permission deniedSCOPE_REQUIRED | Use a credential with the required scopes and access to the selected resource. |
404 | Resource unavailableRESOURCE_UNAVAILABLE | Check the resource ID and that it belongs to the authorized account. |
409 | Intent conflictIDEMPOTENCY_CONFLICT | Reuse an intent only with its original request. Use a new UUID for a different action. |
429 | Rate limitedRATE_LIMITED | Wait for Retry-After before retrying the same intended request. |
503 | Temporarily unavailableDEPENDENCY_UNAVAILABLE | Wait for Retry-After and retry with the same intent. Check the saved operation after a timeout. |