For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Usage Examples

The only pre-requisite to start using Alpha API is to obtain a token. Learn about it in Authentification.

Checking Account Status


The code sample below checks the account status of the API token owner: API Credits balance, User Tier, and $AIKEK balance. This API endpoint is free.

import requests  # pip install requests

api_key = "YOUR_TOKEN_HERE"
url = "https://api.alphakek.ai/account"

response = requests.get(url, headers={"Authorization": f'Bearer {api_key}'})

user_data = response.json()

print(f"User credits: {user_data['credits']}")
print(f"User tier: {user_data['tier']}")
print(f"Amount of $AIKEK in USD: {user_data['tokens_usd']}")
const api_key = "YOUR_TOKEN_HERE";
const url = "https://api.alphakek.ai/account";

fetch(url, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${api_key}`
  }
})
.then(response => {
  if (response.ok) {
    return response.json();
  }
  throw new Error('Network response was not ok.');
})
.then(user_data => {
  console.log(`User credits: ${user_data['credits']}`);
  console.log(`User tier: ${user_data['tier']}`);
  console.log(`Amount of $AIKEK in USD: ${user_data['tokens_usd']}`);
})
.catch(error => {
  console.error('There has been a problem with your fetch operation:', error);
});

Comparing Our AI Models


This code sample calls Developer API for each of the three available AI Playground Universal Agents, asks them the same question, and returns a streaming response.

Note: The code sample below spends 6 API Credits upon running.

Last updated