The API uses an API key to authenticate requests. You can view your API key in your team settings.
Projects must be created in the application. This API request will retrieve IDs and names for all projects owned by your team. You can then use any project_id to query that project.
POST https://app.athenic.com/api/projects/<project_id>/generate-query
Query an existing project
The API uses an API key to authenticate requests. You can view your API key in your team settings.
Projects must be created in the application before querying. This API request will generate a SQL query given an input question.
{
"query_id": "c5d5a134-eebc-4224-90fa-0dbe7bc35cc5",
"question": "Show me the monthly sales for x, y, z",
"sql_query": "SELECT ... FROM ..."
"full_sql_query": "WITH dataset1 AS (...), dataset2 AS (...) SELECT ... FROM ..." -- The full SQL query including the project datasets' SQL
"explanation": -- An plain text explanation of what your query is doing
"run_status": -- One of ["success", "error", "empty"]
"df": A dictionary containing the query results
"truncated": -- A boolean indicating whether the df was truncated to 10000 rows
"query_error": -- A string containing the error if running the SQL query failed
}