Book Title Generator

Generates book titles using prompts


Endpoints

POST https://www.capix.uz/v2/generate/title/

Description

This endpoint generates a title based on the provided description and mode. It is part of the Capix API version 2.

Headers

  • token: (string) A required header for authentication. Replace API_KEY with your actual API key.

  • Content-Type: (string) This should be set to application/json to indicate that the request body contains JSON data.

Request Body

The request body should be a JSON object with the following fields:

  • mode: (string) The mode in which the title should be generated. Example values include Formal, Casual, etc.

  • description: (string) A brief description that will be used to generate the title.

Example Request Body

{
  "mode": "Formal",
  "description": "let us dive"
}

Example cURL Command

curl -X POST \
  "https://www.capix.uz/v2/generate/title/" \
  -H "token: API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "mode": "Formal",
        "description": "let us dive"
      }'

Response

The response will be in JSON format and will contain the generated title. The structure of the response may vary based on the implementation, but a typical response might look like this:

Example Response

{
  "title": "An Exploration into Formality: Let Us Dive"
}

Error Handling

If the request is invalid or the token is missing/incorrect, the server will respond with an appropriate HTTP status code and a message indicating the error.

Example Error Responses

  • 401 Unauthorized

    {
      "error": "Invalid token."
    }
  • 400 Bad Request

    {
      "error": "Invalid request body."
    }

Notes

  • Ensure that the token header contains a valid API key.

  • The mode field should be one of the accepted values. Check the API documentation or contact support if you are unsure about the valid modes.

  • The description field should be a concise and meaningful string to get the best results from the title generation.

Code Examples

curl -X POST \
  "https://www.capix.uz/v2/generate/title/" \
  -H "token: API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "mode": "Formal",
        "description": "let us dive"
      }'

Last updated