AI Credits and AI Generated Response

This document outlines the available API endpoints for managing AI credits

This document outlines the available API endpoints for managing AI credits and generating AI-powered responses in the system. It includes details on how to check available credits and use them to generate responses based on user inputs.

API for AI Credits

Headers:

  • Authorization: Bearer {your_bearer_token}

  • Description: This API endpoint provides details about the total available AI credits and the number of AI credits used. The total AI credits value will be “unlimited” if workspace has unlimited access.

Response:

  • total_ai_credits (integer, could also be string in case of unlimited access): The total available AI credits.

  • used_ai_credits (integer): The number of AI credits used.

Example Response:

{
"total_ai_credits": 20,
"used_ai_credits": 17
}

API for AI Generated Response

Endpoint:

GET https://app.dotsimple.io/app/api/{workspace_uuid}/ai/generate-response

Headers:

  • Authorization: Bearer {your_bearer_token}

Request Parameters:

  • prompt (required): The text input for generating a response (string).

  • language (optional): Language of the response. Accepted values:

    • 'english'

    • 'german'

Description: This API generates a response based on the provided prompt and language preference. It consumes AI credits and returns the generated response.

Response:

  • text (string): The generated response based on the prompt.

  • total_ai_credits (integer, could also be string in case of unlimited access): The total available AI credits after the request.

  • used_ai_credits (integer): The number of AI credits used for the request.

Example Response:

{
"text": "Life is a beautiful tapestry woven from moments of joy,
challenge, love, and growth. It's a journey where each day offers new
lessons and opportunities. Embrace the present, cherish connections, and
find beauty in the ordinary. Remember, it's not just about the
destination, but the experiences that shape us along the way. Live fully,
love deeply, and always seek to learn and grow.",
"total_ai_credits": 20,
"used_ai_credits": 17
}

Note: Make sure to replace {workspace_uuid} with the actual workspace UUID and {your_bearer_token} with your valid Bearer token.

Did this answer your question?
😞
😐
😁