This document provides a comprehensive overview of all available API endpoints in aibtcdev-backend.
All API endpoints require authentication using one of the following methods:
- Bearer Token:
Authorization: Bearer <token> - API Key:
X-API-Key: <api_key> - Query Parameters:
?token=<token>or?key=<api_key>(for WebSocket)
Base path: /chat
- Endpoint:
WS /chat/ws - Authentication: Query parameter (
?token=<token>or?key=<api_key>) - Description: Real-time bidirectional chat with AI agents
- Message Types:
message: Send chat messageshistory: Request conversation history
Base path: /tools
- Endpoint:
GET /tools/ - Query Parameters:
category(optional): Filter tools by category
- Description: Returns a list of all available tools with their descriptions
- Endpoint:
GET /tools/categories - Description: Returns a list of all available tool categories
- Endpoint:
GET /tools/search - Query Parameters:
query(required): Search query for tool name or descriptioncategory(optional): Filter by category
- Description: Search for tools by name or description
- Endpoint:
POST /tools/faktory/execute_buy - Body Parameters:
btc_amount(string): Amount of BTC to spenddao_token_dex_contract_address(string): Contract principal where the DAO token is listedslippage(string, optional): Slippage tolerance in basis points (default: "15")
- Description: Execute a buy order on Faktory DEX
- Endpoint:
POST /tools/wallet/fund_testnet_faucet - Description: Request testnet STX tokens from the faucet
- Endpoint:
POST /tools/faktory/fund_testnet_sbtc - Description: Request testnet sBTC tokens from Faktory faucet
- Endpoint:
POST /tools/dao/action_proposals/propose_send_message - Body Parameters:
agent_account_contract(string): Contract principal of the agent accountaction_proposals_voting_extension(string): Contract principal for DAO action proposalsaction_proposal_contract_to_execute(string): Contract principal of the action proposaldao_token_contract_address(string): Contract principal of the DAO tokenmessage(string): Message to be sent through the DAO proposal systemmemo(string, optional): Optional memo for the proposal
- Description: Create a proposal for sending a message via the DAO action proposal system
- Endpoint:
POST /tools/dao/action_proposals/veto_proposal - Body Parameters:
dao_action_proposal_voting_contract(string): Contract principal for DAO action proposalsproposal_id(string): ID of the proposal to veto
- Description: Veto an existing DAO action proposal
- Endpoint:
POST /tools/dao/proposal_recommendations/generate - Body Parameters:
dao_id(UUID): The ID of the DAOfocus_area(string, optional): Specific area of focus (default: "general improvement")specific_needs(string, optional): Specific needs or requirementsmodel_name(string, optional): LLM model to use (default: "gpt-4.1")temperature(number, optional): Temperature for LLM generation (default: 0.1)
- Description: Generate AI-powered proposal recommendations for a DAO
- Endpoint:
POST /tools/agent_account/approve_contract - Body Parameters:
agent_account_contract(string): Contract principal of the agent accountcontract_to_approve(string): The contract principal to approve
- Description: Approve a contract for use with an agent account
- Endpoint:
POST /tools/evaluation/comprehensive - Body Parameters:
proposal_id(string): Unique identifier for the proposalproposal_content(string, optional): Override proposal contentdao_id(UUID, optional): DAO ID for contextcustom_system_prompt(string, optional): Custom system promptcustom_user_prompt(string, optional): Custom user promptconfig(object, optional): Configuration for the evaluation agent
- Description: Run comprehensive AI evaluation on a proposal
- Endpoint:
GET /tools/evaluation/default_prompts - Description: Get the default system and user prompts for comprehensive evaluation
- Endpoint:
GET /tools/social/twitter_embed - Query Parameters:
url(required): Twitter/X.com URL to embedmedia_max_width(optional): Maximum width for media (default: 560)hide_thread(optional): Whether to hide the thread (default: false)
- Description: Proxy endpoint for Twitter oembed API to avoid CORS issues
Base path: /webhooks
- Endpoint:
POST /webhooks/chainhook - Authentication: Bearer token via
Authorizationheader - Description: Process blockchain events from chainhook services
- Endpoint:
POST /webhooks/dao - Authentication: Bearer token via
Authorizationheader - Description: Handle DAO creation events and setup associated entities
{
"success": true,
"output": "Operation completed successfully",
"data": { ... }
}{
"type": "error",
"message": "Description of the error"
}{
"type": "message|history|error",
"thread_id": "uuid",
"content": "message content",
"agent_id": "uuid (optional)"
}200: Success400: Bad Request (invalid parameters)401: Unauthorized (invalid or missing authentication)404: Not Found (resource doesn't exist)408: Request Timeout500: Internal Server Error
- Authentication Errors: Invalid or expired tokens
- Validation Errors: Missing or invalid request parameters
- Resource Errors: Requested resource not found
- Network Errors: Blockchain or external service connectivity issues
- Rate Limit Errors: API rate limits exceeded
WebSocket connections automatically handle disconnections and provide error messages in the following format:
{
"type": "error",
"message": "Error description"
}