session

Store message to session

Supports JSON and multipart/form-data. In multipart mode: the payload is a JSON string placed in a form field. The format parameter indicates the format of the input message (default: openai, same as GET). The blob field should be a complete message object: for openai, use OpenAI ChatCompletionMessageParam format (with role and content); for anthropic, use Anthropic MessageParam format (with role and content); for acontext (internal), use {role, parts} format. The optional meta field allows attaching user-provided metadata to the message, which can be retrieved via get_messages().metas or updated via patch_message_meta().

post/session/{session_id}/messages

Request

  • Base URL: /api/v1 (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/v1/session/{session_id}/messages
  • Auth: API key in header Authorization

Path parameters

session_idstring uuid required

Session ID

Request body

blobunknown required
format'acontext' | 'openai' | 'anthropic' | 'gemini'
metaobject

Optional user-provided metadata for the message

Example request

{
  "format": "openai"
}

Response

Created

codeinteger
errorstring
msgstring

Changes

No recorded changes to this operation across all 50 revisions of this API.