sdk

Sdk Query

Convert a natural language query to DSL and SQL.

DEPRECATED: SDK v1 is superseded by SDK v3 (POST /v3/sdk/step). This endpoint keeps working and returns Deprecation/Link headers; it will be removed in a future release.

The SDK sends a natural language query along with schema context (table names, columns, types). Annie generates a DSL representation and compiles it to SQL in the requested dialect.

The SDK then executes the SQL locally against the customer's database. Data never leaves the customer's infrastructure.

post/sdk/query

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/sdk/query
  • Auth: none declared

Request body

querystring required

Natural language query

schemaobject required

Schema context from the connector. Format: {"tables": [{"name": "...", "description": "...", "columns": [{"name": "...", "type": "...", "description": "..."}], "constraints": {...}}]}

dialectstring

Target SQL dialect (postgres, bigquery, mysql)

general_contextstring nullable

Additional context or instructions for the AI

languagestring nullable

Response language code (e.g., 'en', 'it', 'es')

filter_columnsboolean

Pre-filter schema columns to only those relevant to the query. Reduces noise for tables with many columns. Set to false to disable.

Response

Successful Response

typestring required

Response type: 'query' for data queries, 'text' for non-data responses

successboolean

Whether the request was successful

dslobject nullable

Generated DSL (DataModel with source and steps)

sqlstring nullable

SQL compiled for the requested dialect

visualizationstring

Recommended visualization type (bar, pie, line, table, etc.)

messagestring nullable

Text message for non-data responses

column_display_namesobject nullable

Map of column names to human-readable display names

Changes

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