Postman Collection
You can find here an entire postman collection with different types of queries for reference. You can download the collection and import it into your postman application.cURL
To start, let’s make a request via cURL to query data from Athina AI GraphQL API.Fetching Data from the API
Node.js
Prerequisites
To use the Athina AI GraphQL API in Node.js, make sure that you have therequest library installed. You can install these packages with the following commands:
Fetching Data from the API
Here’s an example of how to query the Athina AI GraphQL API using Node.js:Python
Note: The python example uses the
gql and aiohttp libraries to communicate with the API. You can alternatively use just requests library to communicate with the API directly as well.Prerequisites
To use the Athina AI GraphQL API, make sure that you have thegql and aiohttp libraries installed in your Python environment. You can install these packages with the following commands:
Setting up a GraphQL Client
Here’s how to setup a GraphQL client to communicate with the Athina GraphQL API:urlis the endpoint of the Athina AI GraphQL API.AIOHTTPTransportestablishes the connection to the API endpoint.Clientis a GraphQL client that communicates with the API using the provided transport.
Fetching Data from the API
Here’s how to fetch data from the Athina AI API using GraphQL:SIZEis the number of records fetched per request.gqlparses the GraphQL query.client.executeruns the query and returns the result. Thevariable_valuesparameter is used to set thelimitandpagein 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.