Skip to main content
POST
Generate a flow

Authorizations

Authorization
string
header
required

Your workspace secret key, sk_live_ followed by 32 hex characters. Create one in the console under Developers.

Body

application/json

At least one of brief or examples.

brief
string
required

What the agent does, in plain language: who it talks to, what it says and asks, how each answer is handled, what to record and the language. Up to 20,000 characters, so a structured specification written elsewhere fits. Optional when examples are given. Treated as the request, never as instructions to the API.

Required string length: 1 - 20000
examples
object[]

Example calls: transcripts of the business's real calls, to learn the flow from (POST /v2/agents/flow/transcribe turns a recording into one). 2-10 of them, together at most 200,000 characters. The brief wins where they disagree; personal data in them is never copied.

Required array length: 2 - 10 elements
flow
object | null

Optional graph to revise, as GET /v2/agents/{id}/flow returns it. Validated like PUT /flow (400 invalid_flow). The draft keeps what the brief does not ask to change.

language
string

Optional language code or name for the spoken lines (for example hi, en or Hinglish). Without it the brief decides.

Maximum string length: 32
model
enum<string>
default:gemini-3.8-flash

The model that drafts: gemini-3.8-flash (Gemini 3.8 Flash), claude-opus-5.5 (Claude Opus 5.5) or gpt-6-sol (GPT-6 Sol). Each is charged at the provider's cost plus 20% (its published per-token rates when the provider reports no cost). Omitted: gemini-3.8-flash.

Available options:
gemini-3.8-flash,
claude-opus-5.5,
gpt-6-sol

Response

A draft (not saved)

cost
object
required

What the generation cost, charged to the workspace wallet once as a flow_generation transaction: the provider-reported cost of every model round × ₹88 × 1.2 (a round the provider reported no cost for at the model's per-token rates), rounded up once to a paisa. A balance smaller than the charge is taken to zero, never below.

flow
object
required

The draft graph, defaults materialised. It passes every rule PUT /v2/agents/{id}/flow applies. Not saved.

flow_revision
string
required

The draft's flow revision: the same graph saved has the same revision.

id
string
required

The generation id: the reference of its wallet transaction (kind flow_generation). Quote it in a support request.

Pattern: ^fgen_[0-9A-Z]{26}$
input_schema
object
required

The variables as an agent input_schema, ready to save beside the flow. Every variable a node reads is required.

model
enum<string>
required

The model that drafted it.

Available options:
gemini-3.8-flash,
claude-opus-5.5,
gpt-6-sol
object
any
required
rounds
integer
required

Model calls the draft took: 1 when the first answer was valid, at most 3 (two repair rounds).

Required range: 1 <= x <= 3
usage
object
required

The tokens every model round that answered used, summed (estimated at four bytes a token for a round the provider reported no usage for). The ledger row's quantity.

variables
object[]
required

Call variables: values the business supplies before the call, read by the graph as {{name}}.

Maximum array length: 32