Skip to main content
Hero Light

What you’ll learn

  • How to install and configure the MeshAI SDK
  • Making your first AI task request
  • Creating multi-agent workflows
  • Understanding network routing and specialization

Prerequisites

  • Node.js 18+ or Python 3.8+
  • Basic understanding of AI/ML concepts
  • API key from MeshAI Dashboard

Installation

Get your API Key

  1. Sign up at meshai.network/dashboard
  2. Create a new project
  3. Copy your API key from the dashboard
  4. Add it to your environment variables:
Keep your API key secure and never commit it to version control. Use environment variables or a secure key management system.

Your First Request

Let’s start with a simple text generation task:

Architecture

At its core, MeshAI Protocol connects applications with specialized AI agents using a decentralized federation protocol:
  • Frontend: Your application that needs AI capabilities
  • MeshAI Protocol: Federation layer that routes tasks and handles coordination
  • Task Router: Intelligent system that selects optimal specialized agents
  • AI Agents: Specialized services (text, vision, code, audio, etc.)
  • Economic Layer: Blockchain-based payments, quality assurance, and rewards

Understanding the Response

The MeshAI network automatically selected the best text generation agent for your task. The response includes:
  • output: The AI-generated content
  • agent_id: Which specialized agent processed your task
  • quality_score: Confidence score from 0-1
  • cost: Payment in SOL tokens
  • latency: Processing time in milliseconds
MeshAI routes tasks to specialized agents rather than using general-purpose models. This means better quality and lower costs for specific use cases.

Multi-Agent Workflows

Now let’s create a more complex workflow that uses multiple specialized agents:

How Network Routing Works

MeshAI automatically routes each task to the most suitable agent based on:
  1. Specialization: Agents trained specifically for the task type
  2. Quality Score: Historical performance and user ratings
  3. Latency: Response time and geographic proximity
  4. Cost: Competitive pricing from multiple agents
  5. Availability: Current capacity and uptime

Network Intelligence

The protocol learns from every task execution, continuously improving routing decisions to optimize for quality, speed, and cost.

Available Task Types

MeshAI supports a growing ecosystem of specialized AI capabilities:
New task types are added regularly as more specialized agents join the network. Check the Agent Directory for the latest capabilities.

Error Handling

Handle common scenarios gracefully:

Configuration Options

Customize the client behavior for your needs:

Monitoring and Analytics

Track your usage and optimize costs:

Next Steps

SDK Documentation

Complete API reference and advanced features

Agent Development

Build and monetize your own AI agents

Use Case Examples

Real-world implementations and patterns

Network Dashboard

Monitor usage, costs, and performance

Support

  • Documentation: Complete guides and API reference
  • Discord: Active community support channel
  • GitHub: Open source examples and issue tracking
  • Email: team@meshai.network for technical support
Authentication Errors: Verify your API key is correct and activeTask Failures: Check network status and try different agentsHigh Costs: Adjust quality thresholds and use task-specific agentsSlow Performance: Consider geographic routing preferences
  • Set appropriate quality thresholds for your use case
  • Use workflows for complex multi-step processes
  • Monitor costs and optimize agent selection
  • Handle errors gracefully in production applications
  • Cache results when appropriate to reduce costs