Add a user message
POST/v1/projects/:project_id/sessions/:session_id/messages
Saves a user message to the session. When autoGenerate is enabled on the session and no generation is currently in progress, generation is triggered automatically and the response mirrors GenerateSessionResponse. Otherwise returns the saved user message.
Request
Responses
- 200
- 201
- 401
- 403
- 404
- 429
Duplicate request — original message returned (idempotency_key matched)
User message saved
Missing or invalid credentials.
The credential is scoped to a different project, or the caller's role in the project does not carry this action.
The resource does not exist (existence is not leaked).
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.