How to use MeshInfer.AI
From zero to your first AI inference call in under 5 minutes. Follow the steps below to set up routing, send requests, and monitor usage.
- Sign up & choose a plan
- Generate an API key
- Install the SDK
- Make your first inference call
- Review usage & costs
Sign up & choose a plan
Visit the Pricing page to choose the plan that fits your usage. The Developer plan is the best starting point for individuals and small teams — it includes 100k requests/month at $499/mo.
| Developer | $499/mo · 100k requests · local + cloud routing |
| Startup | $1,050/mo · 2M requests · mesh routing enabled |
| Growth | $2,499/mo · 20M requests · priority routing + SLA |
| Enterprise | $10,000+/mo · unlimited · dedicated cluster + HIPAA BAA |
Click Get started on any plan to go through the checkout. After payment you'll be redirected to your dashboard.
Generate an API key
Navigate to API Key Manager. Click Create new key, give it a descriptive name (e.g. prod-app-v1), and optionally set:
| Rotation schedule | e.g. every 90 days — recommended for production |
| IP restriction | Lock the key to specific CIDR ranges |
| Rate limit | Override the plan default per-key |
| Expiry date | Set a hard expiry for short-lived keys |
Install the SDK
Choose your runtime:
npm install @meshinfer/sdk
# or
yarn add @meshinfer/sdkpip install meshinfer# Just change the base URL in your existing OpenAI client:
client = OpenAI(
base_url="https://api.meshinfer.ai/v1",
api_key="msk_live_…"
)For React apps, import the provider at your app root. Full examples are in the API & SDK reference →
Make your first inference call
The SDK automatically discovers the best route (local → mesh → cloud) for every request. No routing logic needed on your side.
import { MeshInfer } from '@meshinfer/sdk';
const client = new MeshInfer({ apiKey: process.env.MESHINFER_API_KEY });
const response = await client.chat.completions.create({
model: 'auto', // let the router pick the best model/route
messages: [
{ role: 'user', content: 'Explain quantum key distribution in one paragraph.' }
],
stream: true, // streaming is fully supported
});
for await (const chunk of response) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}from meshinfer import MeshInfer
client = MeshInfer(api_key="msk_live_…")
response = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Hello from MeshInfer!"}]
)
print(response.choices[0].message.content)Configure routing preferences
By default, the router uses a balanced mode — optimising for cost and latency. You can override per-request or globally via a Routing Policy.
// Per-request override
await client.chat.completions.create({
model: 'auto',
messages: […],
// MeshInfer extensions
meshinfer: {
privacy_policy: 'local_only', // never leave the device
cost_preference: 'cheap', // aggressively favour local/mesh
latency_budget_ms: 2000, // cloud fallback if local > 2s
}
});For persistent rules, create a Routing Policy in the dashboard — pin regions, enable weighted A/B traffic splits, or set hard no-cloud rules.
Review usage & monitor costs
After sending requests, check these dashboards to understand your spend and performance:
Earn by contributing your device to the mesh
If your device has WebGPU or native ML runtime support, you can run the Hardware Capability Benchmark to see your eligible tier and estimated monthly earnings. Devices that qualify can opt in to serve inference tasks for other platform users during idle time.
| Observer | $2–5/mo · any modern browser with WebGPU |
| Seedling | $5–15/mo · mid-range GPU, 8GB VRAM |
| Reliable | $15–40/mo · RTX 3080+ or M2 Pro |
| Trusted | $40–80/mo · RTX 4090 or M3 Max |
| Elite | $80–150+/mo · multi-GPU or dedicated server |
