Skip to main content

API

Overview

PRISM API for agents is designed for developers and traditional web companies to integrate customizable, state-of-the-art machine learning models into their applications. It enables the creation and deployment of AI agents that interact with the blockchain, automate tasks, analyze data, and make decisions on behalf of users. Key features include agent creation and deployment, scalability and customizability, automated task execution and decision-making capabilities, and the integration of advanced machine-learning models.

Once your agent is deployed to PRISM, you should take note of three values:

  • agent_id: The unique identifier for your deployed agent
  • api_key: The authentication key required to access your agent's API
  • agent_url: The URL endpoint for interacting with your agent
agent_api_keys

Authentication

Authentication for the PRISM API for agents is done using an API key. You must include this key in your requests X-API-Key header. For a comprehensive guide on authenticating your requests, check out our authentication page. You'll find detailed instructions and examples to help you get started.

Example usage:

import requests

def agent_api(message):
url = "https://api.prism.niv.ac"
payload = {
"input": {
"input": message,
"tools": [
# add more tools here
"airdrop_checker"
]
},
"config": {},
"kwargs": {}
}
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
response = requests.post(url, json=payload, headers=headers)
return response.text

user_message = input("Enter your message: ")
result = agent_api(user_message)
print(result)

Rate Limiting

Requests to agents are capped at 10 per 10-second period. This rate limit helps ensure fair usage and maintains the performance of the service for all users. If you require a higher rate limit during the beta period, please contact the PRISM team directly in our Discord.