Start Chat
Start or continue an Agent chat with X-Api-Key. This endpoint does not accept Authorization: Bearer <API Key>.
Omit sessionId to create a new session; messages must then include one role=user message. Pass sessionId to continue a session, submit a tool approval, or resume a waiting run. A session that is already running returns business code 18120; use the resume endpoint instead.
A successful response is an AI SDK UI Message SSE stream and is not wrapped in { code, data }. After a new session title is generated, the stream includes data-title. When human approval is required, the stream includes data-approval-cost.
Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Body
Session ID. Omit it to create a new session.
User messages or tool-approval responses submitted in this request. Required for a new session.
Model. Pass auto or a specific model ID. The default is auto.
Reasoning effort. The request fails when the model does not support the selected effort.
none, low, medium, high, xhigh, max User IANA time zone, for example Asia/Shanghai.
Response
Native third-party protocol response or SSE data, not wrapped in the AiToEarn common response envelope.
Native third-party protocol response, not wrapped in the AiToEarn common response envelope.

