Book Generator API

Overview

The Book Generator API allows you to generate books on various topics using different language models. This documentation provides details on how to use the API, including authentication, available endpoints, and code examples.

Authentication

To use the API, you need to include your API key in the header of each request:

X-API-Key: YOUR_API_KEY

To generate an API key, use the button below:

Your API Key :

Endpoints

Generate Book
Request Body
Parameter Type Description
api string The API provider to use. Options: "openai" or "together"
model string The specific model to use (e.g., "gpt-3.5-turbo", "gpt-4", "llama-2-70b")
topic string The main topic or theme of the book
language string The language in which the book should be generated
word_count integer The approximate number of words for the generated book

Tutorial

Step 1: Obtain an API Key

Generate an API key using the button in the Authentication section above.

Step 2: Make a Request

Use your preferred programming language or tool to make a POST request to the /api/generate-book endpoint. Include your API key in the header and the required parameters in the request body.

Step 3: Handle the Response

The API will return a response with a job ID. You can use this ID to check the status of your book generation job.

Step 4: Retrieve the Generated Book

Once the job is complete, you can retrieve the generated book using the job ID (endpoint to be implemented).

API Pricing

Our API pricing is based on the model used and the number of tokens processed. Here's a breakdown of the costs:

API Model Price per 1K tokens
OpenAI GPT-3.5 $0.002
OpenAI GPT-4 $0.03
Together AI Llama-2-70b $0.0008
Together AI Llama-2-13b $0.0006
Token Estimation

On average, 1 token is approximately 4 characters or 0.75 words. For precise pricing, we recommend using our
token calculator tool.

Billing

You will only be charged for the tokens used in generating the book. The API tracks token usage and bills accordingly. Detailed usage reports are available in your account dashboard.