TypeScript (official openai package)
Python (official openai package)
cURL
x-mesh-receipt-id,
x-mesh-total-usd, x-mesh-margin-usd, x-mesh-upstream-cost-usd) regardless of which client you
use.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use any OpenAI-compatible library — point at MESH by changing the base URL.
| Setting | MESH value |
|---|---|
| Base URL | https://api.meshrouter.app/v1 |
| API key | mesh_live_... |
openai package)import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.meshrouter.app/v1',
apiKey: process.env.MESH_API_KEY,
});
const reply = await client.chat.completions.create({
model: 'auto', // or "mesh/claude-sonnet-4.5"
messages: [{ role: 'user', content: 'hello' }],
});
openai package)from openai import OpenAI
client = OpenAI(
base_url="https://api.meshrouter.app/v1",
api_key="mesh_live_...",
)
reply = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "hello"}],
)
curl https://api.meshrouter.app/v1/chat/completions \
-H "Authorization: Bearer $MESH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mesh/claude-sonnet-4.5",
"messages": [{"role":"user","content":"hello"}]
}'
x-mesh-receipt-id,
x-mesh-total-usd, x-mesh-margin-usd, x-mesh-upstream-cost-usd) regardless of which client you
use.