### Response body example Source: https://docs.typesafe.ai/introduction/quickstart Example JSON response from the API. Contains model, answers with type-specific results, and usage token counts. ```json { "model": "jev-latest", "answers": { "department": { "type": "choice", "choice": "billing", "probabilities": { "billing": 0.84, "technical": 0.159, "sales": 0.001 }, "confidence": 0.596 }, "frustration": { "type": "score", "score": 1.035, "legend": { "0": "Calm, just stating facts", "1": "Frustrated but civil", "2": "Very angry, strong language" }, "confidence": 0.842 }, "is_urgent": { "type": "noul", "noul": 0.999 } }, "usage": { "input_tokens": 312, "output_tokens": 48 } } ``` -------------------------------- ### Noul question example Source: https://docs.typesafe.ai/introduction/quickstart JSON example of a Noul question asking if the message expresses urgency. Used in the Playground to add a question. ```json { "urgency": { "type": "noul", "instructions": "Does this message express urgency?" } } ``` -------------------------------- ### Request body example Source: https://docs.typesafe.ai/introduction/quickstart JSON request body for the API call. Includes state, model, and multiple questions of different types (choice, score, noul). ```json { "state": "Hi, I've been trying to connect my Stripe account for 3 days and it keeps failing. I'm losing sales. Please help ASAP.", "model": "jev-latest", "questions": { "department": { "type": "choice", "instructions": "Which team should handle this", "criteria": { "billing": "Payment or subscription issues", "technical": "Bugs or integration problems", "sales": "Pricing or account questions" } }, "frustration": { "type": "score", "instructions": "How frustrated the customer appears", "criteria": [ "Calm, just stating facts", "Frustrated but civil", "Very angry, strong language" ] }, "is_urgent": { "type": "noul", "instructions": "The message conveys urgency or time-sensitivity" } } } ``` -------------------------------- ### Sample state Source: https://docs.typesafe.ai/introduction/quickstart Plain text example of the state to paste into the Playground. Represents a customer support message about Stripe connection issues. ```plaintext Hi, I've been trying to connect my Stripe account for 3 days and it keeps failing. I'm losing sales. Please help ASAP. ``` -------------------------------- ### Sample cURL command Source: https://docs.typesafe.ai/introduction/quickstart cURL command to call the TypeSafe AI API. Uses the TYPESAFE_API_KEY environment variable and sends a JSON payload with state, model, and questions. ```bash curl -X POST https://api.typesafe.ai/v1/systemone \ -H "Authorization: Bearer $TYPESAFE_API_KEY" \ -H "Content-Type: application/json" \ -d @- <<'EOF' { "state": "Hi, I've been trying to connect my Stripe account for 3 days and it keeps failing. I'm losing sales. Please help ASAP.", "model": "jev-latest", "questions": { "urgency": { "type": "noul", "instructions": "Does this message express urgency?" } } } EOF ``` -------------------------------- ### HTTP POST request to API endpoint Source: https://docs.typesafe.ai/introduction/quickstart HTTP request to the TypeSafe AI API endpoint. Requires an API key in the Authorization header. ```http POST https://api.typesafe.ai/v1/systemone Authorization: Bearer Content-Type: application/json ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.