Skip to main content
POST
/
generate
/
prompt
Generate content using a saved prompt
curl --request POST \
  --url https://sdk.senso.ai/api/v1/generate/prompt \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "content_type": "<string>",
  "category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "max_results": 123,
  "save": false
}'
{
  "generated_text": "<string>",
  "content_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "prompt": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>"
  },
  "template": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "output_type": "json"
  },
  "sources": [
    {
      "content_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "chunk_index": 123,
      "chunk_text": "<string>",
      "score": 123,
      "title": "<string>",
      "vector_id": "<string>"
    }
  ],
  "processing_time_ms": 123
}

Authorizations

X-API-Key
string
header
required

API key authorization

Body

application/json
prompt_id
string<uuid>
required

The unique identifier of the prompt to use

content_type
string
required

Description of what content to search for in the knowledge base

template_id
string<uuid>

Optional template for output formatting

category_id
string<uuid>

Optional filter for specific category

topic_id
string<uuid>

Optional filter for specific topic

max_results
integer

Maximum number of source results to use (default is 5)

save
boolean
default:false

Whether to save the generated content in the system

Response

Content successfully generated

generated_text
string

The generated content text, formatted with template if provided

content_id
string<uuid>

The ID of the saved content (only if save was true)

prompt
object
template
object

Template information (only if template was used)

sources
object[]

Source chunks used to generate the content

processing_time_ms
integer

Processing time in milliseconds

I