POST
/
generate
Generate text based on existing content
curl --request POST \
  --url https://sdk.senso.ai/api/v1/generate \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "content_type": "<string>",
  "instructions": "<string>",
  "save": false,
  "max_results": 123,
  "org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "topic_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}'
{
  "content_type": "<string>",
  "instructions": "<string>",
  "generated_text": "<string>",
  "content_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "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
content_type
string
required

Description of the content the user is looking for

instructions
string
required

Instructions for how to generate the content

save
boolean
default:false

Whether to save the generated content in the system

max_results
integer

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

org_id
string<uuid>

Organization ID (defaults to user's current org)

category_id
string<uuid>

Optional filter for specific category

topic_id
string<uuid>

Optional filter for specific topic

Response

Content successfully generated

content_type
string

The original content type description

instructions
string

The original generation instructions

generated_text
string

The generated content text

content_id
string<uuid>

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

sources
object[]

Source chunks used to generate the content

processing_time_ms
integer

Processing time in milliseconds