Backstory API
Learn how to use the Backstory API to create and manage character backstories, adding depth and personality to your NPCs.
This API is available only on the Professional Plan and above.
Generate Backstory for Character
POST https://api.convai.com/character/generate-backstory
Generate Backstory API is implemented as Server Sent Event (SSE). Given some initial description about the character and their name, this API can generate a description for the character.
Headers
CONVAI-API-KEY*
String
The unique api-key provided for every user. Found under the Key icon when logged into your Convai account.
Request Body
inputText
String
High level character description.
charName
String
Character name for which description is being generated.
# Output Format:
# The response will be streamed as Server-Sent Events (SSE).
# Each event will have a 'data' field containing a string with a part of the backstory.
# Example of a single event:
data: You step off the train, greeted by the bustling city sounds.
# Multiple events will be received, each containing a portion of the backstory.
# The full backstory can be assembled by concatenating the 'data' from all events.{
"ERROR": "Invalid API key provided."
}Here are some sample codes to demonstrate the request format for the endpoint -->
Last updated
Was this helpful?