POST /v1/text/responses
Use the documented request fields and permissions for this HTTP endpoint.
Request example#
curl -X POST 'https://platform.tongai.io/v1/text/responses' \ -H "Authorization: Bearer $TONG_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \ -d '{ "quote_id": "example"}'Configuration
curl --versionAuthentication#
Use a server-side API key for your account, or OAuth for each customer’s account. Never send keys in prompts or tool arguments.
text:writecredits:spendParameters#
Idempotency-KeystringRequiredA UUID, for example e8aa0a87-6cd9-42eb-975a-b72bf43218c8.
Request body#
application/jsonquote_idstringRequiredUse letters, numbers or hyphens.
Minimum length: 1 characters.
Maximum length: 120 characters.
Response schema#
{ "id": "e8aa0a87-6cd9-42eb-975a-b72bf43218c8", "tool": "example", "category": "example", "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": "2026-10-22T09:00:00.000Z", "detail_expired": false, "timing": { "dispatch_started_at": "2026-10-22T09:00:00.000Z", "acknowledged_at": "2026-10-22T09:00:00.000Z", "completed_at": "2026-10-22T09:00:00.000Z", "dispatch_acknowledgement_ms": 0, "end_to_end_ms": 0 }, "review": null, "result": null, "error": { "code": "example" }, "billing": { "status": "none", "usage_credits": "0.000000", "wallet_debited_credits": "0.000000" }}HTTP 202
application/jsonidstringRequiredThe 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.
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. |