{
"input": "check"
}
{
"success": true,
"message": "API token is valid"
}
API Reference
API Reference
Tough Tongue AI REST API
POST
/
test
{
"input": "check"
}
{
"success": true,
"message": "API token is valid"
}
- Base URL:
https://api.toughtongueai.com/api/public - Download OpenAPI Specification
Authentication
All requests require Bearer token authentication. Get your API token from the Developer Portal{
"input": "check"
}
curl -X POST https://api.toughtongueai.com/api/public/test \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"input": "check"}'
const response = await fetch("https://api.toughtongueai.com/api/public/test", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({ input: "check" }),
});
const result = await response.json();
import requests
response = requests.post(
'https://api.toughtongueai.com/api/public/test',
headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
json={'input': 'check'}
)
result = response.json()
{
"success": true,
"message": "API token is valid"
}
Endpoints
Scenarios
| Method | Endpoint | Description |
|---|---|---|
| GET | /scenarios | List all scenarios |
| POST | /scenarios | Create scenario |
| GET | /scenarios/{id} | Get scenario |
| PATCH | /scenarios/{id} | Update scenario |
| DELETE | /scenarios/{id} | Delete scenario |
| GET | /featured-scenarios | List featured (public) |
Sessions
| Method | Endpoint | Description |
|---|---|---|
| GET | /sessions | List sessions |
| GET | /sessions/{id} | Get session details |
| POST | /sessions/analyze | Trigger analysis |
| POST | /v2/sessions | Create session |
Miscellaneous Utilities
| Method | Endpoint | Description |
|---|---|---|
| POST | /test | Test API token |
| GET | /balance | Check wallet balance |
Errors
In case of an error from any of the API endpoints, the response will containerror and details fields.
It shall also be accompanied with appropriate HTTP status codes.
| Code | Meaning |
|---|---|
| 400 | Bad request |
| 401 | Invalid token |
| 403 | Forbidden |
| 404 | Not found |
| 429 | Rate limited |
| 500 | Server error |
{
"error": "Error message",
"details": {}
}