Przejdź do głównej zawartości
Version: 2.0

Gaius-Lex Agent API

The Gaius-Lex legal agent (API version 2) for clients with an organization API key.

Authentication: send Authorization: Api-Key <YOUR_KEY>. The key acts as its own account in the organization, so the sessions it creates belong to that key; the account is created on the key's first request. A read-only key can only read: every POST and PATCH gets 403 with error_code read_only_api_key. A missing, revoked or expired key gets 401; a key of an organization without active billing gets 403.

Flow:

  1. POST /api/v2/chat-sessions/ creates a session. With first_turn it also starts the agent and returns 202; the session's active_turn_id is the running turn.
  2. GET .../turns/{turn_id}/events streams the turn as server-sent events: each event carries a complete replacement of a message or of the turn. Reconnect with Last-Event-ID; GET /api/v2/chat-sessions/{session_id} returns the full history.
  3. POST .../turns adds the next user message. When the agent asks a question, answer or reject it through .../questions/{message_id}/answers or .../reject.

Commands accept an Idempotency-Key header, so a retried request does not start a second turn. Accept-Language selects the language of status labels and error details.

Authentication​

Enter the full Authorization header value: Authorization: Api-Key <YOUR_KEY>

Security Scheme Type:

apiKey

Header parameter name:

Authorization