Models APIRegister & Manage AI Models
Upload, manage, and execute machine learning models across the ML Bridge decentralized network.
Development Preview
The REST API and SDKs described below are planned for future release. Currently, ML Bridge operates through on-chain smart contracts on Base Sepolia. You can interact with contracts directly using viem/wagmi or ethers.js. See the Smart Contracts documentation for current integration methods.
Endpoints
Complete list of Models API endpoints.
/api/modelsRetrieve a paginated list of all available models with metadata and status.
/api/modelsUpload and register a new ML model to the bridge network.
/api/models/{id}Get detailed information about a specific model including performance metrics.
/api/models/{id}/executeExecute inference on a deployed model with provided input data.
/api/models/{id}Update model metadata, configuration, or deploy a new version.
/api/models/{id}Remove a model from the bridge network and clean up associated resources.
Example Request
Register a new model on the network.
Request
POST /api/models
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Sentiment Analyzer",
"description": "NLP model for sentiment analysis",
"category": "nlp",
"modelHash": "QmX1Y2Z3...",
"pricing": {
"inputTokens": 0.02,
"outputTokens": 0.04
},
"capabilities": ["sentiment-analysis"],
"metadata": {
"version": "1.0.0",
"framework": "pytorch"
}
}Response
{
"modelId": "model_456",
"status": "pending_verification",
"message": "Model submitted for verification",
"createdAt": "2025-01-15T10:30:00Z"
}Rate Limits
Error Codes
{
"error": {
"code": "MODEL_NOT_FOUND",
"message": "Model not found"
}
}