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.
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 :
| 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 |
Generate an API key using the button in the Authentication section above.
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.
The API will return a response with a job ID. You can use this ID to check the status of your book generation job.
Once the job is complete, you can retrieve the generated book using the job ID (endpoint to be implemented).
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 |
On average, 1 token is approximately 4 characters or 0.75 words. For precise pricing, we recommend using our
token calculator tool.
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.