Add a user message
POST/api/v1/sessions/:session_id/messages
Saves a user message to the session. When auto_generate is enabled on the session and no generation is currently in progress, generation is triggered automatically and the response is the generated turn, the same body ?wait=true generate answers. Otherwise returns the saved user message.
Request
Responses
- 200
- 201
- 401
- 403
- 404
- 409
- 429
Duplicate request — original message returned (idempotency_key matched)
User message saved
Authentication required
Insufficient permissions
Not found
IDEMPOTENCY_KEY_REUSED — the key is already claimed by a message in this session sent from a different request. No message is saved.
QUOTA_EXCEEDED: the session auto-generates and an enforce-mode generation quota is exhausted. error.meta carries quota_id, metric, limit, window and resets_at, with a Retry-After header. The message is saved. A session with message_delay_seconds answers 201 before the quota is read.