terminal_ai

Stream a terminal model response through PostHog AI. Requires organization approval for AI data processing. SDK consumers must use getTerminalAiCreateUrl() with streaming fetch. The generated JSON client buffers the response and cannot parse SSE.

post/api/projects/{project_id}/terminal_ai/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/terminal_ai/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

format'json' | 'txt'

Request body

model'claude-opus-5' | 'claude-sonnet-5' | 'claude-sonnet-4-6' | 'claude-haiku-4-5' required
max_tokensinteger required

Maximum output tokens for this generation.

streamtrue

Always stream the model response.

temperaturenumber nullable

Sampling temperature.

Changes

No recorded changes to this operation across all 1 revision of this API.