Complete REST API reference for decentralized AI computing
https://neurogrid.network/api
# Submit an AI task
curl -X POST https://neurogrid.network/api/tasks \
-H "Content-Type: application/json" \
-d '{
"prompt": "Explain quantum computing in simple terms",
"model": "llama2:7b",
"priority": "standard"
}'
# Response
{
"success": true,
"task_id": "task_1698234567_abc123",
"status": "queued",
"estimated_time": "3s",
"cost": {
"estimated": "$0.001",
"comparison": {
"openai": "$0.060",
"savings": "98.3%"
}
}
}
Get started in under 5 minutes
98.3% cheaper than OpenAI
Global GPU network
Currently in open beta - no authentication required for testing. Production API will require API keys.
# API Key Authentication (MainNet)
curl -X POST https://neurogrid.network/api/tasks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Hello world", "model": "llama2"}'
| User Type | Rate Limit | Burst |
|---|---|---|
| Beta User | 100 requests/hour | 10 concurrent |
| Premium | 1000 requests/hour | 50 concurrent |
Submit a new AI task for processing by the decentralized network.
{
"prompt": "string", // Required: Task prompt/input
"model": "string", // Optional: llama2:7b (default), stable-diffusion, whisper
"priority": "string" // Optional: standard (default), high, critical
}
curl -X POST https://neurogrid.network/api/tasks \
-H "Content-Type: application/json" \
-d '{
"prompt": "Write a Python function to calculate Fibonacci numbers",
"model": "llama2:7b",
"priority": "standard"
}'
{
"success": true,
"task_id": "task_1698234567_abc123",
"status": "queued",
"estimated_time": "3s",
"node": {
"id": "node_de",
"location": "Germany",
"gpu": "RTX 4090"
},
"cost": {
"estimated": "$0.001",
"comparison": {
"openai": "$0.060",
"savings": "98.3%"
}
},
"message": "Task queued for processing"
}
Retrieve the status and result of a submitted task.
curl https://neurogrid.network/api/tasks/task_1698234567_abc123
{
"success": true,
"task": {
"id": "task_1698234567_abc123",
"status": "completed",
"result": "Here's a Python function to calculate Fibonacci numbers:\n\ndef fibonacci(n):\n if n <= 1:\n return n\n return fibonacci(n-1) + fibonacci(n-2)",
"created_at": "2024-10-25T15:30:00Z",
"completed_at": "2024-10-25T15:30:03Z",
"processing_time": 2.3,
"cost": 0.001,
"tokens_used": 156,
"node": {
"id": "node_de",
"location": "Germany"
}
}
}
Large Language Model for text generation
Image generation from text prompts
Speech-to-text transcription
Join the NeuroGrid beta program to get early access and bonuses.
{
"email": "string", // Required: Valid email address
"type": "string", // Optional: developer, node-operator, researcher, startup
"source": "string" // Optional: website, product-hunt, reddit, etc.
}
curl -X POST https://neurogrid.network/api/beta/signup \
-H "Content-Type: application/json" \
-d '{
"email": "developer@example.com",
"type": "developer",
"source": "website"
}'
{
"success": true,
"message": "Successfully joined NeuroGrid Beta!",
"signup_id": "beta_1698234567_abc123",
"bonuses": {
"free_tasks": 1000,
"lifetime_discount": 15,
"priority_support": true,
"early_access": true
},
"next_steps": [
"You will receive beta access email within 24 hours",
"Follow us on social media for updates",
"Join our Discord community for early discussions"
]
}
Get real-time status of the NeuroGrid decentralized network.
curl https://neurogrid.network/api/network/status
{
"success": true,
"timestamp": "2024-10-25T15:30:00Z",
"network": {
"nodes_online": 3,
"total_tasks": 15847,
"completed_tasks": 15832,
"queued_tasks": 15,
"success_rate": 99,
"avg_response_time": "2.3s",
"cost_savings_vs_openai": "98.3%",
"uptime": "99.9%"
},
"nodes": [
{
"id": "node_de",
"location": "Germany",
"status": "online",
"gpu": "RTX 4090",
"tasks_processed": 5234
},
{
"id": "node_us",
"location": "USA",
"status": "online",
"gpu": "RTX 3090",
"tasks_processed": 4891
}
],
"stats": {
"beta_signups": 127,
"total_compute_time": "39618s",
"total_savings": "$934.67"
}
}
Health check endpoint for monitoring system status.
{
"status": "OK",
"service": "NeuroGrid",
"version": "1.0.0",
"environment": "production",
"timestamp": "2024-10-25T15:30:00Z",
"uptime": 86400,
"uptime_human": "24h 0m",
"memory": {
"used": "42MB",
"total": "128MB"
},
"network": {
"nodes_online": 3,
"total_tasks": 15847,
"beta_signups": 127
}
}
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | Invalid request parameters |
| 404 | Not Found | Resource does not exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error occurred |
{
"success": false,
"error": "Invalid request parameters",
"details": "The 'prompt' field is required",
"timestamp": "2024-10-25T15:30:00Z"
}
pip install neurogrid-python
from neurogrid import NeuroGrid
client = NeuroGrid()
result = client.submit_task(
prompt="Hello world",
model="llama2"
)
print(result.get_response())
npm install neurogrid-js
import { NeuroGrid } from 'neurogrid-js';
const client = new NeuroGrid();
const result = await client.submitTask({
prompt: 'Hello world',
model: 'llama2'
});
console.log(await result.getResponse());
Additional SDKs for Go, Rust, Java, and more languages are in development.