We have provided examples of how to query the Athina AI GraphQL API using cURL and Python. You can use these examples to fetch data from the API and integrate it into your applications.
request
library installed. You can install these packages with the following commands:
gql
and aiohttp
libraries to communicate with the API. You can alternatively use just requests
library to communicate with the API directly as well.gql
and aiohttp
libraries installed in your Python environment. You can install these packages with the following commands:
url
is the endpoint of the Athina AI GraphQL API.AIOHTTPTransport
establishes the connection to the API endpoint.Client
is a GraphQL client that communicates with the API using the provided transport.SIZE
is the number of records fetched per request.gql
parses the GraphQL query.client.execute
runs the query and returns the result. The variable_values
parameter is used to set the limit
and page
in the GraphQL query.PromptRun
objects. Each PromptRun
object contains the following fields: id
, org_id
, prompt_slug
, language_model_id
, prompt_response
, and prompt_tokens
.