ai

Generate

Generate endpoint that auto-classifies intent and creates resources.

This endpoint:

  1. Validates the prompt using guardrails
  2. Classifies intent (if mode is 'auto') - insight, dashboard, or data_model
  3. Creates the appropriate resource
  4. Returns a redirect URL or helpful message

Mode options:

  • 'auto': Let AI classify the request type (default)
  • 'insight': Force creation of a single insight
  • 'dashboard': Force creation of a dashboard with multiple insights
  • 'data_model': Force creation of a data model (data transformation)

Returns:

  • For successful creation: { action: 'redirect', url: '/insights/{id}', resource_type: 'insight' }
  • For rejected/other requests: { action: 'message', message: 'Helpful explanation...' }
post/ai/generate

Request

  • Base URL: https://api.pandas-ai.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.pandas-ai.com/ai/generate
  • Auth: none declared

Request body

source_idstring required

Source ID for schema lookup

promptstring required

User's natural language request

modestring

Generation mode: 'auto' (let AI decide), 'insight', 'dashboard', or 'data_model'

Response

Successful Response

action'redirect' | 'message' required

Action type: 'redirect' to navigate, 'message' to show text

urlstring nullable

URL to redirect to (e.g., '/insights/{id}', '/dashboards/{id}')

messagestring nullable

Message to display for rejected/other requests

resource_type'insight' | 'dashboard' | 'data_model' nullable

Type of resource created

Changes

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