# model.generate

Canonical URL: https://developers.iagenify.com/sdk/workflows/steps/model-generate/
Language: en

`type: "model.generate"`

One model call. The workhorse of most chains: classify, summarise, draft, extract.

Status: model required · schema for JSON · billed per call

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `model` | string | required | A model name. Missing is refused on save. |
| `inputs` | array |  | `[{ type: "text", content }]`, images included. |
| `outputs` | array |  | What to produce. Text by default. |
| `schema` | object |  | A JSON schema. The answer comes back as an object instead of prose. |
| `settings` | object |  | Temperature, output cap, thinking. |
| `storage` | string |  | A storage whose documents give it context. |

## Output {#output}

```javascript
{{steps.classify.output.text}}            // the prose
{{steps.classify.output.usage.credits}}   // what it cost
```

With a `schema`, the fields of the object are readable directly — which is what makes a model's answer safe to branch on.

## Use a schema whenever a later step reads it {#schema}

> **Branching on prose is branching on luck**
>
> A condition testing whether text contains « urgent » breaks the first time the model writes « this is not urgent ». A schema gives a boolean, and the condition reads a boolean.

```javascript
{ id: "classify", type: "model.generate", config: {
    model: "gemini-3.5-flash",
    schema: { type: "object", properties: { urgent: { type: "boolean" }, reason: { type: "string" } } },
    inputs: [{ type: "text", content: "Is this urgent? {{input.text}}" }],
} }
```

## It is a model call {#cost}

Billed like any other, and the step reports its credits. On a scheduled or inbound trigger, that cost is paid on every firing — put the cheap checks before it.

- [agent.run](/sdk/workflows/steps/agent-run): When one call is not enough.
- [condition](/sdk/workflows/steps/condition): Branching on what it said.
- [Workflow steps](/sdk/workflows/steps): The 23 types.

```python
"{{steps.classify.output.text}}"            # the prose
"{{steps.classify.output.usage.credits}}"   # what it cost
```

```python
{"id": "classify", "type": "model.generate", "config": {
    "model": "gemini-3.5-flash",
    "schema": {"type": "object", "properties": {"urgent": {"type": "boolean"}, "reason": {"type": "string"}}},
    "inputs": [{"type": "text", "content": "Is this urgent? {{input.text}}"}],
}}
```
