total_tokens and the selected routed model.Core concepts
Token counting
Estimate cost before routing.
Use token preflight to estimate prompt size before a paid call.
The response returns
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Estimate cost before routing.
curl https://api.meshrouter.app/v1/tokens/count \
-H "Authorization: Bearer $MESH_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "auto", "input": [{ "role": "user", "content": "Count this." }] }'
total_tokens and the selected routed model.