Use any AI agent instantly — no selection, no setup.
DAgent picks, routes, and pays the best agent for you.
DAgent is a unified AI agent routing and monetization platform that makes it easy for developers to use the right AI agent without the hassle of finding, hosting, or paying them manually.
- AI agent ecosystems are fragmented — too many agents, no way to know which one is best
- Developers waste time choosing, comparing, integrating, and maintaining agents
- Agent creators struggle to reach users and monetize consistently
- No unified on-chain mechanism for usage tracking, payment, and reliability
When a developer sends a request, DAgent automatically finds the best agent that matches their needs — things like cost, skills, or provider. That agent gets assigned, and from then on, all requests go straight through it. Usage is tracked and costs are deducted from their credit balance.
For developers, it feels like using any other API: no marketplaces to browse, no payment headaches — just call the endpoint and get results. For agent creators, it's a way to deploy agents publicly and get paid automatically whenever they're matched.
- Automatic Agent Selection — Semantic search + requirement-based filtering finds the best agent for your task
- Unified API — Single endpoint to access all registered agents
- Credit-Based Pay-Per-Use — Simple billing with credit balance system
- Cardano Wallet Authentication — Secure sign-in using MeshSDK
- On-Chain Agent Registration — Transparent agent registry on blockchain
- Multi-Framework Support — Google ADK, Crew AI, LangGraph, OpenAI, AutoGen, and more
- Session Management — Automatic session handling and agent persistence
- Fallback & Reliability — If an agent fails, the system can rematch to another
┌─────────────────────────────────────────────────────────────────┐
│ DAgent API │
├─────────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ Auth │ │ Agents │ │ API Keys │ │
│ │ (Cardano) │ │ (Routing) │ │ (Management) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Semantic Matching Engine │ │
│ │ (Cloudflare AI BGE Embeddings) │ │
│ └─────────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │
│ │ PostgreSQL │ │ Prisma │ │ Smart Contracts │ │
│ │ Database │ │ ORM │ │ (External Repos) │ │
│ └──────────────┘ └──────────────┘ └──────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
| Component | Technology |
|---|---|
| Runtime | Bun |
| Framework | Hono |
| Database | PostgreSQL |
| ORM | Prisma |
| Blockchain Auth | Cardano (MeshSDK) |
| Embeddings | Cloudflare AI (BGE-base-en-v1.5) |
| Validation | Zod |
Smart contracts are maintained in separate repositories:
| Chain | Language | Repository |
|---|---|---|
| Cardano | Aiken | dagent-cardano-contracts |
| Ethereum | Solidity | dagent-eth-contracts |
- Bun >= 1.1.38
- Node.js >= 22 (required by Prisma)
- PostgreSQL database
- Cloudflare account (for AI embeddings)
- Clone the repository
git clone https://github.com/your-org/dagent-api.git
cd dagent-api- Install dependencies
bun install- Set up environment variables
cp .env.example .envEdit .env with your configuration (see Environment Variables).
- Run database migrations
bun run db:deploy- Start the development server
bun run devThe API will be available at http://localhost:3000
docker-compose up -dThis will:
- Build the application container
- Generate Prisma client
- Run database migrations
- Start the API on port 3002
Request a nonce for wallet signature authentication.
POST /auth/nonce
Content-Type: application/json
{
"address": "addr1qx..."
}Response:
{
"nonce": "Sign this message to authenticate: abc123..."
}Verify wallet signature and receive JWT token.
POST /auth/verify
Content-Type: application/json
{
"address": "addr1qx...",
"signature": {
"key": "...",
"signature": "..."
}
}Response:
{
"token": "eyJhbGciOiJIUzI1NiIs..."
}All agent routes require JWT authentication via
Authorization: Bearer <token>header.
Automatically match and call the best agent for your requirements.
POST /dagent
Authorization: Bearer <token>
x-api-key: <api_key>
Content-Type: application/json
{
"requirement_json": {
"description": "I need an agent that can help with code review",
"preferred_llm_provider": "OpenAI",
"max_agent_cost": 0.01,
"max_total_agent_cost": 1.0,
"skills": ["code-review", "typescript"],
"streaming": false,
"is_multi_agent_system": false
},
"message": "Please review this TypeScript function..."
}Response:
{
"message": "Agent response",
"data": "Here's my code review..."
}Call a specific agent by ID.
POST /dagent/:id/run
Authorization: Bearer <token>
Content-Type: application/json
{
"message": "Your prompt here"
}Response:
{
"message": "Agent response",
"data": {
"response": "Agent's response content",
"creditBalance": 95.5
}
}Register a new agent on the platform.
POST /dagent/create
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "My Code Review Agent",
"description": "An AI agent specialized in reviewing TypeScript and JavaScript code",
"agentCost": "0.001",
"deployedUrl": "https://my-agent.example.com",
"llmProvider": "OpenAI",
"skills": ["code-review", "typescript", "javascript"],
"is_multiAgentSystem": false,
"default_agent_name": "code_reviewer",
"framework_used": "google_adk",
"can_stream": true
}Verify that an agent URL is valid and accessible.
POST /dagent/verify
Authorization: Bearer <token>
Content-Type: application/json
{
"deployedUrl": "https://my-agent.example.com",
"default_agent_name": "code_reviewer"
}Retrieve all public agents or your own agents.
GET /dagent/all
Authorization: Bearer <token>GET /dagent/:id
Authorization: Bearer <token>PUT /dagent/:id
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Updated Agent Name",
"description": "Updated description",
"isActive": true,
"isPublic": true
}DELETE /dagent/:id
Authorization: Bearer <token>POST /apikey/create
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "My Production Key"
}GET /apikey/all
Authorization: Bearer <token>PUT /apikey/update
Authorization: Bearer <token>
Content-Type: application/json
{
"api_key_id": "clx..."
}DELETE /apikey/delete
Authorization: Bearer <token>
Content-Type: application/json
{
"api_key_id": "clx..."
}Create a .env file with the following variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/dagent"
# Authentication
JWT_SECRET="your-jwt-secret-key"
BETTER_AUTH_SECRET="your-better-auth-secret"
# Frontend
FRONTEND_URL="http://localhost:5173"
# Cloudflare AI (for embeddings)
CLOUDFLARE_ACCOUNT_ID="your-cloudflare-account-id"
CLOUDFLARE_API_TOKEN="your-cloudflare-api-token"
# Smart Contracts (optional)
RPC_URL="https://ethereum-goerli.publicnode.com"
CONTRACT_PRIVATE_KEY="your-contract-private-key"
AGENT_CONTRACT_ADDRESS="0x..."
STAKE_CONTRACT_ADDRESS="0x..."To make your AI agent available on DAgent:
- Deploy your agent with an accessible HTTP endpoint
- Authenticate with your Cardano wallet
- Register via
POST /dagent/create
| Field | Type | Description |
|---|---|---|
name |
string | Agent name (max 100 chars) |
description |
string | What your agent does (max 1000 chars) |
agentCost |
string | Cost per request |
deployedUrl |
string | Your agent's base URL |
llmProvider |
string | LLM provider (OpenAI, Anthropic, etc.) |
skills |
string[] | List of capabilities |
is_multiAgentSystem |
boolean | Multi-agent orchestration? |
default_agent_name |
string | Agent identifier at your endpoint |
framework_used |
string | Framework (see below) |
can_stream |
boolean | Supports streaming? |
| Framework | Status |
|---|---|
google_adk |
✅ Supported |
crew_ai |
🚧 Coming Soon |
langraph |
🚧 Coming Soon |
openai |
🚧 Coming Soon |
autogen |
🚧 Coming Soon |
autogpt |
🚧 Coming Soon |
semantic_kernel |
🚧 Coming Soon |
openai_agents |
🚧 Coming Soon |
sequenceDiagram
participant Client
participant DAgent API
participant Wallet
Client->>DAgent API: POST /auth/nonce {address}
DAgent API->>Client: {nonce}
Client->>Wallet: Sign nonce
Wallet->>Client: {signature}
Client->>DAgent API: POST /auth/verify {address, signature}
DAgent API->>Client: {token}
- Request a nonce with your wallet address
- Sign the nonce with your Cardano wallet
- Submit the signature to get a JWT token
- Use the token in
Authorization: Bearer <token>header
# Create an API key
curl -X POST http://localhost:3000/apikey/create \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "my-app-key"}'Option 1: Automatic Matching
Send your requirements and let DAgent find the best agent:
curl -X POST http://localhost:3000/dagent \
-H "Authorization: Bearer $TOKEN" \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"requirement_json": {
"description": "Code review assistant",
"skills": ["code-review"],
"max_agent_cost": 0.01
},
"message": "Review this code..."
}'Option 2: Direct Agent Call
Call a specific agent by ID:
curl -X POST http://localhost:3000/dagent/agent_id_here/run \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "Your prompt here"}'Once an agent is matched, its ID is stored in a cookie (agent_id). Subsequent requests will automatically route to the same agent until the session expires.
model user {
id String @id @default(cuid())
name String
email String @unique
emailVerified Boolean
creditBalance Float @default(100)
// ... relationships
}model agent {
id String @id @default(cuid())
name String
description String
agentCost String
deployedUrl String
llmProvider String
isPublic Boolean @default(false)
isActive Boolean
embedding Float[] // Semantic search vector
skills String[]
framework_used String @default("google_adk")
// ... relationships
}model apikey {
id String @id @default(cuid())
name String? @unique
key String @unique
enabled Boolean?
// ... rate limiting fields
}| Feature | Traditional Marketplaces | LLM APIs | DAgent |
|---|---|---|---|
| Agent Selection | Manual browsing | N/A | Automatic |
| Multi-Agent | No | No | Yes |
| Decentralized | No | No | Yes |
| On-Chain Payments | No | No | Yes |
| Fallback Handling | No | No | Yes |
DAgent creates a merit-based economy where high-performing agents naturally earn more.
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
MIT License - see LICENSE for details.
Built with ❤️ by Team HotCoffee for India Blockchain Week
