API Reference

Welcome to the Astryx API reference. These endpoints and SDK methods allow you to create, deploy, register, and interact with decentralized AI agents across supported environments.


🧠 Agent Management

POST /agents/create

Create a new AI agent.

Request:

{
  "name": "MyAgent",
  "type": "synth",
  "runtime": "astryx-ts",
  "prompt": "You are a helpful AI assistant."
}

Response:

{
  "agent_id": "agent_94XKDl2i",
  "status": "created"
}

POST /agents/deploy

Deploy an agent to the runtime environment.

Request:

{
  "agent_id": "agent_94XKDl2i",
  "runtime": "astryx-ts"
}

Response:

{
  "deployment_id": "deploy_22TJKl2x",
  "status": "success"
}

POST /agents/register

Register your deployed agent onchain.

Request:

{
  "deployment_id": "deploy_22TJKl2x",
  "owner_address": "0xabc123..."
}

Response:

{
  "registry_hash": "bafybeic3....",
  "status": "registered"
}

💬 Interacting with Agents

POST /agents/message

Send a prompt or instruction to your AI agent.

Request:

{
  "agent_id": "agent_94XKDl2i",
  "input": "Summarize latest market trends"
}

Response:

{
  "output": "Current crypto market shows bullish momentum on SOL and ETH...",
  "timestamp": "2025-06-14T20:42:00Z"
}

🧪 Testing Agents (Sandbox)

POST /agents/test

Run a dry test for agent behavior (no deployment).

Request:

{
  "prompt": "You are an agent that tracks Solana NFTs.",
  "input": "Show trending collections"
}

Response:

{
  "output": "Here are 3 trending Solana NFT collections...",
  "confidence": 0.92
}

🔒 Authentication

Use your OpenAI API key or Astryx-issued token to authenticate requests.

Header:

Authorization: Bearer <your_api_key>

Coming Soon: Expanded Runtime Environments

We are excited to announce that more runtime environments will be available soon, expanding the versatility and functionality of our platform. Here's a sneak peek at what's coming:

CLI Agent Creation: astryx-cli

The astryx-cli is designed to simplify agent creation, providing a command-line interface (CLI) that enables you to quickly build and manage agents with ease. This tool offers robust functionalities that enhance productivity for developers who prefer terminal-based workflows.

Python Agent Runtime: astryx-py

Our astryx-py supports execution in the popular Python programming language. This runtime environment leverages Python's extensive libraries and community support, making it ideal for developers who need a flexible and powerful toolset for their projects.

TypeScript-Based Execution: astryx-ts

The astryx-ts environment allows for execution using TypeScript, bringing strong typing and modern JavaScript features to the table. This runtime is perfect for developers looking to create scalable and maintainable applications using TypeScript's powerful features.

Supported Runtimes

These upcoming runtimes will significantly enhance the capabilities of our platform, adding support for a wider range of languages and development preferences. Stay tuned for more updates as we continue to innovate and expand our offerings to meet your development needs.

Last updated