Skip to main content

Basic Chat

Parameters

Response

Chat with Conversation Context

Use chat_id to maintain conversation context:

Override Model Per Request

Reasoning Modes

  • auto - Automatically selects best approach
  • standard - Quick answers (1x credit)
  • agent - Autonomous multi-step reasoning with tool use (up to 10x)

Use Local Ollama Models

For self-hosted models:
Use provider_host instead of provider_key for Ollama.

Limit Response Length

Use Your Own API Key (BYOK)

Bring your own API key for any provider:

Override Instructions

Override the bot’s instruction per request:

Use Specific Training Sources

Target specific training sources by ID:

Disable Training Data

Skip the agent’s training data for a specific request:

Stream Responses

Stream responses in real-time by setting stream: true:

Edit Chat Mode

Edit mode routes your request through the agent reasoning pipeline, where the agent uses the built-in edit tool to make targeted code changes in your workspace files.

Edit Mode Parameters

Edit mode forces agent reasoning — the AI analyzes your request, identifies the target file in the workspace, and applies precise string replacements using the built-in edit tool. The agent can chain multiple edits in a single turn. No reference_message_id is needed.
Edit mode requires the agent’s Workspace setting to be enabled. If workspace is disabled, edit requests are treated as normal ask mode.

Plan Chat Mode

Plan mode enables a conversational “plan-then-execute” workflow — the AI proposes a step-by-step plan before executing any tools, giving you the opportunity to review, modify, or approve.

Plan Mode Parameters

Plan mode classifies each message as one of three intents: approve (execute the proposed plan), modify (revise the plan), or new (generate a fresh plan). The AI is aware of all available tools (built-in and connected integrations) when generating plans. If no tools are needed, it bypasses planning and returns a direct answer. Plan generation costs 2 credits; execution costs are additional based on the tools used.
Plan mode requires the agent’s Workspace setting to be enabled. If workspace is disabled, plan requests are treated as normal ask mode.

Error Handling

Complete Example

Next Steps

Training Data

Add knowledge to improve responses

API Reference

Complete API documentation