Build powerful applications on top of AEGIS-Ω with our comprehensive API and SDK
Integrate AEGIS-Ω into your smart contracts to leverage AI compute resources and token utilities.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract AegisIntegration {
IERC20 public aegisToken;
constructor(address _aegisToken) {
aegisToken = IERC20(_aegisToken);
}
function payForAICompute(uint256 amount) public {
require(
aegisToken.transferFrom(msg.sender, address(this), amount),
"Transfer failed"
);
// Trigger AI compute job
_executeAIJob(amount);
}
function _executeAIJob(uint256 computeUnits) internal {
// Your AI compute logic here
}
}contract AegisStaking {
IERC20 public aegisToken;
mapping(address => uint256) public stakedBalance;
mapping(address => uint256) public stakingTimestamp;
uint256 public constant APY = 12; // 12% APY
function stake(uint256 amount) external {
aegisToken.transferFrom(msg.sender, address(this), amount);
if (stakedBalance[msg.sender] > 0) {
_claimRewards();
}
stakedBalance[msg.sender] += amount;
stakingTimestamp[msg.sender] = block.timestamp;
}
function _claimRewards() internal {
uint256 timeStaked = block.timestamp - stakingTimestamp[msg.sender];
uint256 reward = (stakedBalance[msg.sender] * APY * timeStaked)
/ (365 days * 100);
// Transfer rewards
}
}Use our REST API to interact with AEGIS-Ω infrastructure and AI models.
https://api.aegis-omega.io/v1/token/balance/:addressGet AEGIS-Ω balance for an address
{
"address": "0x742d35...",
"balance": "1000000",
"decimals": 18
}/ai/inferenceExecute AI model inference
Request:
{
"model": "gpt-4",
"prompt": "Your prompt here",
"max_tokens": 100,
"payment_tx": "0x..."
}Response:
{
"result": "AI response...",
"tokens_used": 87,
"cost_aegis": "0.05"
}/governance/proposalsList active governance proposals
{
"proposals": [
{
"id": 1,
"title": "Increase AI compute subsidy",
"status": "active",
"votes_for": 45000000,
"votes_against": 12000000
}
]
}Use our official SDKs for JavaScript, Python, and Rust to build applications faster.
npm install @aegis/sdkpip install aegis-sdkcargo add aegis-sdkimport { AegisClient } from '@aegis/sdk';
const client = new AegisClient({
apiKey: process.env.AEGIS_API_KEY,
network: 'ethereum-mainnet'
});
// Get token balance
const balance = await client.getBalance('0x742d35...');
console.log('Balance:', balance);
// Execute AI inference
const result = await client.ai.inference({
model: 'gpt-4',
prompt: 'Analyze this blockchain transaction',
maxTokens: 100
});
console.log('AI Response:', result.text);from aegis_sdk import AegisClient
client = AegisClient(
api_key=os.getenv('AEGIS_API_KEY'),
network='ethereum-mainnet'
)
# Get token balance
balance = client.get_balance('0x742d35...')
print(f'Balance: {balance}')
# Execute AI inference
result = client.ai.inference(
model='gpt-4',
prompt='Analyze this blockchain transaction',
max_tokens=100
)
print(f'AI Response: {result.text}')Explore complete example projects to jumpstart your development.
Generate unique NFTs using AI models, paid with AEGIS-Ω
github.com/aegis-omega/nft-generatorAutomated trading with AI-powered market analysis
github.com/aegis-omega/trading-botFull-featured governance voting interface
github.com/aegis-omega/governance-ui