Script

Generate script from intent

Draft a complete script from a description of the conversational goal. Does not create a project. The draft uses every block type (rating, NPS, ranking, calculated fields, action blocks), scoring and show_when; it is fixed in code, failing blocks get one repair call, and blocks that still fail are dropped and listed in dropped (except a misspelled score bucket: that block is kept and listed in flagged). The returned blocks pass PUT /script as they are. Typical workflow: (1) POST /projects/generate; (2) read author_notes; (3) POST /projects with script: {blocks} (and scoring_enabled: true when scoring.enabled). Or use POST /projects with intent to draft and write in one call. Optionally call POST /projects/generate/plan first. Every model call is charged, repairs included. Returns 402 if the balance is below the chosen quality's floor.

post/v1/communities/{communityId}/projects/generate

Request

  • Base URL: https://api.subo.ai
  • URL: https://api.subo.ai/v1/communities/{communityId}/projects/generate
  • Auth: API key in header X-API-Key

Path parameters

communityIdstring required

Community ID (Discord guild snowflake, serialized as string)

Request body

intentstring required

The goal or purpose of the convo in plain language

type'convo' | 'poll'

poll asks for a one-question poll. Omit to let the intent decide.

quality'quick' | 'deep'

Draft quality. quick is a fast, low-cost model; deep is a stronger model that costs far more credits (typically ~24,000-48,000 versus ~700) and needs a balance of at least its floor to start. Defaults to deep on any paid plan, quick otherwise.

question_countinteger

How many questions to draft (intro, content and action blocks not counted). Capped by the plan's limit. Omit to let the model choose what the goal needs.

max_blocksinteger

Deprecated alias of question_count.

languagestring

Language respondents will read: any language's name (French, Tagalog) or a locale code (fr, pt-BR, ja). Defaults to a language the intent names ("a poll in Tagalog"), else the community's. Only a value that is not a language name or code is a 400.

admin_languagestring

Language the plan and author_notes are written in for you (the author): any language's name or a locale code. It never sets the project's language. When omitted it is inferred from the intent, and the response's notices say so.

factsstring

Facts the model cannot know and must use as given: dates, line-ups, results, odds. The model's knowledge has a cutoff, so pass anything current here.

answersobject

Your answers to the plan's questions: plan question id -> answer text.

session_idstring

The session_id from POST /projects/generate/plan, so the plan and the draft are recorded as one exchange. Optional.

localestring

Deprecated alias of language.

Example request

{
  "intent": "Measure how satisfied members are with last week's event",
  "language": "fr",
  "admin_language": "en"
}

Response

The draft: blocks (pass to PUT /script or POST /projects as they are) and what came with it

Changes

No recorded changes to this operation across all 1 revision of this API.