Use Athena SDK in Notebooks

Athena SDK enables Athena capabilities integrated in your pipelines and workflows

Most of Athena's capabilities exist in a Python SDK & API form factor as well as the UI platform. Using the SDK to run agentic workflows and data analysis tools allows you to integrate and scale workflows made in Athena UI platform so these would run in your pipelines and ad-hocs.

API & SDK Documentation

For full documentation refer to docs: Athena Documentation

API Key Access

Athena API and SDK is authenticated with your account using a personal Athena API Key. Reach out to Athena team to set up a personal token.

Open a Notebook and Set up the SDK Client

1. Once you opened a Athena Notebook, install the latest Athena SDK package:

! pip install -U athena-intelligence


Your API KEY is auto-injected into your Athena Notebook Environment. Try the below code to see it!

import os


2. Initialize the client with your personal Athena Token

import os
from athena import Model, Tools
from athena.client import AsyncAthena

async_client = AsyncAthena(

3. Send a request to Athena, receive a response, and render it in Markdown for readability:

import json
from IPython.display import Markdown
user_name = 'Athena'

What is the origin of this name: {user_name}?

message = await async_client.message.submit_and_poll(
    tools=[Tools.SEARCH, Tools.BROWSE],

message_output= json.loads(message.json())["content"]

Learn more with Athena SDK documentation and Sample Notebooks

Refer to docs to learn about all capabilities and parameters of the SDK client.

Explore examples and sample notebooks of end-to-end workflows built with Athena SDK in Athena Notebooks module: Click Athena Notebooks -> File Viewer -> Sample Notebooks.