---
title: "Generate text (description, records, abilities and more) based on input."
method: POST
path: "/magic/{promptId}/generate"
tags: ["Magic"]
---

# Generate text (description, records, abilities and more) based on input.

`POST /magic/{promptId}/generate`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/magic/{promptId}/generate`
- Auth: HTTP bearer

## Path parameters

- `promptId` string, required: The ID of the prompt to use for generation

## Request body

- object
  - `text` string, required: The text to use as input
  - `props` object: Additional properties to pass to the prompt
  - `model` string: Optional language model to use for generation

## Response `200`

The magic prompt completed successfully

- object
  - `text` string, required: The input text
  - `usage` Usage, required: Usage information
    - `token` number, required: The tokens used in this exchange

## Other responses

- `default`: An error response

---

[API](https://skmtc.dev/chatbotkit/apis/cbk-api.md) · [All operations](https://skmtc.dev/chatbotkit/apis/cbk-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatbotkit/apis/cbk-api/revisions/13d250576136?raw)
