> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revoengine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# agent.createThread()

> Public low-code contract, signatures and examples for agent.createThread.

## `agent.createThread()`

Creates a new assistant thread and first message.
Instructions, contextMode and responseFormat are immutable thread settings; follow-ups and Resume reuse them.
Minimal retains instance-global/account standing instructions and security while omitting automatic context.
Minimal admits only explicit toolNames or selected plugin routes. JSON schemas are strict and locally validated.
message is the user input; assistantMessage.message is the final text, and output.json is validated JSON when requested.

Requires `readOnly: false`.

### Overloads

```ts theme={null}
static createThread(
      data: AssistantMessageInput,
    ): Promise<AssistantThreadResponse>;

static createThread(
      data: AssistantMessageInput,
      stream: AssistantStreamOptions,
    ): Promise<ExecutionStream<AssistantThreadResponse>>;
```

### Example

```ts theme={null}
const response = await agent.createThread({
  content: 'Siemka jestem testerem.',
  instructions: 'Translate Polish to English. Return only the translation.',
  contextMode: 'minimal',
  responseFormat: { type: 'text' },
  toolNames: [],
});
return response.assistantMessage?.message;
```

See [all agent methods](https://docs.revoengine.com/low-code/reference/agent.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.