Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meshrouter.app/llms.txt

Use this file to discover all available pages before exploring further.

import { MeshClient } from "@mesh/sdk";

const mesh = new MeshClient({ apiKey: process.env.MESH_API_KEY! });

const response = await mesh.chat.completions.create({
  model: "auto",
  messages: [{ role: "user", content: "route this privately" }],
  stream: true,
});

console.log(response.receipt?.id);
The SDK defaults to https://api.meshrouter.app/v1.

Operations helpers

await mesh.accounts.current();
await mesh.accounts.updateLimits("acct_live", {
  monthlyUsdLimit: 500,
  requestsPerMinute: 120,
});

await mesh.usage.retrieve({ accountId: "acct_live" });
await mesh.logs.list({ accountId: "acct_live", limit: 50 });
await mesh.monitoring.summary({ accountId: "acct_live", window: "1h" });

const intent = await mesh.payments.retrieveIntent("pay_live");
Routing settings and provider health live behind the operator console — see Provider configuration for the operator-facing admin endpoints. Day-to-day SDK use only needs an API key and a model id.