# Account & API Keys
Source: https://inference.docs.tensormesh.ai/account-and-api-keys
Manage your profile, API keys, and notification preferences.
Navigate to **Management → Account** to manage your profile, API keys, and notification settings.
***
## Profile
Update your display name, first name, last name, and company details. Your email address is read-only — it's managed by your OAuth provider (Google or GitHub).
**Notifications** — Toggle system notifications for browser push alerts and email notifications for deployment and billing events.
**Delete Account** — Permanently removes your account. You'll be asked to confirm with your email address before anything is deleted.
***
## API Keys Tab
API keys are used to authenticate requests to the serverless inference API. Each key is scoped to your account.
### Creating an API Key
Click **Create API Key** and give your key a name. A unique name is auto-generated (e.g. `key_xxxxxx`) if you leave the field blank. The full key value is shown once on creation — copy it immediately.
### Managing Keys
* **Show / Hide** — Toggle visibility of the key value
* **Copy** — Copy the key to your clipboard (shows "Copied!" confirmation)
* **Delete** — Permanently revoke the key
### Using Your API Key
Pass your API key as a bearer token in the `Authorization` header of every serverless inference request:
```sh theme={null}
curl https://serverless.tensormesh.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "MiniMaxAI/MiniMax-M2.5", "messages": [{"role": "user", "content": "Hello"}]}'
```
The **Deploy → Serverless** page also pre-fills your active API key directly into the code examples for each model, so you can copy a ready-to-run request without leaving the UI.
Treat your API key like a password. Never commit it to version control or expose it in client-side code.
# Additional Resources
Source: https://inference.docs.tensormesh.ai/additional-resources
Helpful links and documentation to enhance your Tensormesh experience
Explore these resources to get the most out of Tensormesh and expand your knowledge of the underlying technologies.
Find answers to frequently asked questions about Tensormesh.
Full endpoint documentation with an interactive playground and code examples in cURL, Python, and JavaScript.
Official SDKs for integrating Tensormesh into your Python applications and AI workflows.
The `tm` command-line tool for managing inference, billing, models, and account resources.
The open-source KV cache engine powering Tensormesh's persistent caching layer.
Learn more about vLLM, the high-throughput inference engine that powers serverless inference.
# Chat and Streaming
Source: https://inference.docs.tensormesh.ai/ai-sdk/guides/chat-and-streaming
Generate and stream text with Tensormesh chat and completion models.
## Generate A Single Response
`tensormesh(modelId)`, `tensormesh.chatModel(modelId)`, and `tensormesh.languageModel(modelId)` create AI SDK chat models backed by `/v1/chat/completions`.
```ts theme={null}
import { generateText } from "ai";
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const result = await generateText({
model: tensormesh("Qwen/Qwen3-Coder-30B-A3B-Instruct"),
prompt: "Write a concise implementation plan for adding streaming chat.",
});
console.log(result.text);
```
## Stream A Response
```ts theme={null}
import { streamText } from "ai";
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const result = streamText({
model: tensormesh("Qwen/Qwen3-Coder-30B-A3B-Instruct"),
prompt: "Explain how serverless inference helps developer tooling.",
});
for await (const text of result.textStream) {
process.stdout.write(text);
}
```
## Text Completions
Use `completionModel` when you specifically need the `/v1/completions` route.
```ts theme={null}
import { generateText } from "ai";
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const result = await generateText({
model: tensormesh.completionModel("openai/gpt-oss-20b"),
prompt: "Complete this sentence: Serverless inference is useful because",
});
console.log(result.text);
```
For most applications, prefer `tensormesh(modelId)` because chat models support richer AI SDK features such as tool calling and structured output.
# Getting Started
Source: https://inference.docs.tensormesh.ai/ai-sdk/guides/getting-started
Install the Tensormesh AI SDK provider and make your first serverless request.
## Install
```bash theme={null}
npm install ai @tensormesh/ai-sdk-provider
```
Set your inference API key:
```bash theme={null}
export TENSORMESH_INFERENCE_API_KEY="YOUR_INFERENCE_API_KEY"
```
## Generate Text
```ts theme={null}
import { generateText } from "ai";
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const { text } = await generateText({
model: tensormesh("deepseek-ai/DeepSeek-V4-Flash"),
prompt: "Explain Tensormesh in one sentence.",
});
console.log(text);
```
## Stream Text
```ts theme={null}
import { streamText } from "ai";
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const result = streamText({
model: tensormesh("deepseek-ai/DeepSeek-V4-Flash"),
prompt: "Count from 1 to 5 as a short comma-separated list.",
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}
process.stdout.write("\n");
```
## List Model IDs
Use the exact model IDs returned by the models endpoint.
This helper does not require an inference API key.
```ts theme={null}
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const models = await tensormesh.models.list();
for (const model of models.data) {
console.log(model.id);
}
```
# Raw Inference Helpers
Source: https://inference.docs.tensormesh.ai/ai-sdk/guides/raw-helpers
Call additional Tensormesh endpoints exposed by the provider.
The provider includes direct helpers for Tensormesh endpoints that are not represented by an AI SDK language model object.
## Models
```ts theme={null}
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const models = await tensormesh.models.list();
console.log(models.data.map((model) => model.id));
```
## Responses
```ts theme={null}
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const response = await tensormesh.responses.create({
model: "deepseek-ai/DeepSeek-V4-Flash",
input: "Write a short product announcement.",
});
console.log(response);
```
For streaming Responses API calls:
```ts theme={null}
const stream = await tensormesh.responses.stream({
model: "deepseek-ai/DeepSeek-V4-Flash",
input: "Stream a short product announcement.",
});
const reader = stream.body?.getReader();
const decoder = new TextDecoder();
while (reader) {
const { value, done } = await reader.read();
if (done) break;
process.stdout.write(decoder.decode(value, { stream: true }));
}
```
## Tokenize And Detokenize
```ts theme={null}
const tokenized = await tensormesh.tokenize.create({
model: "deepseek-ai/DeepSeek-V4-Flash",
prompt: "Hello from Tensormesh",
});
const detokenized = await tensormesh.detokenize.create({
model: "deepseek-ai/DeepSeek-V4-Flash",
tokens: tokenized.tokens,
});
```
## Health And Version
```ts theme={null}
const health = await tensormesh.health.get();
const version = await tensormesh.version.get();
console.log({ health, version });
```
The serverless `models`, `health`, and `version` endpoints can be called without an inference API key. Generation, Responses API, tokenize, and detokenize requests require an API key.
# Structured Output
Source: https://inference.docs.tensormesh.ai/ai-sdk/guides/structured-output
Generate schema-backed JSON with the Tensormesh AI SDK provider.
Structured output is requested through the AI SDK chat model call. With `tensormesh(modelId)`, the request is sent to `/v1/chat/completions` and the AI SDK parses the response against your schema.
```ts theme={null}
import {
extractJsonMiddleware,
Output,
streamText,
wrapLanguageModel,
} from "ai";
import { tensormesh } from "@tensormesh/ai-sdk-provider";
import { z } from "zod";
const launchPlanSchema = z.object({
title: z.string(),
audience: z.string(),
summary: z.string(),
integrationSteps: z.array(
z.object({
step: z.string(),
detail: z.string(),
}),
),
successSignals: z.array(z.string()),
});
const result = streamText({
model: wrapLanguageModel({
model: tensormesh("deepseek-ai/DeepSeek-V4-Flash"),
middleware: extractJsonMiddleware(),
}),
prompt:
"Create a launch plan for a TypeScript team adopting Tensormesh serverless inference. Return only the JSON object.",
output: Output.object({
schema: launchPlanSchema,
}),
});
for await (const partialObject of result.partialOutputStream) {
console.log(partialObject);
}
```
Structured output is useful when your application needs predictable JSON for forms, workflow plans, routing decisions, or typed UI state.
Use `extractJsonMiddleware()` when a model may wrap JSON in Markdown code fences.
# Tool Calling
Source: https://inference.docs.tensormesh.ai/ai-sdk/guides/tool-calling
Use AI SDK tools with Tensormesh chat models.
Tool calling lets the model choose arguments for functions defined by your application. With `tensormesh(modelId)`, AI SDK tool calls are sent through `/v1/chat/completions`.
```ts theme={null}
import { streamText, stepCountIs, tool } from "ai";
import { tensormesh } from "@tensormesh/ai-sdk-provider";
import { z } from "zod";
const modelId = "Qwen/Qwen3-Coder-30B-A3B-Instruct";
const result = streamText({
model: tensormesh(modelId),
prompt: "What is 128 multiplied by 7? Use the calculator tool.",
tools: {
calculator: tool({
description: "Run one arithmetic operation.",
inputSchema: z.object({
operation: z.enum(["add", "subtract", "multiply", "divide"]),
left: z.number(),
right: z.number(),
}),
execute: async ({ operation, left, right }) => {
switch (operation) {
case "add":
return { result: left + right };
case "subtract":
return { result: left - right };
case "multiply":
return { result: left * right };
case "divide":
return { result: right === 0 ? null : left / right };
}
},
}),
},
prepareStep: async ({ stepNumber }) =>
stepNumber === 0
? {
toolChoice: modelId.toLowerCase().includes("gpt-oss")
? "auto"
: "required",
}
: {},
stopWhen: stepCountIs(3),
});
for await (const text of result.textStream) {
process.stdout.write(text);
}
```
Use `toolChoice: "auto"` for GPT OSS models. Use `toolChoice: "required"` when the selected model supports it and you want to force a tool call in a demo or test.
## Responses API Tool Calls
The package also exposes raw `/v1/responses` helpers. When you call the Responses API directly, use the endpoint payload shape and include a boolean `strict` value for function tools.
Responses API tool-calling support is model-dependent; `lukealonso/GLM-5.1-NVFP4-MTP` does not currently support tool calling through `/v1/responses`.
```ts theme={null}
import { tensormesh } from "@tensormesh/ai-sdk-provider";
const response = await tensormesh.responses.create({
model: "openai/gpt-oss-20b",
input: "What is the weather in Bangkok? Use the weather tool.",
tools: [
{
type: "function",
name: "weather",
description: "Return weather for a city.",
strict: true,
parameters: {
type: "object",
properties: {
city: { type: "string" },
},
required: ["city"],
additionalProperties: false,
},
},
],
tool_choice: "auto",
});
console.log(response);
```
# Tensormesh AI SDK Provider
Source: https://inference.docs.tensormesh.ai/ai-sdk/index
Use Tensormesh serverless inference from JavaScript and TypeScript applications through the AI SDK.
`@tensormesh/ai-sdk-provider` adds Tensormesh language models to the Vercel AI SDK. JavaScript and TypeScript applications can use AI SDK functions such as `generateText` and `streamText` while requests are sent to Tensormesh text inference endpoints.
Calling `tensormesh(modelId)` creates a chat model backed by `/v1/chat/completions`. Calling `tensormesh.completionModel(modelId)` creates a completion model backed by `/v1/completions`. Structured output and tool calling are requested through chat model calls. Raw helpers expose additional inference endpoints such as `/v1/responses`.
## Install
```bash theme={null}
npm install ai @tensormesh/ai-sdk-provider
```
The package requires Node.js 20 or newer.
## What It Supports
* Serverless inference by default at `https://serverless.tensormesh.ai/v1`
* Text generation and streaming with chat models over `/v1/chat/completions`
* Text completions over `/v1/completions`
* Structured output through AI SDK chat model calls
* Tool calling through AI SDK chat model calls
* Model-specific reasoning controls through `providerOptions.tensormesh.chat_template_kwargs`
* Direct helper methods for `/v1/models`, `/v1/responses`, `/tokenize`, `/detokenize`, `/health`, and `/version`
## Provider API
```ts theme={null}
import { createTensormesh, tensormesh } from "@tensormesh/ai-sdk-provider";
// Default serverless provider.
const model = tensormesh("deepseek-ai/DeepSeek-V4-Flash");
// Explicit provider configuration.
const serverless = createTensormesh({
apiKey: process.env.TENSORMESH_INFERENCE_API_KEY,
});
```
The default provider instance, `tensormesh`, is equivalent to
`createTensormesh()` with serverless defaults. Authenticated requests read
`TENSORMESH_INFERENCE_API_KEY` unless you pass `apiKey` explicitly.
Importing or creating a provider instance does not require an API key.
## Common Guides
* [Getting started](/ai-sdk/guides/getting-started)
* [Provider configuration](/ai-sdk/guides/provider-configuration)
* [Chat and streaming](/ai-sdk/guides/chat-and-streaming)
* [Structured output](/ai-sdk/guides/structured-output)
* [Tool calling](/ai-sdk/guides/tool-calling)
* [Reasoning controls](/ai-sdk/guides/reasoning-controls)
* [Raw inference helpers](/ai-sdk/guides/raw-helpers)
* [Playground](/ai-sdk/guides/playground)
# API Quickstart
Source: https://inference.docs.tensormesh.ai/api-quickstart
Make a first successful raw Control Plane and Inference API request with explicit credentials.
This page covers the fastest raw-API paths in Tensormesh.
For direct HTTP callers, treat `429` as rate limiting, honor `Retry-After` when present, and be conservative about retrying non-idempotent POST requests automatically.
Use it when you want to:
* make a first successful Inference API request with `curl` from explicit environment variables
* make a first successful Control Plane request with `curl`
## 1. Choose The Surface
* **Control Plane**: management APIs such as users, models, billing, tickets, logs, and metrics
* **Inference API**: serverless OpenAI-compatible `POST /v1/chat/completions` plus `models`, `completions`, `responses`, `tokenize`, `detokenize`, `health`, and `version`
You can use both from the same machine, but they authenticate differently:
* Control Plane uses `Authorization: Bearer `
* Inference API uses `Authorization: Bearer ` for POST routes; the public host also serves `GET /v1/models`, `GET /health`, and `GET /version` without auth
## 2. Fastest Standalone Inference Request
If you already have explicit inference credentials, you do not need the CLI for a first raw inference request.
```sh theme={null}
SERVERLESS_BASE="https://serverless.tensormesh.ai"
SERVERLESS_API_KEY="YOUR_INFERENCE_API_KEY"
SERVERLESS_MODEL_NAME="YOUR_SERVERLESS_MODEL_NAME"
curl -sS \
-H "Authorization: Bearer $SERVERLESS_API_KEY" \
-H "Content-Type: application/json" \
"$SERVERLESS_BASE/v1/chat/completions" \
-d '{
"model": "'"$SERVERLESS_MODEL_NAME"'",
"messages": [
{"role": "user", "content": "Say hello."}
]
}'
```
Replace `YOUR_SERVERLESS_MODEL_NAME` with a serverless model name that is available on your target host.
Other verified serverless routes on this host are `/v1/models`, `/v1/completions`, `/v1/responses`, `/tokenize`, `/detokenize`, `/health`, and `/version`. Use the dedicated pages under [Serverless API Reference](/api-reference/serverless) when you need those request and response shapes.
If you have Control Plane access for the same Tensormesh environment, discover
published serverless models with `tm billing pricing serverless list` and use
the returned `pricing[].model` value in the request body. If you only have
inference credentials, or you are targeting a different serverless host
override, ask your operator or admin for the exact serverless `model` string
for that host before sending
the request. Read [Choose A Serverless Model Name](/serverless-model-selection)
if you need the full decision flow.
### Streaming Example
Serverless SSE example:
```sh theme={null}
curl -N \
-H "Authorization: Bearer $SERVERLESS_API_KEY" \
-H "Accept: text/event-stream" \
-H "Content-Type: application/json" \
"$SERVERLESS_BASE/v1/chat/completions" \
-d '{
"model": "'"$SERVERLESS_MODEL_NAME"'",
"stream": true,
"messages": [
{"role": "user", "content": "Reply with two short tokens."}
]
}'
```
The same SSE contract also applies to `POST /v1/completions` and `POST /v1/responses` when the request body includes `"stream": true`.
The stream is emitted as data-only SSE and terminates with `data: [DONE]`.
## 3. Get A Control Plane Bearer Token
If you already have a Control Plane bearer token, export it directly:
```sh theme={null}
TOKEN="YOUR_CONTROL_PLANE_TOKEN"
```
If you are using the standard CLI login flow instead, log in first:
```sh theme={null}
tm auth login
tm auth whoami
```
If you need to target a different Control Plane host for this session, set it
explicitly before login:
```sh theme={null}
tm --controlplane-base https://api.gcpstaging.tensormesh.ai auth login
```
Then, in a controlled shell, capture the current bearer token:
```sh theme={null}
TOKEN="$(tm auth print-token --yes-i-know)"
```
`tm auth whoami` and the request below both use `GET /auth/profile`, which is the stable bearer-token validation endpoint for the Control Plane.
## 4. First Control Plane Request
Use the current default Control Plane base URL, or replace it with an
explicit override for your environment. If you are already using the CLI flow,
the current default Control Plane host is `https://api.tensormesh.ai`, and you
can confirm whether you are still on that host or on an environment-specific
override by inspecting the resolved `controlplane_base` first:
```sh theme={null}
tm --output json config show --sources
```
If you are using the CLI flow, export the currently resolved host before you
run `curl`:
```sh theme={null}
CONTROLPLANE_BASE="$(tm --output json config show | python3 -c 'import json,sys; print(json.load(sys.stdin)[\"controlplane_base\"])')"
```
If you are not using the CLI flow, set the environment-specific host explicitly
instead:
```sh theme={null}
CONTROLPLANE_BASE="https://YOUR_CONTROLPLANE_BASE"
```
Validate the token directly:
```sh theme={null}
curl -sS \
-H "Authorization: Bearer $TOKEN" \
"${CONTROLPLANE_BASE}/auth/profile"
```
Then fetch a common resource:
```sh theme={null}
curl -sS \
-H "Authorization: Bearer $TOKEN" \
"${CONTROLPLANE_BASE}/v1/models?size=10"
```
## 5. What Is Public Versus CLI-Flow Internal
* `GET /auth/profile` is a stable bearer-token endpoint and is published in the Control Plane API reference.
* `/auth/cli/start`, `/auth/cli/exchange`, and `/auth/cli/refresh` are used by the CLI browser-login flow. They are documented in the CLI auth guide, but they are not the stable raw-API integration surface for external clients.
## 6. If Something Fails
* `401` on Control Plane:
* run `tm auth whoami` again
* refresh with `tm auth refresh`
* `401` on inference:
* check the explicit API key you passed, or `[overrides].gateway_api_key` in `config.toml` if you are using the CLI-assisted flow
* not sure which credentials are loaded:
* run `tm auth status --exit-status`
* run `tm infer doctor --exit-status`
## Related Docs
* [CLI Authentication Guide](/cli/guides/authentication)
* [CLI First Inference Request](/cli/guides/first-request)
* [Inference API Reference](/api-reference)
* [Serverless Chat Completions Reference](/api-reference/serverless)
* [Choose A Serverless Model Name](/serverless-model-selection)
* [Control Plane API Reference](/tensormesh-api)
# API & SDK Reference
Source: https://inference.docs.tensormesh.ai/api-reference/introduction
Complete API and SDK reference for the Tensormesh Serverless Inference and Control Plane APIs.
## Serverless Inference API
The Tensormesh Serverless Inference API provides an **OpenAI-compatible** chat completions endpoint for running inference on Tensormesh-hosted serverless models.
**Base URL:** `https://serverless.tensormesh.ai`
### Authentication
| Header | Description |
| --------------- | ------------------------------ |
| `Authorization` | Bearer token with your API key |
`GET /v1/models`, `/health`, and `/version` also work on the public serverless host without auth.
### Quick Example
```bash theme={null}
curl https://serverless.tensormesh.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer " \
-d '{
"model": "",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello!" }
]
}'
```
## Tensormesh Control Plane API
The Control Plane API lets you programmatically manage models, billing, observability, support tickets, and user accounts.
**Base URL:** `https://api.tensormesh.ai`
Authentication for Control Plane APIs uses a **JWT Bearer token** obtained through your login session.
Browse the API groups in the sidebar to explore all available endpoints.
# Serverless Chat Completions
Source: https://inference.docs.tensormesh.ai/api-reference/serverless
api-reference/serverless.openapi.yaml POST /v1/chat/completions
OpenAI-compatible chat completions endpoint on the public Tensormesh Serverless host.
Use this page when you want the public serverless inference surface.
* Auth: `Authorization: Bearer `
* Host: `https://serverless.tensormesh.ai`
* Compatibility: OpenAI-compatible chat completions
* Best for: the closest raw-HTTP match to an OpenAI-style chat request
If you have Control Plane access for the same Tensormesh environment, discover published serverless models with `tm billing pricing serverless list` and use the returned `pricing[].model` value in the request body. If you are targeting a different serverless host override, or you only have inference credentials, get the model name from your Tensormesh environment before sending the request. Start with [Choose A Serverless Model Name](/serverless-model-selection) if you do not already know the model name you need.
Other verified serverless reference pages:
* [List Models](/api-reference/serverless/models)
* [Create Completion](/api-reference/serverless/completions)
* [Create Response](/api-reference/serverless/responses)
* [Tokenize Text](/api-reference/serverless/tokenize)
* [Detokenize Tokens](/api-reference/serverless/detokenize)
* [Health Check](/api-reference/serverless/health)
* [Get Version](/api-reference/serverless/version)
For raw request setup, see [API Quickstart](/api-quickstart).
# Serverless Text Completions
Source: https://inference.docs.tensormesh.ai/api-reference/serverless/completions
api-reference/serverless.openapi.yaml POST /v1/completions
Create text completions on the verified Tensormesh Serverless host.
Use this page when you want the serverless text-completions endpoint instead of chat completions.
* Auth: `Authorization: Bearer `
* Host: `https://serverless.tensormesh.ai`
* Model: pass a serverless model name in the JSON request body
If you need the OpenAI-style chat shape instead, use [Serverless Chat Completions](/api-reference/serverless).
# Serverless Detokenize
Source: https://inference.docs.tensormesh.ai/api-reference/serverless/detokenize
api-reference/serverless.openapi.yaml POST /detokenize
Convert token ids back to text with the verified Tensormesh Serverless host.
Use this page when you want to turn token ids back into text for a specific serverless model.
* Auth: `Authorization: Bearer `
* Host: `https://serverless.tensormesh.ai`
* Model: pass a serverless model name in the JSON request body
# Serverless Health
Source: https://inference.docs.tensormesh.ai/api-reference/serverless/health
api-reference/serverless.openapi.yaml GET /health
Read the verified Tensormesh Serverless health endpoint.
Use this page when you want the raw serverless health check endpoint.
* Auth: none required on the public host; `Authorization: Bearer ` is also accepted
* Host: `https://serverless.tensormesh.ai`
# Serverless Models
Source: https://inference.docs.tensormesh.ai/api-reference/serverless/models
api-reference/serverless.openapi.yaml GET /v1/models
List models from the verified Tensormesh Serverless host.
Use this page when you need the raw model catalog from the verified serverless inference host.
* Auth: none required on the public host; `Authorization: Bearer ` is also accepted
* Host: `https://serverless.tensormesh.ai`
* Best for: discovering the exact `model` string to reuse in serverless requests
If you also have Control Plane access for the same Tensormesh environment, compare the result here with [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list).
# Serverless Responses
Source: https://inference.docs.tensormesh.ai/api-reference/serverless/responses
api-reference/serverless.openapi.yaml POST /v1/responses
Create responses on the verified Tensormesh Serverless host.
Use this page when you want the verified serverless responses endpoint over raw HTTP.
* Auth: `Authorization: Bearer `
* Host: `https://serverless.tensormesh.ai`
* Model: pass a serverless model name in the JSON request body
If you are choosing between raw HTTP and the Python SDK, the matching SDK namespace is `client.inference.serverless.responses`.
# Serverless Tokenize
Source: https://inference.docs.tensormesh.ai/api-reference/serverless/tokenize
api-reference/serverless.openapi.yaml POST /tokenize
Tokenize text with the verified Tensormesh Serverless host.
Use this page when you want token ids for a specific serverless model.
* Auth: `Authorization: Bearer `
* Host: `https://serverless.tensormesh.ai`
* Model: pass a serverless model name in the JSON request body
# Serverless Version
Source: https://inference.docs.tensormesh.ai/api-reference/serverless/version
api-reference/serverless.openapi.yaml GET /version
Read the verified Tensormesh Serverless version endpoint.
Use this page when you want the raw serverless version endpoint.
* Auth: none required on the public host; `Authorization: Bearer ` is also accepted
* Host: `https://serverless.tensormesh.ai`
# Billing & Usage
Source: https://inference.docs.tensormesh.ai/billing-and-savings
Manage your account balance, payment methods, and transaction history.
Navigate to **Management → Billing** to manage your balance, payment methods, and transaction history.
***
## Your Account Balance
Tensormesh uses a prepaid credit balance. Every inference request and External Storage subscription draws from your balance in real time. When your balance runs low, top it up from the **Overview** tab by clicking **+ Add Balance**.
The Overview tab also shows a spending summary for today, the last 7 days, and the last 30 days so you can track how quickly you're drawing down your credits.
***
## Adding Funds
Navigate to **Management → Billing** in the sidebar.
Click **+ Add Balance** on the Overview tab. Enter the amount you want to load and confirm with your saved payment method.
Your balance is updated immediately after payment.
***
## Managing Payment Methods
Navigate to the **Payment Methods** tab under **Management → Billing**.
* **Add a card** — Click **Add Payment Method** and enter your card details.
* **Remove a card** — Open the card's dropdown menu and select **Remove**.
* **Billing address** — A billing address is required alongside a payment method. When adding a card, you'll be prompted to complete your billing address if one isn't on file. You can update it anytime from this tab.
Both a valid card and a billing address must be on file to add credit on the platform.
***
## Transaction History
The **Transactions** tab shows a full history of every charge and balance addition, grouped by month.
* Click any transaction to see a full breakdown, including model-level token usage where applicable.
* Use **Export CSV** to download your complete transaction history for accounting or reconciliation.
***
## Related
* [Serverless Usage](/serverless-usage)
* [Cache Savings](/cache-savings)
* [Pricing Overview](/pricing-overview)
# Cache Savings
Source: https://inference.docs.tensormesh.ai/cache-savings
See how much Tensormesh's KV caching is saving you across your serverless inference.
Navigate to **Management → Cache Savings** to see a dollar breakdown of what Tensormesh's KV caching is saving you over time.
***
## Understanding Your Savings
Cache savings = money you didn't spend because tokens were served from the KV cache instead of being recomputed.
* Every request that reuses a cached prefix (system prompt, shared document, conversation history) costs **\$0.00** for those tokens
* The savings figure shows what those cached tokens would have cost at the standard input rate
* A growing savings number means your prompts are well-structured and your cache is being used effectively
* Low savings relative to input spend usually means requests aren't sharing consistent prefixes
***
## How Savings Are Calculated
**Estimated cache savings = cached token count × standard input rate for that model**
Example: 1,000 requests each reusing a 2,000-token system prompt → 2,000,000 tokens saved. The higher your request volume and the more consistent your prompts, the faster savings compound.
***
## Maximizing Your Savings
Keep your system prompt identical across requests. Even a single character change creates a cache miss.
Structure prompts so that static content (system prompt, shared context) comes before variable content (the user's latest message). The cache matches from the start of the prompt.
[External Storage](/external-storage) persists your KV cache across sessions — dramatically increasing the fraction of requests that hit the cache for returning workloads.
Check for per-model cache hit rates. Low hit rates on specific models often signal inconsistent prefix structure in those request flows.
***
## Related
* [Pricing Overview](/pricing-overview)
* [Serverless Usage](/serverless-usage)
* [External Storage](/external-storage)
# Changelog
Source: https://inference.docs.tensormesh.ai/changelog
Latest updates, new features, and improvements to Tensormesh Inference.
## September 1, 2026
**New Serverless Models**
Two new models are now available for serverless inference:
| Model | Family | Parameters | Context |
| --------------- | ------- | ---------- | ------- |
| Kimi-K2.7-Code | Kimi | 1T | 256K |
| Qwen3.8-27B-FP8 | Qwen3.8 | 27B | 262K |
See [Serverless Inference](/serverless-inference#available-models) for more details.
***
## July 20, 2026
**External Storage Plan Limits** — Fixed an issue where External Storage plan limits were applied per model instead of to your bucket as a whole, letting total cached data exceed your plan's capacity. Your bucket is now shared evenly across serverless models, so each model is capped at its equal share. ([External Storage](/external-storage))
***
## July 6, 2026
**New Serverless Model: GLM-5.2-NVFP4**
`lukealonso/GLM-5.2-NVFP4` is now available for serverless inference, replacing `lukealonso/GLM-5.1-NVFP4-MTP`. This updated GLM-5.2 release brings improved performance over its predecessor while retaining the same 128K context window and NVFP4 quantization for efficient, high-throughput inference. ([Serverless Inference](/serverless-inference))
***
**Observability Metrics**
Three new charts are now live on **Operations → Observability**:
* **Time to First Token** — average latency from request submission to the first token returned
* **Input Throughput** — prompt tokens processed per second across your active requests
* **Output Throughput** — generated tokens per second, the primary driver of streaming response speed
These metrics appear per model alongside the existing cache charts. ([Observability](/observability))
***
## June 22, 2026
**Observability Dashboard**
**Operations → Observability** is a new per-model LMCache metrics dashboard. Filter by model and time range, and track:
* **Cache Hit Rate** — fraction of tokens served from cache at \$0.00
* **Cache Token Flows** — CPU hit tokens, CPU read / write / evict, and L2 (External Storage) read / write / evict throughput in tokens
Export any view as CSV for further analysis. ([Observability](/observability))
**KV Cache Calculator**
A new KV Cache Calculator is available on **Operations → Storage**. Select a model, set your context length and data type, and see exactly how many gigabytes of KV cache that conversation will consume — broken down step-by-step. Use it to estimate your bucket needs before subscribing to an External Storage plan. ([External Storage](/external-storage#kv-cache-calculator))
**Tensormesh Agent**
An AI assistant is now built into the platform. Click the assistant button in the bottom-right corner of any page to open a chat panel powered by Tensormesh. It includes quick-start prompts and guides, follow-up suggestions after each response, and an expand mode for longer conversations.
**Billing Address Required**
A billing address is now required alongside a payment method before you can add credit on the platform. When adding a card, you'll be prompted to complete your billing address if one isn't on file. You can update it anytime from **Management → Billing → Payment Methods**. ([Billing & Usage](/billing-and-savings#managing-payment-methods))
***
## May 27, 2026
**New Serverless Models**
Ten models are now available for serverless inference:
| Model | Family | Parameters | Context |
| ---------------------------- | -------------- | ---------- | ------- |
| DeepSeek-V4-Flash | DeepSeek-V4 | 284B | 1M |
| gemma-4-31B-it | Google Gemma 4 | 30.7B | 256K |
| GLM-5.1-NVFP4-MTP | GLM-5.1 | 433B | 128K |
| MiniMax-M2.5 | MiniMaxAI | 228B | 196K |
| Kimi-K2.6 | Kimi | 1T | 256K |
| gpt-oss-120b | OpenAI gpt-oss | 116B | 131K |
| gpt-oss-20b | OpenAI gpt-oss | 20B | 131K |
| Qwen3.5-397B-A17B-FP8 | Qwen3.5 | 397B | 262K |
| Qwen3.6-27B-FP8 | Qwen3.6 | 27B | 262K |
| Qwen3-Coder-30B-A3B-Instruct | Qwen3 Coder | 30.5B | 262K |
See [Serverless Inference](/serverless-inference#available-models) for more details.
**External Storage**
External Storage gives your serverless models a persistent KV cache bucket — so context is remembered across requests and sessions. Subscribe to Bronze, Silver, or Gold plans from **Operations → Storage** to increase bucket capacity and drive a higher fraction of your tokens to \$0. ([External Storage](/external-storage))
**Reserved GPU Clusters**
On-demand GPU deployments have been removed from the platform. If you need dedicated GPU capacity for high-volume production workloads, contact us through **Deploy → Reserved** to request a reserved cluster. The Tensormesh team will work with you on a tailored capacity plan. ([Reserved Deployments](/reserved-deployments))
**Overview Page** — The Overview page has been updated with quick actions linking to Serverless, Demos, Claude Code, and Codex CLI. The stats shows Cache Hit Rate, Models Called, Monthly Spending, and Account Balance. A cached tokens chart visualizes your cache performance over time, and a serverless model catalog is shown at the bottom for quick access.
**Cache Savings** — **Management → Cache Savings** now shows estimated savings, a stacked area chart of input spend vs. cache savings over time, and a top-models-by-savings table.
**SDK & CLI** — The SDK and CLI have been updated to focus on serverless inference.
**New Docs Pages** — Dedicated documentation for [External Storage](/external-storage), [Serverless Usage](/serverless-usage), [Cache Savings](/cache-savings), and a [Glossary](/glossary) of key terms.
***
## April 29, 2026
**Account Deletion** — You can now delete your own account from **Management → Account**. Account deletion requires email confirmation and is permanent.
**Billing Transaction Details** — Transaction details on the Billing page now show a deeper breakdown.
***
## April 15, 2026
**Serverless Inference**
Run models via API with no infrastructure to manage. Pay-per-token pricing with \$0 for cached tokens. Track per-model token usage and costs under **Operations → Serverless Usage**. The API is OpenAI-compatible — point any existing SDK to `https://serverless.tensormesh.ai`. ([Serverless Inference](/serverless-inference))
**Tensormesh Demos**
A new **Demos** section with interactive benchmarks. Navigate to **Operations → Demos** to run live inference demos and observe KV cache acceleration across TTFT, E2E latency, and inter-token latency.
**CLI Documentation**
A new **CLI** tab in the docs with guides and a full command reference for the `tm` CLI tool — covering installation, authentication, inference, model management, billing, and admin workflows. ([CLI](/cli/index))
**Python SDK**
A new **Python SDK** tab with guides for the `tensormesh` package — covering sync and async clients, inference, control plane resources, and migration from OpenAI/Fireworks. ([Python SDK](/sdk/index))
**API & SDK Reference Documentation**
Full interactive API & SDK docs for all Tensormesh endpoints with an in-browser playground and code examples in cURL, Python, and JavaScript. ([API & SDK Reference](/api-reference/introduction))
**Email Notification Preferences** — Toggle email notifications for deployment updates from **Management → Account**.
**Support Ticket Attachments** — You can now attach files when creating support tickets.
**Quick Actions on Dashboard** — Quick action cards on the Overview page for faster navigation to common operations.
***
## March 17, 2026
**MiniMax-M2.5 on Serverless**
`MiniMaxAI/MiniMax-M2.5` is now available for serverless inference. Built on a 228B-parameter Mixture-of-Experts architecture with a 196K context window, it excels at advanced reasoning, coding, and building autonomous systems that combine tool orchestration with large-scale information processing.
**Cost Saving Breakdown** — Cache Savings page now displays a step-by-step savings breakdown with calculation formulas.
**Browser Notifications** — Notification preferences can now be configured from **Management → Account**.
# Claude Code on Tensormesh
Source: https://inference.docs.tensormesh.ai/claude-code
Drive open-weight models with stock Anthropic Claude Code CLI against Tensormesh — sign up, set three env vars, and run.
Get stock [Claude Code CLI](https://www.npmjs.com/package/@anthropic-ai/claude-code) driving open-weight models against Tensormesh in 5 minutes. No config file, no proxy — just three environment variables. Every model listed below supports the full Claude Code flow today (chat + tool use); `MiniMaxAI/MiniMax-M2.5` is the recommended default.
## Quick Links
Create your Tensormesh account with Google or GitHub.
Generate an `ak-...` key under **Profile → API keys**.
`npm install -g @anthropic-ai/claude-code` — verified against 2.1.145+.
Matrix of Claude-Code-ready models on Tensormesh serverless.
Email [saas-support@tensormesh.ai](mailto:saas-support@tensormesh.ai) for help.
## TL;DR
Three environment variables, no config file:
```bash theme={null}
# Step 1 — install Claude Code CLI (skip if already installed)
npm install -g @anthropic-ai/claude-code
# Step 2 — point Claude Code at Tensormesh (add to ~/.zshrc or ~/.bashrc to persist)
export ANTHROPIC_BASE_URL=https://serverless.tensormesh.ai
export ANTHROPIC_API_KEY=ak-...
# Run it — --bare tells Claude Code to authenticate strictly via
# ANTHROPIC_API_KEY (no OAuth/keychain fallback). Required for the
# interactive TUI when using a custom base URL.
claude --bare
```
That's the full setup — no `config.toml`, no PATH change, no proxy.
Running `claude --bare` every time gets old. Persist it as an alias so plain `claude` Just Works:
```bash theme={null}
echo "alias claude='claude --bare'" >> ~/.zshrc
source ~/.zshrc
```
For one-shot prompts (`claude -p "..."`), the `--bare` flag isn't strictly required — the Anthropic SDK uses `ANTHROPIC_API_KEY` in non-interactive mode. But keeping it consistent is cleaner.
## Prerequisites
* **Claude Code CLI** installed via `npm install -g @anthropic-ai/claude-code`. Verified against `2.1.145` (chat + tool use end-to-end); forward-compatible with later versions barring upstream Claude Code breaking changes.
* **A Tensormesh account** with an API key (`ak-...`). [Sign up](https://app.tensormesh.ai/login), then visit [Profile → API keys](https://app.tensormesh.ai/profile?tab=api).
* **macOS or Linux**, bash or zsh. Windows binaries ship in recent Claude Code releases but aren't currently tested by Tensormesh.
Tensormesh accepts Claude Code's native `x-api-key` header. You do **not** need to use `claude login` or the Anthropic OAuth flow — those are for Anthropic-hosted models. Setting `ANTHROPIC_API_KEY` is sufficient.
You do **not** need to run any local infrastructure. Tensormesh handles the full Anthropic Messages API server-side, so stock `claude` pointed at `serverless.tensormesh.ai` is the complete setup.
## Supported models
| Model | Claude Code status | Notes |
| ----------------------------------------- | ------------------ | ----------------------------------- |
| `MiniMaxAI/MiniMax-M2.5` | ✓ chat + tool use | Recommended default; 192K context |
| `MiniMaxAI/MiniMax-M2.7` | ✓ chat + tool use | Newer MiniMax release; 200K context |
| `openai/gpt-oss-120b` | ✓ chat + tool use | Reasoning + tools, 128K context |
| `openai/gpt-oss-20b` | ✓ chat + tool use | Reasoning + tools, 128K context |
| `Qwen/Qwen3-30B-A3B` | ✓ chat + tool use | Reasoning + tools, 40K context |
| `Qwen/Qwen3-Coder-30B-A3B-Instruct` | ✓ chat + tool use | Coding-tuned, 256K context |
| `Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8` | ✓ chat + tool use | Coding-tuned, 256K context |
| `moonshotai/Kimi-K2.6` | ✓ chat + tool use | Reasoning + tools, 32K context |
| `lukealonso/GLM-5.1-NVFP4-MTP` | ✓ chat + tool use | Reasoning + tools, 198K context |
| `deepseek-ai/DeepSeek-V4-Flash` | ✓ chat + tool use | Long-context, **1M tokens** |
`GET /v1/models` reflects what's currently available — Tensormesh hides any model that's temporarily cold. If you see fewer models than the table lists, retry after 30–60 seconds; the first request to a cold model warms it up.
For non-Claude-Code clients (Python SDK, curl, custom apps), every model in the table works fine via `/v1/messages` and `/v1/chat/completions` as well. The matrix above is calibrated specifically for stock Claude Code CLI.
## Switching models
Claude Code defaults to a Claude-family model if `--model` is omitted. To use a Tensormesh model, pass `--model` on the command line. Per-invocation overrides don't change any defaults — they only affect the current run.
### Per-invocation (no env edit)
```bash theme={null}
claude --model MiniMaxAI/MiniMax-M2.5 # MiniMax (recommended default)
claude --model MiniMaxAI/MiniMax-M2.7 # newer MiniMax, 200K
claude --model openai/gpt-oss-120b # reasoning, large
claude --model openai/gpt-oss-20b # reasoning, small
claude --model Qwen/Qwen3-30B-A3B # reasoning, 40K
claude --model Qwen/Qwen3-Coder-30B-A3B-Instruct # coder, 256K
claude --model Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8 # coder, 256K
claude --model moonshotai/Kimi-K2.6 # Kimi reasoning, 32K
claude --model lukealonso/GLM-5.1-NVFP4-MTP # GLM 5.1, 198K
claude --model deepseek-ai/DeepSeek-V4-Flash # DeepSeek, 1M context
```
### Set a default for every session
The cleanest way to pin a Tensormesh model as your everyday default is `ANTHROPIC_MODEL`, persisted alongside the other two env vars:
```bash theme={null}
# Add to ~/.zshrc or ~/.bashrc
export ANTHROPIC_BASE_URL=https://serverless.tensormesh.ai
export ANTHROPIC_API_KEY=ak-...
export ANTHROPIC_MODEL=MiniMaxAI/MiniMax-M2.5
```
After reloading your shell, `claude` (no `--model`) uses the model above. Per-invocation `--model` still overrides.
### Optional: shell aliases for frequent switching
If you switch models often, add aliases to your `~/.zshrc` (zsh) or `~/.bashrc` (bash):
```bash theme={null}
alias cc-mini='claude --model MiniMaxAI/MiniMax-M2.5'
alias cc-gpt='claude --model openai/gpt-oss-120b'
alias cc-qwen='claude --model Qwen/Qwen3-30B-A3B'
alias cc-coder='claude --model Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8'
alias cc-coder-small='claude --model Qwen/Qwen3-Coder-30B-A3B-Instruct'
alias cc-kimi='claude --model moonshotai/Kimi-K2.6'
alias cc-deepseek='claude --model deepseek-ai/DeepSeek-V4-Flash'
```
Reload your shell, then run `cc-coder` from any directory to start a Claude Code session against that model.
## Setup
The three steps from the TL;DR, with explanation.
```bash theme={null}
npm install -g @anthropic-ai/claude-code
```
This installs the `claude` command to your global `node_modules/bin`. Verify with `claude --version`.
Set two environment variables in your shell (add them to `~/.zshrc` or `~/.bashrc` to persist):
```bash theme={null}
export ANTHROPIC_BASE_URL=https://serverless.tensormesh.ai
export ANTHROPIC_API_KEY=ak-...
```
`ANTHROPIC_BASE_URL` redirects the Anthropic SDK away from `api.anthropic.com` to Tensormesh. `ANTHROPIC_API_KEY` is sent as the `x-api-key` header on every request (Anthropic-SDK convention).
Add both lines to `~/.zshrc` or `~/.bashrc`, then `source` the file or open a new terminal.
If you currently use Claude Code against Anthropic's hosted models, just override the two variables in the shell where you want Tensormesh:
```bash theme={null}
ANTHROPIC_BASE_URL=https://serverless.tensormesh.ai \
ANTHROPIC_API_KEY=ak-... \
claude
```
Or set them per-shell when working on a Tensormesh-targeted project, and unset for Claude work. The two providers are mutually exclusive within a single `claude` invocation.
Don't have a key yet? [Generate one in your profile](https://app.tensormesh.ai/profile?tab=api).
Without `ANTHROPIC_MODEL`, Claude Code defaults to a Claude-family model, which won't resolve on Tensormesh. Either pass `--model` on every invocation, or set the default once:
```bash theme={null}
export ANTHROPIC_MODEL=MiniMaxAI/MiniMax-M2.5
```
Persist alongside the other two env vars.
## Usage
```bash theme={null}
# Interactive TUI (works in any directory)
# --bare is required: it tells Claude Code to authenticate strictly
# via ANTHROPIC_API_KEY. Without it, the TUI tries OAuth/keychain
# first and shows "Not logged in" even when your env vars are set.
claude --bare
# One-shot prompt — --bare optional here; Anthropic SDK uses
# ANTHROPIC_API_KEY by default in non-interactive mode.
claude -p "Explain what foo.py does"
# Interactive TUI + bypass all permission prompts (sandbox use only —
# see Permission modes below)
claude --bare --dangerously-skip-permissions
```
The `--bare` requirement for the TUI is a property of Claude Code's auth precedence — when a custom `ANTHROPIC_BASE_URL` is set, Claude Code's interactive mode still tries OAuth/keychain first by default. `--bare` switches it to strict env-var auth. The alias in the [TL;DR](#tldr) tip is the simplest way to make this transparent for daily use.
### Slash commands in TUI
Inside an interactive `claude` session, type `/` to bring up the command picker (autocomplete). The set of commands varies slightly between Claude Code versions, so the picker is the source of truth. To exit a session cleanly, type `/exit` or press `Ctrl-D` twice.
### Permission and sandbox modes
By default, Claude Code asks for confirmation before each file write, shell command, and tool call. Three modes:
| Mode | When to use |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *(no flag)* | Default — prompts before each potentially-impactful action. Safest for unfamiliar prompts. |
| `--dangerously-skip-permissions` | Bypasses all permission checks (writes, shell, tool calls). Per Anthropic's guidance, **recommended only for sandboxes with no internet access** — i.e. an isolated container or VM where a misbehaving agent can't reach outside resources. |
| `--bare` | Strips hooks, plugins, auto-memory, keychain reads, and `CLAUDE.md` auto-discovery. Auth is restricted to `ANTHROPIC_API_KEY` (no OAuth or keychain fallback), which is the path Tensormesh uses — so `--bare` is the most predictable mode for scripts and CI. |
`--bare` is the recommended mode when calling Claude Code from automated pipelines — fewer side effects, more deterministic behavior, no surprise interactive prompts, and a single explicit auth path. Combine with `-p` for one-shot prompts.
### Recommended settings
* **`MiniMaxAI/MiniMax-M2.5` is the most reliable all-purpose default** for Claude Code on Tensormesh. It handles the full agentic loop (read → edit → run shell → iterate) and stays consistent across long multi-turn sessions (verified through 10+ turns of stateful workflow without drift).
* **For pure code generation or editing** (e.g. write a function, refactor a file, translate snippets), `Qwen/Qwen3-Coder-30B-A3B-Instruct` (256K) or `Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8` are coding-tuned alternatives. They're strong at code-generation work but can be more brittle than MiniMax on composite tool-orchestration prompts (e.g. "create file X, then run Y, then summarize") — if you hit unexpected output, retry with a simpler one-step prompt or fall back to MiniMax.
* **For very long contexts**, `deepseek-ai/DeepSeek-V4-Flash` (1M tokens) handles inputs that won't fit elsewhere.
* **Stay in the default (prompted) permission mode for code you don't fully trust.** Reach for `--dangerously-skip-permissions` only inside a sandboxed environment with no internet access, per Anthropic's own guidance.
## Troubleshooting
When a request fails, the meaningful error message is the most recent line printed by Claude Code. Match that line against the Symptom column below.
| Symptom (the actual error line) | Likely cause | Fix |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `command not found: claude` | Claude Code CLI not installed | `npm install -g @anthropic-ai/claude-code` |
| `Not logged in · Please run /login` *(in the interactive TUI, despite `ANTHROPIC_API_KEY` being set)* | Claude Code's interactive TUI tries OAuth/keychain before env-var auth. Without `--bare`, your env-var key is ignored. | Run `claude --bare` instead of plain `claude`. To make this the default, alias it: `echo "alias claude='claude --bare'" >> ~/.zshrc && source ~/.zshrc`. |
| `API Error: 500 Internal Server Error` *(after Claude Code's "try again" suggestion)* | Most often an **invalid or wrong-environment API key**. Authentication failures are surfaced as 5xx, which Claude Code wraps with its retry-suggestion text. | Verify your key matches your target environment (`ak-dev-...`, `ak-staging-...`, `ak-live-...`). Quickest probe: a real POST that exercises auth, e.g. `curl -sS -X POST -H "x-api-key: $ANTHROPIC_API_KEY" -H "Content-Type: application/json" -d '{"model":"MiniMaxAI/MiniMax-M2.5","max_tokens":5,"messages":[{"role":"user","content":"hi"}]}' https://serverless.tensormesh.ai/v1/messages` — HTTP 500 = bad key. |
| `There's an issue with the selected model (). It may not exist or you may not have access to it.` | Three things can produce this message: (1) typo in the model slug; (2) the model is currently cold and Tensormesh is hiding it from `/v1/models`; (3) `ANTHROPIC_BASE_URL` has a `/v1` suffix (the Anthropic SDK then double-appends `/v1`, hits an unknown path, surfaces it as a model error). | Check the [supported models](#supported-models) matrix against your spelling. Confirm `echo $ANTHROPIC_BASE_URL` returns `https://serverless.tensormesh.ai` **without** a `/v1` suffix (a trailing slash is fine). If the model is in the table and the URL is clean, wait 30–60 seconds and retry to warm the model. |
| `Maximum context length is N tokens` | Conversation grew past the model's context window | Start a fresh session (type `/` in the TUI to see the available clear/exit commands in your version), or switch to a larger-context model (e.g., `deepseek-ai/DeepSeek-V4-Flash` for 1M tokens). |
| Same "It may not exist or you may not have access to it" message but the slug looks like `claude-opus-4-7…` or `claude-sonnet-…` | `ANTHROPIC_MODEL` not set and `--model` not passed — Claude Code defaulted to its own Claude-family model, which Tensormesh doesn't serve. | Either set `ANTHROPIC_MODEL` (see [Setup](#setup)) or pass `--model ` on every invocation. |
| `claude` sits silent for many seconds after a prompt, no error | `ANTHROPIC_BASE_URL` points to an unreachable host | Confirm `echo $ANTHROPIC_BASE_URL` returns `https://serverless.tensormesh.ai`. If you set it to a private URL or typo'd, requests will block until the SDK's network timeout. |
Still stuck? Email [saas-support@tensormesh.ai](mailto:saas-support@tensormesh.ai) with the meaningful error line and the output of `claude --version`.
## Rollback / uninstall
To remove Tensormesh from your Claude Code setup:
1. Unset the three environment variables from your shell, and remove them from `~/.zshrc` / `~/.bashrc`:
```bash theme={null}
unset ANTHROPIC_BASE_URL ANTHROPIC_API_KEY ANTHROPIC_MODEL
```
2. Claude Code will resume targeting Anthropic's hosted API on its next invocation.
All actions reverse the setup steps above. No config files to clean up.
# Admin Workflows
Source: https://inference.docs.tensormesh.ai/cli/guides/admin-workflows
Common entry points for admin-only CLI operations.
The `tm admin` surface is for privileged Control Plane operations. Typical areas include users, billing, and product administration.
## Common Starting Points
Inspect the available admin groups first:
```sh theme={null}
tm admin --help
tm admin users --help
tm admin billing --help
tm admin products --help
```
## Example Admin Commands
List users:
```sh theme={null}
tm admin users list
```
Inspect product state:
```sh theme={null}
tm admin products list
```
Inspect admin billing operations:
```sh theme={null}
tm admin billing balances --help
tm admin billing pricing --help
```
## Related Reference
* [`tm admin`](/cli/reference/admin)
* [`tm admin users`](/cli/reference/admin/users)
* [`tm admin users list`](/cli/reference/admin/users/list)
* [`tm admin billing`](/cli/reference/admin/billing)
* [`tm admin products`](/cli/reference/admin/products)
# Authentication
Source: https://inference.docs.tensormesh.ai/cli/guides/authentication
Sign in to the Tensormesh Control Plane and manage local auth state.
Use Control Plane authentication for commands such as `tm auth whoami`, `tm models list`, `tm users get`, and other management workflows.
Use `tm auth status` when you need to see the local Control Plane token state
and the current inference credential state.
If `tm` is not already on your `PATH`, install the CLI first with
[Installation](/cli/guides/installation). The commands below assume `tm` is on
your `PATH`. If you are running from this repo checkout without activating a
shell that already exposes `tm`, use `./.venv/bin/tm`.
`tm auth status` reports local credential presence. Use `tm auth whoami` to confirm that the current Control Plane token still works against the live API.
## Login Flow
```sh theme={null}
tm auth login
tm auth status
tm auth whoami
```
Use that sequence in two phases:
* `tm auth status` is the local readiness check after login.
* `tm auth whoami` is the live validation step that proves the current bearer token still works against the Control Plane.
For shell scripts or CI checks, use:
```sh theme={null}
tm auth status --exit-status
```
If you are running in an environment where a browser should not be opened automatically:
```sh theme={null}
tm auth login --no-open-browser
```
The login flow fails closed after 300 seconds by default. For remote shells or automation, lower or raise that ceiling explicitly:
```sh theme={null}
tm auth login --no-open-browser --max-wait-seconds 60
```
When `TM_CONFIG_HOME` is unset, the CLI stores Control Plane tokens at
`~/.config/tensormesh/auth.json`. When `TM_CONFIG_HOME` is set, the token file
moves to `$TM_CONFIG_HOME/auth.json`.
## Automation And Headless Use
Use `tm auth whoami` when you need a live token check. It calls `GET /auth/profile`, so it validates the current bearer token against the Control Plane instead of only checking the local token file.
For controlled scripts that need the raw bearer token, use:
```sh theme={null}
tm auth print-token --yes-i-know
```
A shell-safe pattern is:
```sh theme={null}
tm --output json auth whoami
```
If you need the raw bearer token for a separate HTTP client, use `tm auth print-token --yes-i-know` only in a controlled shell.
Treat that token like a secret: avoid shell history, CI logs, and copied plaintext files.
## Refresh And Logout
Use refresh when you already have a saved login and want to update the local token set:
```sh theme={null}
tm auth refresh
```
Use logout to remove the local token file:
```sh theme={null}
tm auth logout
```
Interactive shells prompt for confirmation. Use `tm auth logout --yes` when you
want explicit non-interactive cleanup.
## CLI Login Endpoint Scope
`tm auth login` and `tm auth refresh` use the CLI browser-login flow rather than the stable raw API integration surface for external clients.
## Related Reference
* [`tm auth`](/cli/reference/auth)
* [`tm auth login`](/cli/reference/auth/login)
* [`tm auth print-token`](/cli/reference/auth/print-token)
* [`tm auth status`](/cli/reference/auth/status)
* [`tm auth whoami`](/cli/reference/auth/whoami)
* [`tm auth refresh`](/cli/reference/auth/refresh)
* [`tm auth logout`](/cli/reference/auth/logout)
# Config And Environment
Source: https://inference.docs.tensormesh.ai/cli/guides/config-and-env
Control how the Tensormesh CLI resolves config, env vars, and local overrides.
The CLI resolves settings in this order:
1. CLI flags
2. Environment variables
3. `~/.config/tensormesh/config.toml`
4. Built-in defaults
For the Control Plane host specifically, use `--controlplane-base`,
`TENSORMESH_CONTROL_PLANE_BASE_URL`, or top-level `controlplane_base` in
`config.toml`.
If you need an alternate local state root for scripting or side-by-side environments, set `TM_CONFIG_HOME`. That moves both `config.toml` and `auth.json` together under the directory you choose.
Within `config.toml`, inference credentials live under `[overrides]`.
Use `tm config show --sources` when you need to confirm which layer actually won for each value.
## Create A Starter Config
```sh theme={null}
tm config init
tm config show
tm config show --sources
```
To write the starter template to a custom location:
```sh theme={null}
tm config init --path ./tensormesh.toml
tm --config ./tensormesh.toml config show
```
## Canonical Config File
The standard persistent CLI setup lives in:
`~/.config/tensormesh/config.toml`
Or, when `TM_CONFIG_HOME` is set:
* config: `$TM_CONFIG_HOME/config.toml`
* auth: `$TM_CONFIG_HOME/auth.json`
The standard flow is:
```sh theme={null}
tm config init
tm auth login
```
`tm config init` creates the file with user-owned request settings plus an
`[overrides]` section for the optional inference API key.
## Config File Schema
The starter template is the real schema the CLI understands today:
```toml theme={null}
# controlplane_base = "https://api.tensormesh.ai"
timeout_seconds = 30
max_retries = 0
# ca_bundle = "~/.config/tensormesh/ca-bundle.pem"
[overrides]
# gateway_api_key = "..."
```
Top-level keys:
* `controlplane_base`: optional Control Plane base URL override for auth and other Control Plane commands
* `timeout_seconds`: default HTTP timeout for commands that use the shared request client
* `max_retries`: default retry count for idempotent requests
* `ca_bundle`: optional PEM CA bundle path for TLS verification
`[overrides]` keys:
* `gateway_api_key`: stored serverless inference API key. The name stays `gateway_api_key` for config compatibility. The SDK reads the same value as `inference_api_key`.
## Single-File Design
The CLI uses a single canonical config file. If you want to change behavior manually, edit `[overrides]` in `~/.config/tensormesh/config.toml` instead of switching between named profiles or maintaining a separate runtime file.
If you want that same single-file design in a different local root, set `TM_CONFIG_HOME` instead of introducing another profile layer.
Example:
```toml theme={null}
controlplane_base = "https://api.tensormesh.ai"
timeout_seconds = 20
max_retries = 1
[overrides]
gateway_api_key = "..."
```
Inspect the resolved config and sources:
```sh theme={null}
tm --config ./tensormesh.toml config show --sources
```
`tm doctor`, `tm infer doctor`, and `tm auth status` report local config and credential presence. Use `tm auth whoami` when you need a live Control Plane auth check.
## Interpreting `config show --sources`
Use `--sources` when debugging precedence:
```sh theme={null}
tm --output json config show --sources
```
The result contains:
* `values`: resolved config after redacting secrets such as `gateway_api_key`
* `sources`: where each value came from, such as `config:timeout_seconds` or `config:gateway_api_key`
Typical source strings:
* `built-in:config_path`: CLI default
* `TENSORMESH_CONTROL_PLANE_BASE_URL`: environment override for the Control Plane base URL
* `config:controlplane_base`: explicit top-level Control Plane host from `config.toml`
* `config:gateway_api_key`: explicit user override from `[overrides]` in `config.toml`
`tm config show` and `tm config show --sources` redact secrets such as
`gateway_api_key` in both text and JSON output. That is intentional.
## Environment Variables
| Variable | Overrides flag | Description |
| ----------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------ |
| `TENSORMESH_CONTROL_PLANE_BASE_URL` | `--controlplane-base` | Override the Control Plane base URL for CLI auth and Control Plane requests. |
| `TENSORMESH_CA_BUNDLE` | `--ca-bundle` | Path to a PEM CA bundle for TLS verification. |
| `TENSORMESH_TIMEOUT_SECONDS` | `--timeout` | Default HTTP timeout in seconds. |
| `TENSORMESH_MAX_RETRIES` | `--max-retries` | Max retries for idempotent requests on transient errors. |
| `TM_CONFIG_HOME` | — | Override the config and auth root directory. Moves both `config.toml` and `auth.json` to `$TM_CONFIG_HOME/`. |
`gateway_api_key` does not have an environment variable equivalent in the CLI. Set it in `[overrides]` in `config.toml`.
If you need an environment-variable-only credential workflow without a config file, use the [Tensormesh SDK](/sdk/guides/auth-and-config) instead, which supports `TENSORMESH_INFERENCE_API_KEY` and related credential variables.
## Related Reference
* [`tm`](/cli/reference)
* [`tm config`](/cli/reference/config)
* [`tm config init`](/cli/reference/config/init)
* [`tm config show`](/cli/reference/config/show)
* [`tm auth status`](/cli/reference/auth/status)
* [`tm doctor`](/cli/reference/doctor)
# Control Plane Workflows
Source: https://inference.docs.tensormesh.ai/cli/guides/control-plane-workflows
Common non-admin Control Plane tasks for API keys, billing, tickets, and metrics.
Use this page after you are already authenticated with:
```sh theme={null}
tm auth whoami
```
## API Keys
Create a user API key for automation:
```sh theme={null}
USER_ID="$(tm --output json auth whoami | python3 -c 'import json,sys; print(json.load(sys.stdin)["user"]["id"])')"
tm users api-keys create --user-id "$USER_ID" --name ci-key --yes
```
List existing keys:
```sh theme={null}
tm --output json users api-keys list
```
Delete a key explicitly:
```sh theme={null}
tm users api-keys delete --api-key YOUR_KEY --yes
```
## Billing Reads
Check current balance:
```sh theme={null}
tm --output json billing balance
```
Read transaction history with explicit pagination:
```sh theme={null}
tm --output json billing transactions list --page-size 25 --page-token "$NEXT_PAGE_TOKEN"
```
Read spending summary:
```sh theme={null}
tm --output json billing spending summary
```
## Support Tickets
Create a ticket:
```sh theme={null}
tm --output json tickets create --subject "Need help" --message "Please investigate."
```
Append a follow-up:
```sh theme={null}
tm --output json tickets message TICKET_ID --message "Following up"
```
List open tickets:
```sh theme={null}
tm --output json tickets list --status TICKET_STATUS_OPEN --page 1 --size 20
```
## User-Level Metrics
Fetch user-level metrics:
```sh theme={null}
tm --output json metrics user --step-seconds 60
```
## When To Prefer JSON
For anything that feeds another program, prefer `--output json` and pass pagination or filter values explicitly.
Use table or text output only for interactive inspection.
## Related Reference
* [`tm users api-keys`](/cli/reference/users/api-keys)
* [`tm billing`](/cli/reference/billing)
* [`tm tickets`](/cli/reference/tickets)
* [`tm metrics`](/cli/reference/metrics)
# First Inference Request
Source: https://inference.docs.tensormesh.ai/cli/guides/first-request
Send a first chat request through the Tensormesh Serverless inference flow.
This page covers the standard first-request flow against the serverless inference surface.
If `tm` is not already on your `PATH`, install the CLI first with
[Installation](/cli/guides/installation). The commands below assume `tm` is on
your `PATH`. If you are running from this repo checkout without activating a
shell that already exposes `tm`, use `./.venv/bin/tm`.
The shortest serverless request:
```sh theme={null}
tm infer chat \
--api-key YOUR_INFERENCE_API_KEY \
--model YOUR_SERVERLESS_MODEL_NAME \
--json '[{"role":"user","content":"Say hello."}]'
```
If you do not already know a valid serverless model name, use [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list) before using that shortcut.
Use `tm infer doctor` when you want to check whether the local config and credentials are wired up correctly before sending the request.
## Get An API Key
If your environment exposes self-serve key creation, use the authenticated Control Plane flow:
```sh theme={null}
tm auth login
USER_ID="$(tm --output json auth whoami | python3 -c 'import json,sys; print(json.load(sys.stdin)["user"]["id"])')"
tm users api-keys create --user-id "$USER_ID" --name cli-key --yes
```
Otherwise, ask your operator or admin for the exact inference API key to use.
## Send A Chat Request
```sh theme={null}
tm infer chat \
--api-key YOUR_INFERENCE_API_KEY \
--model YOUR_SERVERLESS_MODEL_NAME \
--json '[{"role":"user","content":"Say hello."}]'
```
For streaming output:
```sh theme={null}
echo '[{"role":"user","content":"Stream tokens."}]' \
| tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --stream
```
Streaming requests use a bounded idle read timeout. If you expect long quiet gaps between SSE events, raise it explicitly:
```sh theme={null}
echo '[{"role":"user","content":"Stream tokens."}]' \
| tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --stream --stream-idle-timeout 600
```
## Related Reference
* [`tm infer`](/cli/reference/infer)
* [`tm infer doctor`](/cli/reference/infer/doctor)
* [`tm infer chat`](/cli/reference/infer/chat)
* [`tm init`](/cli/reference/init)
* [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list)
* [API Quickstart](/api-quickstart) for raw HTTP equivalents of these flows
# Getting Started
Source: https://inference.docs.tensormesh.ai/cli/guides/getting-started
Reach a first successful Tensormesh CLI request against the serverless inference surface.
This page covers the shortest serverless-first path to a working request.
If `tm` is not already on your `PATH`, install the CLI first with
[Installation](/cli/guides/installation). The commands below assume `tm` is on
your `PATH`. If you are running from this repo checkout without activating a
shell that already exposes `tm`, use `./.venv/bin/tm`.
## Fastest Serverless Request
Choose this when you already have both:
* an inference API key
* a valid serverless model name for your target host
You do not need Control Plane login for this path:
```sh theme={null}
tm version
tm infer chat \
--api-key YOUR_INFERENCE_API_KEY \
--model YOUR_SERVERLESS_MODEL_NAME \
--json '[{"role":"user","content":"Say hello."}]'
```
If you do not already know the model name to use, start with [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list). That discovery command requires `tm auth login` for the same Tensormesh environment.
## Standard CLI Setup
When you want a guided local setup before sending requests:
```sh theme={null}
tm version
tm auth login
tm config init
tm auth status
tm config show --sources
tm infer doctor
tm auth whoami
```
Put your inference API key under `[overrides]` in `~/.config/tensormesh/config.toml` (or `$TM_CONFIG_HOME/config.toml` when that env var is set):
```toml theme={null}
[overrides]
gateway_api_key = "..."
```
When you are targeting a different Control Plane host, run the same explicit
`--controlplane-base` once so the active `config.toml` persists that host for
later Control Plane-assisted flows.
For automation or CI, add `--exit-status` to readiness checks so they fail the shell when required prerequisites are still missing:
```sh theme={null}
tm infer doctor --exit-status
tm auth status --exit-status
```
## Understand The Readiness Commands
Use the readiness commands like this:
* `tm auth status`: local Control Plane and inference credential presence
* `tm infer doctor`: local readiness for the next inference request
* `tm doctor`: broader local config and credential diagnosis across CLI setup
* `tm auth whoami`: live Control Plane auth check
`tm auth status`, `tm infer doctor`, and `tm doctor` are local checks. They do not prove that a live API call will succeed.
After the local checks look good, use `tm auth whoami` as the explicit live validation step for your current Control Plane login.
## What `tm init` Helps You Check
* whether the current config file exists
* whether Control Plane login is ready
* whether inference API key is present
* the exact next commands to finish setup
## Related Reference
* [`tm version`](/cli/reference/version)
* [`tm init`](/cli/reference/init)
* [`tm infer doctor`](/cli/reference/infer/doctor)
* [`tm auth status`](/cli/reference/auth/status)
* [`tm auth whoami`](/cli/reference/auth/whoami)
* [`tm config show`](/cli/reference/config/show)
* [`tm infer chat`](/cli/reference/infer/chat)
* [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list)
# Installation
Source: https://inference.docs.tensormesh.ai/cli/guides/installation
Install the Tensormesh Python package, then verify the bundled `tm` CLI with `tm version`.
The `tm` CLI ships in the same Python distribution as the SDK. Depending on how a release is published, install either from PyPI or from the GitHub release artifacts.
Prerequisite: Python `3.12` or newer.
## Install From PyPI
If your release is published to PyPI, this is the shortest install path:
Create an isolated environment, install the package, then verify the CLI:
```sh theme={null}
python3 -m venv .venv
./.venv/bin/pip install tensormesh
./.venv/bin/tm version
```
If you upgrade later, upgrade the same environment in place:
```sh theme={null}
./.venv/bin/pip install --upgrade tensormesh
./.venv/bin/tm version
```
## Install From A Release Artifact
If PyPI is not enabled for your release, or you are working from a release artifact directly, install either the wheel or source distribution:
```sh theme={null}
python3 -m venv .venv
./.venv/bin/pip install /path/to/tensormesh-VERSION-py3-none-any.whl
./.venv/bin/tm version
```
Or:
```sh theme={null}
python3 -m venv .venv
./.venv/bin/pip install /path/to/tensormesh-VERSION.tar.gz
./.venv/bin/tm version
```
## Install For Local Development
If you are working in this repo as a contributor, use the bootstrap flow instead of a release artifact:
```sh theme={null}
npm run bootstrap
./.venv/bin/tm version
```
## Verify The Installed CLI
Use the explicit version command rather than relying only on the root `--version` flag. If you did not activate the virtual environment, keep using the explicit binary path:
```sh theme={null}
./.venv/bin/tm version
./.venv/bin/tm --output json version
```
The JSON form is useful in automation when you want to assert the installed CLI version before running workflow scripts.
## Current Packaging Notes
* GitHub releases publish one verified `dist/python` artifact set containing the wheel, source distribution, `SHA256SUMS`, and `RELEASE-MANIFEST.json`.
* `RELEASE-MANIFEST.json` records version, Python requirement, changelog/policy references, and install metadata for the published release artifacts.
* Release CI smoke-tests both the wheel and the source distribution before publishing.
* PyPI publishing is optional per release; GitHub release artifacts are the guaranteed install surface from this repo.
## Related Reference
* [`tm version`](/cli/reference/version)
* [`tm init`](/cli/reference/init)
* [`tm config show`](/cli/reference/config/show)
# Production Scripting
Source: https://inference.docs.tensormesh.ai/cli/guides/production-scripting
Use the Tensormesh CLI safely from CI, shell scripts, and operational automation.
This guide documents the CLI's actual scripting behavior today.
## Output Modes
Use machine-readable output whenever another program will parse the result:
```sh theme={null}
tm --output json version
tm --output json models list
tm --output json infer doctor
```
Available root output modes are:
* `text`: human-readable default
* `json`: structured scripting output
* `yaml`: structured scripting output
* `raw`: unmodified body/text when available, otherwise a compact one-line serialization of local command data
* `table`: human-readable tabular output
For automation, prefer `--output json`. `--output raw` is most useful when you explicitly want passthrough text from an upstream response.
Current caveat: `tm infer chat --stream`, `tm infer completions --stream`, and `tm infer responses --stream` only support `--output text`. For streaming automation, use the SDK or consume the upstream SSE endpoint directly.
## Readiness Checks And Exit Codes
For automation, use the readiness commands with `--exit-status`:
```sh theme={null}
tm auth status --exit-status
tm doctor --exit-status
tm infer doctor --exit-status
```
Use the surface-specific commands when you need strict gating for one workflow:
* `tm auth status --exit-status` for the local Control Plane token plus gateway credential prerequisites
* `tm infer doctor --exit-status` for direct gateway inference prerequisites
* `tm doctor --exit-status` for a stricter combined readiness check
Without `--exit-status`, those commands still print useful diagnostics, but they are not strict shell gates.
## Timeouts
Global request timeout:
```sh theme={null}
tm --timeout 20 models list
```
Environment default:
```sh theme={null}
export TENSORMESH_TIMEOUT_SECONDS=20
```
Streaming inference uses:
* `--timeout` for the connect timeout
* `--stream-idle-timeout` for idle SSE reads
Example:
```sh theme={null}
tm infer responses --model MiniMaxAI/MiniMax-M2.5 \
--stream --stream-idle-timeout 60 \
--json '{"input":"hi"}'
```
## Retries And Rate Limits
Global retry setting:
```sh theme={null}
tm --max-retries 2 models list
```
Environment default:
```sh theme={null}
export TENSORMESH_MAX_RETRIES=2
```
Current CLI behavior:
* only idempotent methods are retried automatically: `GET`, `HEAD`, `OPTIONS`, `PUT`, `DELETE`
* automatic retries happen for network failures and HTTP `429`, `500`, `502`, `503`, `504`
* when a retryable HTTP response includes `Retry-After`, the CLI waits for that server-provided delay before retrying, capped at `8s`
* otherwise backoff is exponential: `0.5s`, `1s`, `2s`, `4s`, `8s` max
* non-idempotent `POST` requests are not retried automatically
`tm infer chat` uses POST. Setting `--max-retries` has no effect on inference requests. `--max-retries` applies to management commands such as `tm models list` and `tm activities list`.
`Retry-After` may be either delta-seconds or an HTTP date; both are honored when present, up to the same `8s` maximum delay.
Operational advice:
* if the service is rate-limiting you, reduce concurrency before raising `--max-retries`
* remember that retries still stop at an `8s` maximum delay per attempt, even if the server asks for longer
## Pagination Patterns
Control Plane commands use the pagination shape exposed by each endpoint family.
Page/size style examples:
```sh theme={null}
tm --output json activities list --page 2 --size 50
tm --output json tickets list --status TICKET_STATUS_OPEN --page 1 --size 20
```
Page-token style example:
```sh theme={null}
tm --output json billing transactions list --page-size 25 --page-token "$NEXT_PAGE_TOKEN"
```
When you are scripting, prefer `--output json` and pass the next token or page values explicitly rather than scraping table output.
## Error Surface
The CLI distinguishes a few failure classes:
* usage/config errors: missing required args, invalid UUIDs, invalid timeout values
* HTTP errors: include `HTTP ` and may include `request_id`
* network errors: surfaced as connection or timeout failures
Example shell pattern:
```sh theme={null}
tm_auth_json="$(
mktemp -t tm-auth.XXXXXX 2>/dev/null || \
mktemp "${TMPDIR:-/tmp}/tm-auth.XXXXXX"
)"
trap 'rm -f "$tm_auth_json"' EXIT
if ! tm --output json auth status --exit-status >"$tm_auth_json" 2>&1; then
cat "$tm_auth_json"
exit 1
fi
```
## Idempotency And Mutations
Mutation commands such as `create`, `deploy`, `upsert`, `message`, and `add` do not get automatic retries.
That is intentional: if you need retry logic around non-idempotent operations, add it in your wrapper with explicit safeguards around duplicate effects.
## What To Avoid
* do not parse `text` or `table` output in CI
* do not treat `tm auth status`, `tm doctor`, or `tm infer doctor` as strict health checks unless you add `--exit-status`
* do not assume `POST` mutations are retried for you
* do not set `--max-retries` so high that repeated retryable failures still create unacceptable CI wait time
## Headless And CI Authentication
For CI or remote environments where a browser cannot be opened:
```sh theme={null}
tm auth login --no-open-browser --max-wait-seconds 60
```
The default wait ceiling is 300 seconds. Lower it for CI jobs with tight timeouts. See the [Authentication Guide](/cli/guides/authentication) for the full token and refresh workflow.
## Related Reference
* [`tm`](/cli/reference)
* [`tm doctor`](/cli/reference/doctor)
* [`tm auth status`](/cli/reference/auth/status)
* [`tm auth login`](/cli/reference/auth/login)
* [`tm infer doctor`](/cli/reference/infer/doctor)
* [`tm infer chat`](/cli/reference/infer/chat)
* [`tm activities list`](/cli/reference/activities/list)
* [`tm billing transactions list`](/cli/reference/billing/transactions/list)
# Troubleshooting
Source: https://inference.docs.tensormesh.ai/cli/guides/troubleshooting
Diagnose the most common CLI setup, auth, and gateway issues.
## Missing Control Plane Login
If a Control Plane command says you are not authenticated:
```sh theme={null}
tm auth login
tm auth whoami
tm doctor
```
For automation, use `tm auth status --exit-status` when you need a shell-friendly local readiness check for both the Control Plane token and the current gateway credentials. `tm auth status` only reports local credential presence; `tm auth whoami` is the live validation step.
If `tm auth login` appears to wait forever in a remote shell, rerun it with an explicit ceiling such as `tm auth login --no-open-browser --max-wait-seconds 60`.
## Missing Inference Credentials
If `tm infer chat` reports a missing API key or model name, set `gateway_api_key`
under `[overrides]` in your `config.toml`, or pass `--api-key` and `--model` on
the command line:
```sh theme={null}
tm infer doctor --exit-status
tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --json '[{"role":"user","content":"hi"}]'
```
Control Plane auth (`tm auth login`) is separate from the inference API key and
does not substitute for one when calling serverless inference.
If a streaming request stalls because the upstream stops sending events, rerun with a smaller or larger idle timeout:
```sh theme={null}
tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --stream --stream-idle-timeout 60 --json '[{"role":"user","content":"hi"}]'
```
## Config Resolution Confusion
If the CLI is picking up the wrong config or env values:
```sh theme={null}
tm config show
tm config show --sources
tm doctor --exit-status
```
Use `tm infer doctor --exit-status` when you specifically want to gate a direct inference path. Use `tm auth status --exit-status` when you specifically want to gate the broader local auth-and-gateway prerequisites.
## TLS Or Connectivity Problems
If your environment needs a custom CA bundle:
```sh theme={null}
export TENSORMESH_CA_BUNDLE="/path/to/ca-bundle.pem"
tm doctor
```
## Related Reference
* [`tm doctor`](/cli/reference/doctor)
* [`tm auth login`](/cli/reference/auth/login)
* [`tm auth whoami`](/cli/reference/auth/whoami)
* [`tm config show`](/cli/reference/config/show)
* [`tm infer chat`](/cli/reference/infer/chat)
# Tensormesh CLI
Source: https://inference.docs.tensormesh.ai/cli/index
Guides and command reference for the `tm` CLI.
The Tensormesh CLI, `tm`, covers two surfaces:
* **Control Plane** workflows such as authentication, models, users, billing, support, logs, and metrics.
* **Inference API** workflows for OpenAI-compatible Serverless endpoints.
Use the guides below for end-to-end tasks. Use the generated reference pages when you need exact flags, arguments, and related commands.
The authentication guide covers both browser login and automation-safe token usage.
Install the CLI first with [Installation](/cli/guides/installation) if `tm` is
not already on your `PATH`. The examples below assume `tm` is available on your
`PATH`. If you are working from this repo checkout without activating a shell
that already exposes `tm`, use `./.venv/bin/tm`.
## Choose A Starting Path
Use the serverless path when you already know the model name you want:
```sh theme={null}
tm version
tm infer chat \
--api-key YOUR_INFERENCE_API_KEY \
--model YOUR_SERVERLESS_MODEL_NAME \
--json '[{"role":"user","content":"Say hello."}]'
```
If you have Control Plane access for the same Tensormesh environment and need to discover a serverless model name first, run `tm auth login`, then [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list), and copy the returned `pricing[].model` value.
For the other verified serverless endpoints, use the same `--api-key` and `--model` flow:
```sh theme={null}
tm infer models --api-key YOUR_INFERENCE_API_KEY
tm infer responses --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --json '{"input":"Say hello."}'
```
## Guides
* [Installation](/cli/guides/installation)
* [Getting Started](/cli/guides/getting-started)
* [Authentication](/cli/guides/authentication)
* [First Inference Request](/cli/guides/first-request)
* [Control Plane Workflows](/cli/guides/control-plane-workflows)
* [Config And Environment](/cli/guides/config-and-env)
* [Production Scripting](/cli/guides/production-scripting)
* [Admin Workflows](/cli/guides/admin-workflows)
* [Troubleshooting](/cli/guides/troubleshooting)
## Reference
* [Root Command](/cli/reference)
* [Version Command](/cli/reference/version)
* [Init Command](/cli/reference/init)
* [Auth Login](/cli/reference/auth/login)
* [Auth Status](/cli/reference/auth/status)
* [Auth Whoami](/cli/reference/auth/whoami)
* [Config Show](/cli/reference/config/show)
* [Infer Doctor](/cli/reference/infer/doctor)
* [Infer Chat](/cli/reference/infer/chat)
* [Infer Models](/cli/reference/infer/models)
* [Infer Responses](/cli/reference/infer/responses)
* [Serverless Pricing List](/cli/reference/billing/pricing/serverless/list)
* [Auth Commands](/cli/reference/auth)
* [Config Commands](/cli/reference/config)
* [Inference Commands](/cli/reference/infer)
* [Billing Commands](/cli/reference/billing)
* [Activities Commands](/cli/reference/activities)
* [Cost Command](/cli/reference/cost)
* [Metrics Commands](/cli/reference/metrics)
* [Users Commands](/cli/reference/users)
* [Products Commands](/cli/reference/products)
* [Tickets Commands](/cli/reference/tickets)
* [Reserved Deployments Commands](/cli/reference/reserved-deployments)
* [Admin Commands](/cli/reference/admin)
* [Doctor](/cli/reference/doctor)
# tm activities
Source: https://inference.docs.tensormesh.ai/cli/reference/activities/index
Activities (Control Plane).
## Usage
```sh theme={null}
tm activities [OPTIONS] COMMAND [ARGS]...
```
## Examples
### List recent activities for a user in the Control Plane.
```sh theme={null}
tm activities list --user-id USER_ID
```
## Subcommands
* [`tm activities get`](/cli/reference/activities/get): Get an activity (GET /v1/activities/\{activityId}).
* [`tm activities list`](/cli/reference/activities/list): List activities (GET /v1/activities).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm admin billing
Source: https://inference.docs.tensormesh.ai/cli/reference/admin/billing/index
Admin billing tools.
## Usage
```sh theme={null}
tm admin billing [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Inspect admin serverless pricing records.
```sh theme={null}
tm admin billing pricing serverless list
```
## Subcommands
* [`tm admin billing balances`](/cli/reference/admin/billing/balances): Admin user balances.
* [`tm admin billing pricing`](/cli/reference/admin/billing/pricing): Admin GPU pricing.
* [`tm admin billing spending`](/cli/reference/admin/billing/spending): Admin spending tools.
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm admin`](/cli/reference/admin)
# tm admin
Source: https://inference.docs.tensormesh.ai/cli/reference/admin/index
Admin-only commands (Control Plane).
## Usage
```sh theme={null}
tm admin [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Inspect the admin-only user management surface.
```sh theme={null}
tm admin users list
```
## Subcommands
* [`tm admin billing`](/cli/reference/admin/billing): Admin billing tools.
* [`tm admin products`](/cli/reference/admin/products): Admin product tools.
* [`tm admin users`](/cli/reference/admin/users): Admin user tools.
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm admin products
Source: https://inference.docs.tensormesh.ai/cli/reference/admin/products/index
Admin product tools.
## Usage
```sh theme={null}
tm admin products [OPTIONS] COMMAND [ARGS]...
```
## Subcommands
* [`tm admin products delete`](/cli/reference/admin/products/delete): Delete a product (DELETE /v1/products/\{id}).
* [`tm admin products list`](/cli/reference/admin/products/list): List products (GET /v1/admin/products).
* [`tm admin products upsert`](/cli/reference/admin/products/upsert): Upsert a product (POST /v1/admin/products).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm admin`](/cli/reference/admin)
# tm admin users
Source: https://inference.docs.tensormesh.ai/cli/reference/admin/users/index
Admin user tools.
## Usage
```sh theme={null}
tm admin users [OPTIONS] COMMAND [ARGS]...
```
## Subcommands
* [`tm admin users change-role`](/cli/reference/admin/users/change-role): Change a user's role (POST /v1/admin/users/change\_role).
* [`tm admin users list`](/cli/reference/admin/users/list): List users (GET /v1/admin/users).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm admin`](/cli/reference/admin)
# tm auth
Source: https://inference.docs.tensormesh.ai/cli/reference/auth/index
Authenticate to the Tensormesh Control Plane.
## Usage
```sh theme={null}
tm auth [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Start the Control Plane login flow.
```sh theme={null}
tm auth login
```
### Inspect the local Control Plane and Gateway auth state.
```sh theme={null}
tm auth status
```
### Confirm the current authenticated Control Plane identity.
```sh theme={null}
tm auth whoami
```
## Subcommands
* [`tm auth login`](/cli/reference/auth/login): Login via browser and store Control Plane tokens.
* [`tm auth logout`](/cli/reference/auth/logout): Delete the local Control Plane token file.
* [`tm auth print-token`](/cli/reference/auth/print-token): Print the Control Plane access token to stdout (for scripting).
* [`tm auth refresh`](/cli/reference/auth/refresh): Refresh stored Control Plane tokens.
* [`tm auth status`](/cli/reference/auth/status): Show local Control Plane and Gateway auth status.
* [`tm auth whoami`](/cli/reference/auth/whoami): Show the authenticated Control Plane user profile.
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm auth login
Source: https://inference.docs.tensormesh.ai/cli/reference/auth/login
Login via browser and store Control Plane tokens.
## Usage
```sh theme={null}
tm auth login [OPTIONS]
```
## Examples
### Start the browser login flow and store Control Plane tokens locally.
```sh theme={null}
tm auth login
```
### Print the login URL instead of opening a browser automatically.
```sh theme={null}
tm auth login --no-open-browser
```
### Fail the login flow if the browser exchange is still pending after 60 seconds.
```sh theme={null}
tm auth login --no-open-browser --max-wait-seconds 60
```
## Options
| Name | Type | Required | Default | Details |
| -------------------- | --------- | -------- | ------- | ------------------------------------------------------------------------- |
| `--no-open-browser` | `boolean` | no | `false` | Do not open the browser automatically (prints URL instead). Boolean flag. |
| `--max-wait-seconds` | `float` | no | `300.0` | Maximum total wait time for the browser login flow before failing. |
| `--timeout` | `float` | no | | HTTP timeout in seconds for the login flow. |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Auth Scope
* controlplane-browser-login
## Prerequisites
* Access to a browser that can complete the Tensormesh login flow.
## Caveats
* Tokens are stored locally after login completes.
* The login flow fails closed after 300 seconds unless `--max-wait-seconds` overrides it.
## Related Commands
* [`tm auth whoami`](/cli/reference/auth/whoami)
* [`tm auth refresh`](/cli/reference/auth/refresh)
## Parent Command
* [`tm auth`](/cli/reference/auth)
# tm auth status
Source: https://inference.docs.tensormesh.ai/cli/reference/auth/status
Show local Control Plane and Gateway auth status.
## What This Checks
`tm auth status` is a local readiness check. It inspects whether the expected Control Plane and gateway credentials are present locally. It does not make a live API request.
Use [`tm auth whoami`](/cli/reference/auth/whoami) when you want to verify that the current bearer token works against the Control Plane.
## Usage
```sh theme={null}
tm auth status [OPTIONS]
```
## Examples
### Show local Control Plane and Gateway auth state.
```sh theme={null}
tm auth status
```
### Use shell-friendly exit codes when Control Plane or Gateway auth is not ready.
```sh theme={null}
tm auth status --exit-status
```
## Options
| Name | Type | Required | Default | Details |
| --------------- | --------- | -------- | ------- | ----------------------------------------------------------------------------------------- |
| `--exit-status` | `boolean` | no | `false` | Exit non-zero when Control Plane or Gateway auth prerequisites are missing. Boolean flag. |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Prerequisites
* Set `gateway_api_key` under `[overrides]` in `config.toml` so `tm auth status` reports the inference API key as present.
## Caveats
* Reports local credential presence. Use `tm auth whoami` to live-validate Control Plane auth.
## Related Commands
* [`tm auth login`](/cli/reference/auth/login)
* [`tm auth whoami`](/cli/reference/auth/whoami)
* [`tm config show`](/cli/reference/config/show)
* [`tm doctor`](/cli/reference/doctor)
## Parent Command
* [`tm auth`](/cli/reference/auth)
# tm auth whoami
Source: https://inference.docs.tensormesh.ai/cli/reference/auth/whoami
Show the authenticated Control Plane user profile.
## What This Checks
`tm auth whoami` is a live Control Plane check. It calls the profile endpoint with the current bearer token and confirms that the token is accepted by the current Control Plane base URL.
Use [`tm auth status`](/cli/reference/auth/status) when you only need to inspect local credential presence without making a network call.
## Usage
```sh theme={null}
tm auth whoami [OPTIONS]
```
## Examples
### Show the current authenticated Control Plane identity.
```sh theme={null}
tm auth whoami
```
### Show the current authenticated Control Plane identity in structured JSON output.
```sh theme={null}
tm --output json auth whoami
```
## Options
| Name | Type | Required | Default | Details |
| ----------- | ------- | -------- | ------- | --------------------------------------------- |
| `--timeout` | `float` | no | | HTTP timeout in seconds for the profile call. |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Auth Scope
* controlplane-access-token
## Prerequisites
* Run tm auth login first.
## Caveats
* Uses `GET /auth/profile` to live-validate the current bearer token.
## Related Commands
* [`tm auth login`](/cli/reference/auth/login)
* [`tm auth refresh`](/cli/reference/auth/refresh)
## Parent Command
* [`tm auth`](/cli/reference/auth)
# tm billing
Source: https://inference.docs.tensormesh.ai/cli/reference/billing/index
Billing and usage (Control Plane).
## Usage
```sh theme={null}
tm billing [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Inspect the current user billing balance.
```sh theme={null}
tm billing balance
```
## Subcommands
* [`tm billing address`](/cli/reference/billing/address): Billing address tools.
* [`tm billing balance`](/cli/reference/billing/balance): Get current balance (GET /v1/billing/balance).
* [`tm billing pricing`](/cli/reference/billing/pricing): Pricing info (Control Plane).
* [`tm billing spending`](/cli/reference/billing/spending): Spending summaries.
* [`tm billing stripe`](/cli/reference/billing/stripe): Stripe-backed billing tools.
* [`tm billing transactions`](/cli/reference/billing/transactions): Billing transactions.
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm billing pricing serverless list
Source: https://inference.docs.tensormesh.ai/cli/reference/billing/pricing/serverless/list
List serverless pricing (GET /v1/billing/serverless-pricing).
## When To Use This
Use `tm billing pricing serverless list` when you have Control Plane access for the current Tensormesh environment and need to discover published serverless model names.
Use the returned `pricing[].model` value as the `--model` input for `tm infer chat`, the SDK, or raw HTTP requests.
Example response shape:
```yaml theme={null}
pricing:
- name: MiniMaxAI/MiniMax-M2.5
model: MiniMaxAI/MiniMax-M2.5
isActive: true
```
Use `model` when sending inference requests. `id` is the pricing-record id, and `name` is display-oriented.
## Usage
```sh theme={null}
tm billing pricing serverless list [OPTIONS]
```
## Examples
### List published serverless pricing records.
```sh theme={null}
tm billing pricing serverless list
```
### Inspect only active pricing records and copy `pricing[].model` from structured output.
```sh theme={null}
tm --output json billing pricing serverless list --active-only
```
### Filter the pricing list to one known serverless model name.
```sh theme={null}
tm billing pricing serverless list --model MiniMaxAI/MiniMax-M2.5
```
## Options
| Name | Type | Required | Default | Details |
| --------------- | --------- | -------- | ------- | ----------------------------------------- |
| `--model` | `text` | no | | Filter by model name. |
| `--active-only` | `boolean` | no | `false` | Return active pricing only. Boolean flag. |
| `--timeout` | `float` | no | | HTTP timeout in seconds. |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Prerequisites
* Run `tm auth login` first, or otherwise provide Control Plane auth for the same Tensormesh environment you want to inspect.
## Caveats
* This command lists pricing records for the current Tensormesh Control Plane environment. If you are targeting a different serverless host override, confirm the model name for that host separately.
## Related Commands
* [`tm infer chat`](/cli/reference/infer/chat)
* [`tm auth whoami`](/cli/reference/auth/whoami)
## Parent Command
* [`tm billing pricing serverless`](/cli/reference/billing/pricing/serverless)
# tm completion
Source: https://inference.docs.tensormesh.ai/cli/reference/completion
Print a shell completion script for Bash/Zsh/Fish.
## Usage
```sh theme={null}
tm completion [OPTIONS] {bash|zsh|fish}
```
## Examples
### Print shell completion output for Zsh.
```sh theme={null}
tm completion zsh
```
## Details
Print a shell completion script for Bash/Zsh/Fish.
Examples:
source \<(tm completion bash)
source \<(tm completion zsh)
tm completion fish | source
## Arguments
| Name | Type | Required | Default | Details | | | | |
| ------- | -------------- | -------- | ------- | ------- | - | ----------------- | --- | -------- |
| `shell` | \`choice\[bash | zsh | fish]\` | yes | | Metavar: \`\{bash | zsh | fish}\`. |
## Options
| Name | Type | Required | Default | Details |
| -------- | ------ | -------- | ------- | -------------------------------------------------------- |
| `--prog` | `text` | no | `"tm"` | Program name to generate completions for (usually 'tm'). |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm config
Source: https://inference.docs.tensormesh.ai/cli/reference/config/index
Manage Tensormesh CLI configuration.
## Usage
```sh theme={null}
tm config [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Create a starter CLI config file.
```sh theme={null}
tm config init
```
### Inspect the currently resolved config values.
```sh theme={null}
tm config show
```
## Subcommands
* [`tm config init`](/cli/reference/config/init): Write a starter Tensormesh CLI config template.
* [`tm config show`](/cli/reference/config/show): Print resolved configuration (secrets redacted).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm config show
Source: https://inference.docs.tensormesh.ai/cli/reference/config/show
Print resolved configuration (secrets redacted).
## Usage
```sh theme={null}
tm config show [OPTIONS]
```
## Examples
### Print the currently resolved CLI configuration.
```sh theme={null}
tm config show
```
### Show both resolved values and where each value came from.
```sh theme={null}
tm config show --sources
```
## Options
| Name | Type | Required | Default | Details |
| ----------- | --------- | -------- | ------- | ----------------------------------------------------------------- |
| `--sources` | `boolean` | no | `false` | Include where each resolved config value came from. Boolean flag. |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Caveats
* `gateway_api_key` is the stored inference API key used by the SDK as `inference_api_key`.
## Related Commands
* [`tm config init`](/cli/reference/config/init)
* [`tm auth status`](/cli/reference/auth/status)
* [`tm doctor`](/cli/reference/doctor)
## Parent Command
* [`tm config`](/cli/reference/config)
# tm doctor
Source: https://inference.docs.tensormesh.ai/cli/reference/doctor
Diagnose configuration and credentials.
## What This Checks
`tm doctor` is a broad local diagnosis command. It inspects configuration and credential readiness across the CLI, but it does not prove that a live API call will succeed.
Use [`tm auth whoami`](/cli/reference/auth/whoami) for a live Control Plane auth check and [`tm infer chat`](/cli/reference/infer/chat) for an end-to-end inference check.
## Usage
```sh theme={null}
tm doctor [OPTIONS]
```
## Examples
### Check the current CLI configuration and credential state.
```sh theme={null}
tm doctor
```
### Use shell-friendly exit codes when required credentials are missing.
```sh theme={null}
tm doctor --exit-status
```
## Options
| Name | Type | Required | Default | Details |
| --------------- | --------- | -------- | ------- | ----------------------------------------------------------------- |
| `--exit-status` | `boolean` | no | `false` | Exit non-zero when checks report a not-ready state. Boolean flag. |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Caveats
* Reports local readiness only. Use `tm auth whoami` to live-validate Control Plane auth and `tm infer chat` for an end-to-end inference check.
* Use `tm infer doctor` for direct gateway gating and `tm auth status`/`tm auth whoami` for Control Plane-specific checks.
## Related Commands
* [`tm config show`](/cli/reference/config/show)
* [`tm auth whoami`](/cli/reference/auth/whoami)
* [`tm infer doctor`](/cli/reference/infer/doctor)
* [`tm infer chat`](/cli/reference/infer/chat)
## Parent Command
* [`tm`](/cli/reference)
# tm
Source: https://inference.docs.tensormesh.ai/cli/reference/index
Tensormesh command-line interface.
## Before You Use `tm`
* Install the CLI first if `tm` is not already on your `PATH`. In this repo checkout, use `./.venv/bin/tm` until your shell already exposes `tm`.
* Start with `tm init` if you are not sure what is already configured locally.
* Use `tm auth login` to obtain a Control Plane bearer token.
* Put global options such as `--output json` before the subcommand.
* Set `TM_CONFIG_HOME` when you need an alternate config and auth root for local scripting.
* Use `tm auth status`, `tm infer doctor`, and `tm doctor` for local readiness checks.
* Use `tm auth whoami` for a live Control Plane auth check and `tm infer chat` for an end-to-end inference check.
## Usage
```sh theme={null}
tm [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Inspect local setup and print the shortest path to a working request.
```sh theme={null}
tm init
```
### Inspect serverless readiness before the first request.
```sh theme={null}
tm infer doctor
```
### Inspect local Control Plane and inference auth state.
```sh theme={null}
tm auth status
```
### Send a basic serverless chat request.
```sh theme={null}
tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --json '[{"role":"user","content":"hi"}]'
```
## Details
Tensormesh CLI for Control Plane and Inference API workflows.
## Subcommands
* [`tm activities`](/cli/reference/activities): Activities (Control Plane).
* [`tm admin`](/cli/reference/admin): Admin-only commands (Control Plane).
* [`tm auth`](/cli/reference/auth): Authenticate to the Tensormesh Control Plane.
* [`tm billing`](/cli/reference/billing): Billing and usage (Control Plane).
* [`tm completion`](/cli/reference/completion): Print a shell completion script for Bash/Zsh/Fish.
* [`tm config`](/cli/reference/config): Manage Tensormesh CLI configuration.
* [`tm cost`](/cli/reference/cost): Per-model serverless spend and KV-cache savings.
* [`tm doctor`](/cli/reference/doctor): Diagnose configuration and credentials.
* [`tm infer`](/cli/reference/infer): Inference commands for the OpenAI-compatible serverless endpoints.
* [`tm init`](/cli/reference/init): Guide first-time CLI setup for Control Plane and serverless workflows.
* [`tm metrics`](/cli/reference/metrics): Observability metrics (Control Plane).
* [`tm products`](/cli/reference/products): Products (Control Plane).
* [`tm reserved-deployments`](/cli/reference/reserved-deployments): Reserved deployments (Support; Control Plane).
* [`tm tickets`](/cli/reference/tickets): Support tickets (Control Plane).
* [`tm users`](/cli/reference/users): User profile resources (Control Plane).
* [`tm version`](/cli/reference/version): Show CLI version and runtime details.
## Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Environment Variables
* `TENSORMESH_CA_BUNDLE`
* `TENSORMESH_TIMEOUT_SECONDS`
* `TENSORMESH_MAX_RETRIES`
* `TM_CONFIG_HOME`
## Related Commands
* [`tm init`](/cli/reference/init)
* [`tm config show`](/cli/reference/config/show)
* [`tm doctor`](/cli/reference/doctor)
## Additional Notes
Config precedence: flags > env > config.toml (\[overrides] before \[managed]) > defaults.
Global options such as --output must come before the subcommand:
tm --output json auth status
`gateway_api_key` in config.toml stores the inference API key used by serverless
requests. Set it under \[overrides] in config.toml, or pass --api-key on each request.
It has no environment-variable equivalent. Control Plane auth uses auth.json under
the active state root.
Quickstart:
tm auth login
tm auth status
tm infer chat --api-key YOUR\_INFERENCE\_API\_KEY --model YOUR\_SERVERLESS\_MODEL\_NAME \
\--json '\[\{"role":"user","content":"hi"}]'
# tm infer chat
Source: https://inference.docs.tensormesh.ai/cli/reference/infer/chat
Call POST /v1/chat/completions on serverless inference.
## When To Use This
Use `tm infer chat` when you want to send an actual serverless inference request through the CLI.
## Usage
```sh theme={null}
tm infer chat [OPTIONS]
```
## Examples
### Send a non-streaming serverless request with an explicit inference API key.
```sh theme={null}
tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --json '[{"role":"user","content":"Say hello."}]'
```
### Stream tokens over SSE and fail a stalled stream after 30 seconds of upstream silence.
```sh theme={null}
echo '[{"role":"user","content":"Stream tokens."}]' | tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --stream --stream-idle-timeout 30
```
## Options
| Name | Type | Required | Default | Details |
| ----------------------- | -------------------- | -------- | -------------- | ---------------------------------------------------------------------------------------------------- |
| `--surface` | `choice[serverless]` | no | `"serverless"` | Inference surface to use. |
| `--model` | `text` | no | | Model name to use. |
| `--api-key` | `text` | no | | Inference API key (Authorization: Bearer ...). |
| `--base-url` | `text` | no | | Override the base URL for the selected surface. |
| `--stream` | `boolean` | no | `false` | Stream tokens via SSE. Boolean flag. |
| `--stream-idle-timeout` | `float` | no | `300.0` | Maximum idle read timeout in seconds for --stream responses. |
| `--json` | `text` | no | | JSON payload or @file.json (object or messages array). When omitted, reads piped stdin if available. |
| `--file` | `path` | no | | Read JSON payload/messages from file. |
| `--timeout` | `float` | no | | HTTP connect timeout in seconds for the inference request. |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Auth Scope
* inference-api-key
## Prerequisites
* Provide `--model` explicitly or include `model` in the JSON request body.
* If you have Control Plane access for the same Tensormesh environment, discover published serverless model names with `tm billing pricing serverless list`, then pass the returned `pricing[].model` value with `--model`.
* If you only have inference credentials, or you are targeting a different serverless host override, get the model name from your Tensormesh environment before sending the request.
## Caveats
* Reuses `gateway_api_key` from `config.toml` as the inference API key when `--api-key` is omitted.
* `gateway_api_key` is the stored inference API key used by the SDK as `inference_api_key`.
* `tm billing pricing serverless list` helps discover published serverless model names for the current Tensormesh Control Plane environment. If you are targeting a different serverless host override, confirm the model name for that host separately.
* `--stream` currently supports only `--output text`.
## Related Commands
* [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list)
* `tm models list`
* [`tm doctor`](/cli/reference/doctor)
## Parent Command
* [`tm infer`](/cli/reference/infer)
# tm infer doctor
Source: https://inference.docs.tensormesh.ai/cli/reference/infer/doctor
Inspect serverless inference readiness for the next request.
## What This Checks
`tm infer doctor` is a local readiness check for the next inference request. It helps you confirm that the CLI has the inputs it needs, but it does not send a live inference request.
Use [`tm infer chat`](/cli/reference/infer/chat) for an end-to-end inference check, and use [`tm auth whoami`](/cli/reference/auth/whoami) if you also need to confirm the current Control Plane bearer token.
## Usage
```sh theme={null}
tm infer doctor [OPTIONS]
```
## Examples
### Inspect serverless readiness for a direct request that will provide `--model` explicitly.
```sh theme={null}
tm infer doctor
```
### Inspect the effective serverless target after applying explicit request overrides.
```sh theme={null}
tm infer doctor --model YOUR_SERVERLESS_MODEL_NAME --base-url https://serverless.tensormesh.ai
```
### Use shell-friendly exit codes when direct serverless prerequisites are missing.
```sh theme={null}
tm infer doctor --exit-status
```
## Details
Inspect inference readiness for the next request.
## Options
| Name | Type | Required | Default | Details |
| --------------- | -------------------- | -------- | -------------- | ----------------------------------------------------------------- |
| `--surface` | `choice[serverless]` | no | `"serverless"` | Inference surface to inspect. |
| `--model` | `text` | no | | Model name to inspect for the next request. |
| `--api-key` | `text` | no | | Inference API key to inspect. |
| `--base-url` | `text` | no | | Override the base URL for the selected surface. |
| `--exit-status` | `boolean` | no | `false` | Exit non-zero when checks report a not-ready state. Boolean flag. |
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Caveats
* Reports local readiness only. Use `tm auth whoami` to live-validate Control Plane auth and `tm infer chat` for an end-to-end inference check.
* `tm infer doctor` accepts the same local targeting overrides as `tm infer chat` for `--model`, `--api-key`, and `--base-url`.
* Checks the shared inference API key (`gateway_api_key`) and selected host, but does not live-validate the upstream endpoint.
* Use `tm billing pricing serverless list` to discover published serverless model names when you have Control Plane access for the same Tensormesh environment. `tm infer doctor` can check whether `--model` is present, but it does not enumerate them itself.
## Related Commands
* [`tm init`](/cli/reference/init)
* [`tm auth status`](/cli/reference/auth/status)
* [`tm infer chat`](/cli/reference/infer/chat)
* [`tm doctor`](/cli/reference/doctor)
## Parent Command
* [`tm infer`](/cli/reference/infer)
# tm infer
Source: https://inference.docs.tensormesh.ai/cli/reference/infer/index
Inference commands for the OpenAI-compatible serverless endpoints.
## Usage
```sh theme={null}
tm infer [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Inspect serverless readiness before sending a request.
```sh theme={null}
tm infer doctor
```
### Send a serverless chat-completions request with an explicit inference API key.
```sh theme={null}
tm infer chat --api-key YOUR_INFERENCE_API_KEY --model YOUR_SERVERLESS_MODEL_NAME --json '[{"role":"user","content":"Say hello."}]'
```
### List models from the default serverless host.
```sh theme={null}
tm infer models
```
## Subcommands
* [`tm infer chat`](/cli/reference/infer/chat): Call POST /v1/chat/completions on serverless inference.
* [`tm infer completions`](/cli/reference/infer/completions): Call POST /v1/completions on serverless inference.
* [`tm infer detokenize`](/cli/reference/infer/detokenize): Call POST /detokenize on serverless inference.
* [`tm infer doctor`](/cli/reference/infer/doctor): Inspect serverless inference readiness for the next request.
* [`tm infer health`](/cli/reference/infer/health): Call GET /health on serverless inference.
* [`tm infer models`](/cli/reference/infer/models): Call GET /v1/models on serverless inference.
* [`tm infer responses`](/cli/reference/infer/responses): Call POST /v1/responses on serverless inference.
* [`tm infer tokenize`](/cli/reference/infer/tokenize): Call POST /tokenize on serverless inference.
* [`tm infer version`](/cli/reference/infer/version): Call GET /version on serverless inference.
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm init
Source: https://inference.docs.tensormesh.ai/cli/reference/init
Guide first-time CLI setup for Control Plane and serverless workflows.
## Usage
```sh theme={null}
tm init [OPTIONS]
```
## Examples
### Inspect local setup and print the next commands required for a first request.
```sh theme={null}
tm init
```
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Related Commands
* [`tm auth status`](/cli/reference/auth/status)
* [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list)
* [`tm config show`](/cli/reference/config/show)
* [`tm infer doctor`](/cli/reference/infer/doctor)
* [`tm infer chat`](/cli/reference/infer/chat)
## Parent Command
* [`tm`](/cli/reference)
# tm metrics
Source: https://inference.docs.tensormesh.ai/cli/reference/metrics/index
Observability metrics (Control Plane).
## Usage
```sh theme={null}
tm metrics [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Fetch user-level observability metrics.
```sh theme={null}
tm metrics user
```
## Subcommands
* [`tm metrics user`](/cli/reference/metrics/user): Fetch user metrics (GET /v1/observability/users/metrics).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm products
Source: https://inference.docs.tensormesh.ai/cli/reference/products/index
Products (Control Plane).
## Usage
```sh theme={null}
tm products [OPTIONS] COMMAND [ARGS]...
```
## Examples
### List products available through the Control Plane.
```sh theme={null}
tm products list
```
## Subcommands
* [`tm products list`](/cli/reference/products/list): List available products (GET /v1/products).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm reserved-deployments
Source: https://inference.docs.tensormesh.ai/cli/reference/reserved-deployments/index
Reserved deployments (Support; Control Plane).
## Usage
```sh theme={null}
tm reserved-deployments [OPTIONS] COMMAND [ARGS]...
```
## Examples
### Inspect the reserved deployment submission flow.
```sh theme={null}
tm reserved-deployments submit --help
```
## Subcommands
* [`tm reserved-deployments submit`](/cli/reference/reserved-deployments/submit): Submit reserved deployment request (POST /v1/support/reserved-deployments).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm tickets
Source: https://inference.docs.tensormesh.ai/cli/reference/tickets/index
Support tickets (Control Plane).
## Usage
```sh theme={null}
tm tickets [OPTIONS] COMMAND [ARGS]...
```
## Examples
### List support tickets for the current user.
```sh theme={null}
tm tickets list
```
## Subcommands
* [`tm tickets close`](/cli/reference/tickets/close): Close/delete a ticket (DELETE /v1/support/tickets/\{ticketId}).
* [`tm tickets create`](/cli/reference/tickets/create): Create a ticket (POST /v1/support/tickets).
* [`tm tickets get`](/cli/reference/tickets/get): Get a ticket (GET /v1/support/tickets/\{ticketId}).
* [`tm tickets list`](/cli/reference/tickets/list): List tickets (GET /v1/support/tickets).
* [`tm tickets message`](/cli/reference/tickets/message): Append a message to a ticket (POST /v1/support/tickets/\{ticketId}/messages).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm users
Source: https://inference.docs.tensormesh.ai/cli/reference/users/index
User profile resources (Control Plane).
## Usage
```sh theme={null}
tm users [OPTIONS] COMMAND [ARGS]...
```
## Examples
### List user API keys from the Control Plane.
```sh theme={null}
tm users api-keys list
```
## Subcommands
* [`tm users accept-tos`](/cli/reference/users/accept-tos): Accept terms of service (POST /v1/users/accept-tos).
* [`tm users api-keys`](/cli/reference/users/api-keys): User API key management.
* [`tm users update`](/cli/reference/users/update): Update a user profile (PUT /v1/users/\{userId}).
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Parent Command
* [`tm`](/cli/reference)
# tm version
Source: https://inference.docs.tensormesh.ai/cli/reference/version
Show CLI version and runtime details.
## Usage
```sh theme={null}
tm version [OPTIONS]
```
## Examples
### Show the installed CLI version and runtime details.
```sh theme={null}
tm version
```
### Emit version and runtime details in machine-readable JSON.
```sh theme={null}
tm --output json version
```
## Inherited Global Options
| Name | Type | Required | Default | Details | | | | |
| --------------------- | -------------- | -------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | -------- | -- | -------- | ----------------------------------------------------------------- |
| `--version`, `-V` | `boolean` | no | `false` | Show the version and exit. Boolean flag. | | | | |
| `--config` | `path` | no | `"~/.config/tensormesh/config.toml"` | Path to config TOML file | | | | |
| `--output` | \`choice\[text | json | yaml | raw | table]\` | no | `"text"` | Output format (text is human-readable; json is machine-friendly). |
| `--quiet` | `boolean` | no | `false` | Suppress non-essential output. Boolean flag. | | | | |
| `--debug` | `boolean` | no | `false` | Print debug logs to stderr (secrets redacted). Boolean flag. | | | | |
| `--ca-bundle` | `path` | no | | Path to a PEM CA bundle for TLS verification (overrides TENSORMESH\_CA\_BUNDLE). | | | | |
| `--timeout` | `float` | no | | Default HTTP timeout in seconds (overrides TENSORMESH\_TIMEOUT\_SECONDS; subcommands may override). | | | | |
| `--max-retries` | `integer` | no | | Max retries for idempotent HTTP requests on transient errors (overrides TENSORMESH\_MAX\_RETRIES; subcommands may override). | | | | |
| `--controlplane-base` | `text` | no | | Override the Control Plane base URL. | | | | |
## Related Commands
* [`tm init`](/cli/reference/init)
* [`tm config show`](/cli/reference/config/show)
## Parent Command
* [`tm`](/cli/reference)
# Codex CLI on Tensormesh
Source: https://inference.docs.tensormesh.ai/codex
Drive open-weight models with stock OpenAI Codex CLI against Tensormesh — sign up, configure, and run in 5 minutes.
Get stock [Codex CLI](https://www.npmjs.com/package/@openai/codex) driving open-weight models against Tensormesh in 5 minutes. Every Tensormesh serverless model supports the full Codex flow today (chat + tool use); `MiniMaxAI/MiniMax-M2.5` is the recommended default.
## Quick Links
Create your Tensormesh account with Google or GitHub.
Generate an `ak-...` key under **Profile → API keys**.
`npm install -g @openai/codex` — verified against Codex 0.128+.
Full matrix of Codex-ready models on Tensormesh serverless.
Email [saas-support@tensormesh.ai](mailto:saas-support@tensormesh.ai) for help.
## TL;DR
Three steps — install the CLI, configure the provider, set the API key — then run `codex`. Step 2 has an ordering constraint (top-level keys must precede any `[section]` header); see [Setup](#setup) below if you have an existing `~/.codex/config.toml`.
```bash theme={null}
# Step 1 — install Codex CLI (skip if already installed)
npm install -g @openai/codex
# Step 2 — configure the Tensormesh provider in ~/.codex/config.toml.
# Safe only if the file is missing or empty. If you already have
# a config.toml, see Step 2 in the Setup section below.
cat > ~/.codex/config.toml <<'EOF'
# Top-level keys (must come before any [section] header)
model_provider = "tensormesh"
model = "MiniMaxAI/MiniMax-M2.5"
model_reasoning_effort = "medium"
[model_providers.tensormesh]
name = "tensormesh"
base_url = "https://serverless.tensormesh.ai/v1"
wire_api = "responses"
env_key = "TENSORMESH_INFERENCE_API_KEY"
EOF
# Step 3 — set your API key (add to ~/.zshrc or ~/.bashrc to persist)
export TENSORMESH_INFERENCE_API_KEY=ak-...
# Run it
codex
```
That's the full setup — no third-party tooling installed, no PATH addition. [Setup](#setup) below walks through the same three steps in detail (and the merge-into-existing-config case).
## Prerequisites
* **Codex CLI** installed via `npm install -g @openai/codex`. Verified against `0.128.0` through `0.131.0` (chat + tool use end-to-end); forward-compatible with later versions barring upstream Codex breaking changes.
* **A Tensormesh account** with an API key (`ak-...`). [Sign up](https://app.tensormesh.ai/login), then visit [Profile → API keys](https://app.tensormesh.ai/profile?tab=api).
* **macOS or Linux**, bash or zsh. Windows binaries ship in Codex 0.131+ but aren't currently tested by Tensormesh.
You do **not** need to run `codex login`. The provider's `env_key` field tells Codex to read your API key from the environment variable directly; the OAuth login flow is for OpenAI-hosted models only.
You do **not** need to run any local infrastructure. Tensormesh handles Codex compatibility server-side, so stock `codex` pointed at `serverless.tensormesh.ai` (per the TL;DR above) is the complete setup.
## Supported models
| Model | Codex CLI status | Notes |
| ----------------------------------------- | ----------------- | --------------------------------------- |
| `MiniMaxAI/MiniMax-M2.5` | ✓ chat + tool use | Recommended default; 192K context |
| `openai/gpt-oss-120b` | ✓ chat + tool use | Reasoning + tools, 128K context |
| `openai/gpt-oss-20b` | ✓ chat + tool use | Reasoning + tools, 128K context |
| `Qwen/Qwen3-235B-A22B` | ✓ chat + tool use | Reasoning + tools, 40K context |
| `Qwen/Qwen3-30B-A3B` | ✓ chat + tool use | Reasoning + tools, 40K context |
| `Qwen/Qwen3-Coder-30B-A3B-Instruct` | ✓ chat + tool use | Coding-tuned, 256K context |
| `Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8` | ✓ chat + tool use | Coding-tuned, 256K context |
| `mistralai/Devstral-2-123B-Instruct-2512` | ✓ chat + tool use | Mistral-architecture coder, 32K context |
| `moonshotai/Kimi-K2.6` | ✓ chat + tool use | Reasoning + tools, 32K context |
`GET /v1/models` reflects what's currently available — Tensormesh hides any model that's temporarily cold. If you see fewer models than the table lists, retry after 30–60 seconds; the first request to a cold model warms it up.
For non-Codex clients (Python SDK, curl, custom apps), every model in the table works fine via `/v1/chat/completions` as well. Codex CLI specifically cannot fall back to that wire (see [openai/codex#7782](https://github.com/openai/codex/discussions/7782) for OpenAI's rationale), which is why the matrix above is Codex-CLI specific.
## Switching models
The Codex TUI's `/model` picker only shows OpenAI's built-in lineup (`gpt-5.5`, `gpt-5.4`, …) — Tensormesh model slugs aren't in it. Likewise, the *"GPT-5.5 is now available"* tip on launch refers to models you can't use here. **Press Esc to dismiss the picker** and switch models via one of the methods below.
This is a Codex CLI limitation that affects every third-party provider; it's not specific to Tensormesh.
### Per-invocation (no config edit)
```bash theme={null}
codex -m MiniMaxAI/MiniMax-M2.5 # MiniMax (recommended default)
codex -m openai/gpt-oss-120b # reasoning, large
codex -m openai/gpt-oss-20b # reasoning, small
codex -m Qwen/Qwen3-235B-A22B # reasoning, 40K
codex -m Qwen/Qwen3-30B-A3B # reasoning, 40K
codex -m Qwen/Qwen3-Coder-30B-A3B-Instruct # coder, 256K
codex -m Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8 # coder, 256K
codex -m mistralai/Devstral-2-123B-Instruct-2512 # Mistral coder
codex -m moonshotai/Kimi-K2.6 # Kimi reasoning
```
`-m` is a per-invocation override; your `config.toml` default is unchanged. Equivalent long form: `codex -c 'model="..."'`.
### Change the default
Edit `~/.codex/config.toml` and update the `model = ` line, or use sed:
```bash theme={null}
sed -i '' 's|^model = ".*"|model = "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8"|' ~/.codex/config.toml
```
(Drop the empty-string argument from `-i` on Linux: `sed -i 's|...|' ~/.codex/config.toml`.)
### Optional: shell aliases for frequent switching
If you switch models often, add aliases to your `~/.zshrc` (zsh) or `~/.bashrc` (bash):
```bash theme={null}
alias tm-mini='codex -m MiniMaxAI/MiniMax-M2.5'
alias tm-gpt='codex -m openai/gpt-oss-120b'
alias tm-qwen='codex -m Qwen/Qwen3-235B-A22B'
alias tm-coder='codex -m Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8'
alias tm-coder-small='codex -m Qwen/Qwen3-Coder-30B-A3B-Instruct'
alias tm-devstral='codex -m mistralai/Devstral-2-123B-Instruct-2512'
alias tm-kimi='codex -m moonshotai/Kimi-K2.6'
```
Reload your shell, then run `tm-coder` from any directory to start a Codex session against that model. Exit codex (`/exit` or Ctrl-D twice) and run a different alias to switch.
## Setup
The three steps from the TL;DR, with explanation.
```bash theme={null}
npm install -g @openai/codex
```
This installs the `codex` command to your global `node_modules/bin`. Verify with `codex --version`.
Codex reads provider configuration from `~/.codex/config.toml`. Add this content:
```toml theme={null}
# Top-level keys (must come before any [section] header)
model_provider = "tensormesh"
model = "MiniMaxAI/MiniMax-M2.5"
model_reasoning_effort = "medium"
[model_providers.tensormesh]
name = "tensormesh"
base_url = "https://serverless.tensormesh.ai/v1"
wire_api = "responses"
env_key = "TENSORMESH_INFERENCE_API_KEY"
```
The first three keys make Tensormesh + MiniMax + medium reasoning the default for every `codex` invocation. The `[model_providers.tensormesh]` block defines the provider those defaults reference. You can override per-invocation with `-c`.
**TOML ordering matters.** The `model_provider`, `model`, and `model_reasoning_effort` keys are top-level — they must appear in the file **before any `[section]` header** (TOML doesn't reset table context on blank lines, so anything below a `[header]` belongs to that section).
Just paste the block as-is — the TL;DR's `cat > ~/.codex/config.toml` does this.
If you already use Codex with another provider (OpenAI direct, Azure, etc.), open `~/.codex/config.toml` in your editor and merge:
1. Put the three top-level `model_*` keys at the top of the file, replacing your previous defaults if any (the keys must be unique in TOML — you can't have two `model_provider` lines).
2. Put the `[model_providers.tensormesh]` section anywhere below the top-level keys; it's additive and won't conflict with other `[model_providers.]` sections.
To switch back to your other provider for a single run, use `-c 'model_provider="openai"'` (or whichever you've configured) — no config edit needed.
```bash theme={null}
export TENSORMESH_INFERENCE_API_KEY=ak-...
```
Add this to `~/.zshrc` (zsh) or `~/.bashrc` (bash) to persist across sessions. The API key prefix selects environment: `ak-dev-...` for dev, `ak-staging-...` for staging, `ak-live-...` for production.
Don't have a key yet? [Generate one in your profile](https://app.tensormesh.ai/profile?tab=api).
## Usage
```bash theme={null}
# Interactive TUI (works in any directory)
codex
# One-shot prompt — note the
Codex CLI 0.128.0 removed the older `--full-auto` shortcut. Use `-s workspace-write` (+ `-a never` for interactive) instead. If you copy a snippet that uses `--full-auto`, Codex will error with `unexpected argument '--full-auto' found`.
### Resume gotcha — `--last` orders by file mtime
`codex exec resume --last` picks the session whose JSONL file was most recently modified, **not** the one most recently created. So if you just touched an older session (even by reading or resuming it once), that session — not your latest one — wins `--last`. To target a specific session, pass its UUID explicitly:
```bash theme={null}
codex exec resume --skip-git-repo-check "follow-up" ` not found. Defaulting to
fallback metadata; this can degrade performance and cause issues.
```
**This is cosmetic. Functionality is unaffected.** Codex CLI ships a built-in registry of OpenAI's own models (`gpt-5.5`, `gpt-5.4`, …); when it sees a slug that isn't in the registry it falls back to default metadata and emits this warning. Tensormesh model slugs (MiniMax, Qwen3, etc.) are not in OpenAI's registry, so the warning fires for every supported model here.
The warning **does not appear** in `codex exec` (non-interactive) runs — only in TUI. It's a Codex CLI behavior, not a Tensormesh behavior; the same applies to every other third-party provider.
### Auto-compact threshold
Codex automatically compacts conversation history when it approaches the model's context window. The exact trigger varies per model, and the threshold is configurable via Codex's `auto_compact_token_limit` setting:
| Model | Context window |
| -------------------------------------------------------------------- | -------------- |
| `MiniMaxAI/MiniMax-M2.5` | 192K (196,608) |
| `openai/gpt-oss-120b` / `gpt-oss-20b` | 128K (131,072) |
| `Qwen/Qwen3-235B-A22B` / `Qwen3-30B-A3B` | 40K (40,960) |
| `Qwen/Qwen3-Coder-30B-A3B-Instruct` / `Coder-480B-A35B-Instruct-FP8` | 256K (262,144) |
| `mistralai/Devstral-2-123B-Instruct-2512` | 32K (32,768) |
| `moonshotai/Kimi-K2.6` | 32K (32,768) |
If you're using a 40K-window model, expect compaction to fire much earlier in long sessions than on a 192K MiniMax run.
**What you'll see when it fires:**
* In **TUI mode**: a visible "compacting..." event between turns.
* In **`exec` mode**: silent — the compact-trigger turn just takes longer (around 30–60 seconds extra) and the next turn proceeds with the compressed context. No explicit message is printed.
**What's preserved vs lost** when compaction fires:
* ✓ Preserved: the **topical context** of the conversation (documents you've fed to Codex, the high-level task you're working on).
* ✗ Lost: **specific conversational facts you told Codex** ("remember the codeword BLUEFISH42"). After compaction, Codex sees a summary of earlier turns, not the verbatim history. If specific recall matters for your workflow, plan for compaction or split into fresh sessions.
To trigger compaction manually before reaching the threshold, type `/compact` in the TUI. Otherwise, start a fresh session.
## Troubleshooting
When a request fails, Codex retries five times before surfacing the cause:
```
ERROR: Reconnecting... 1/5
ERROR: Reconnecting... 2/5
... (3/5, 4/5, 5/5)
ERROR:
```
The five `Reconnecting...` lines are noise. The meaningful error is the line immediately after `5/5`.
| Symptom (substring of the meaningful error line) | Likely cause | Fix |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `command not found: codex` | Codex CLI not installed | `npm install -g @openai/codex` |
| `Missing environment variable: TENSORMESH_INFERENCE_API_KEY` | Variable not exported in the current shell | `export TENSORMESH_INFERENCE_API_KEY=ak-...`; persist in `~/.zshrc` / `~/.bashrc` |
| `We're currently experiencing high demand, which may cause temporary errors` *(after 5 retries)* | Most often an **invalid or wrong-environment API key** (auth failures are reported as 5xx, which Codex retries before surfacing). Less often, a transient capacity event. | Verify your key against your account and confirm the `ak--...` prefix matches your target environment. Quick check: `curl -sS -H "Authorization: Bearer $TENSORMESH_INFERENCE_API_KEY" https://serverless.tensormesh.ai/v1/models`. If it errors, the key is the problem. |
| `404 Not Found` / `Model '' not found` *(or)* `400 Bad Request` / `The '' model is not supported when using Codex with a ChatGPT account` | Wrong model slug, or `base_url` typo in `config.toml`. The 404 means Tensormesh doesn't recognize the slug; the 400 is from Codex CLI itself rejecting the slug before sending it. Both mean "fix the model name." | Compare your `~/.codex/config.toml` against the snippet in [Setup](#setup); `curl $base_url/models` to list what's actually available; or check the [Supported models](#supported-models) matrix. |
| `404 Not Found` / `Model '' not found` *but* the slug appears in `curl $base_url/models` | The model is temporarily cold (no instance running). | Wait 30–60 seconds and retry — a request will warm the model. After warm-up, subsequent requests are typically under 5 seconds. |
| `Operation not allowed: read-only` (mid-session) | Codex's default sandbox is read-only | Restart with `codex -s workspace-write -a never` for normal coding, or `codex --dangerously-bypass-approvals-and-sandbox` for full access. |
| `error: unexpected argument '--full-auto' found` | Codex 0.128.0 removed `--full-auto` | Use `-s workspace-write -a never` (interactive) or `-s workspace-write` (`codex exec`). |
| `Maximum context length is 196608 tokens` *(or model-specific limit)* | Conversation grew past the model's context window | Type `/compact` in TUI, or start a new session. |
| `codex exec` appears to hang printing `Reading additional input from stdin...` | Codex's exec mode reads stdin even when the prompt is in argv | Add `
KV cache entries survive beyond a single request window. Long system prompts and repeated context are stored across sessions.
A higher fraction of requests hit the cache, meaning more tokens served at \$0 and a lower effective cost per call.
Requests that share context with previous sessions skip recomputation entirely — reducing time-to-first-token.
Once your bucket is active, caching is handled automatically. No changes to your existing API calls required.
***
## Storage Plans
Plans are tiered by bucket size. Subscribe or change plans anytime from **Operations → Storage** — billing adjusts immediately and no data is lost on upgrade.
| Plan | Best For |
| ---------- | ----------------------------------------------------------------- |
| **Bronze** | Getting started — low to moderate request volume |
| **Silver** | Agentic developers — more headroom for parallel workloads |
| **Gold** | Production-scale inference — high volume and large system prompts |
External Storage is a flat monthly subscription billed separately from token usage. See [Pricing Overview](/pricing-overview#external-storage) for how it interacts with cached token pricing.
***
## KV Cache Calculator
Use the **KV Cache Calculator** on **Operations → Storage** to estimate how much bucket capacity a given conversation will consume.
Select a model, enter a context length, and choose a data type — the calculator shows the resulting KV cache size in GB, broken down step-by-step using the model's actual architecture parameters.
**How to use it:**
1. Navigate to **Operations → Storage**.
2. Scroll to the **KV Cache Calculator** section.
3. Pick a model from the serverless catalog.
4. Enter the context length you plan to work with.
5. Select the data type (BF16 is the default for most models).
6. Read off the GB estimate and compare it to each plan's bucket size.
***
## Monitoring Your Usage
The **Operations → Storage** page shows:
* **Live usage bar** — Your current bucket fill level so you know how much capacity you're using.
* **Per-model KV cache usage table** — A breakdown of how much storage each model is consuming, so you can see exactly where your bucket is being used.
**Storage threshold notifications** — When your bucket approaches capacity, we send a notification directing you to **Operations → Storage**. Use that as a prompt to upgrade your plan or review which models are consuming the most space.
***
## What Gets Cached
External Storage extends the same KV cache that already powers \$0 cached tokens — it just makes those cached entries persist beyond a single request:
* System messages and instructions
* Shared conversation prefixes and history
* Long document contexts passed repeatedly
* Common prompt templates shared across sessions
***
## Cross-Session vs In-Request Caching
| | In-Memory Cache (default) | External Storage |
| -------------- | --------------------------------- | ----------------------------------- |
| Scope | Single request window | Across requests and sessions |
| Cost | Free (included) | Flat monthly subscription |
| Setup | None | Subscribe at Operations → Storage |
| Cache hit rate | Lower (cold on every new session) | Higher (warm on returning sessions) |
Even without External Storage, cached tokens are always \$0. External Storage increases the fraction of requests that hit the cache.
***
## Related
* [Pricing Overview — External Storage](/pricing-overview#external-storage)
* [Billing & Usage — Serverless Usage](/billing-and-savings#serverless-usage)
* [Serverless Inference](/serverless-inference)
# Glossary
Source: https://inference.docs.tensormesh.ai/glossary
Plain-language definitions for terms you'll encounter on Tensormesh.
New to AI inference or just new to Tensormesh? This glossary explains the key concepts in plain language, no background required.
***
## The Basics
| Term | Meaning |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **LLM** *(Large Language Model)* | The type of AI model Tensormesh runs. LLMs are trained on massive amounts of text and can generate, summarize, translate, explain, and reason about language. Examples include GPT, Qwen, and MiniMax. |
| **Prompt** | Everything you send to the model before it starts responding. Usually a system message that sets the context, followed by one or more user messages. |
| **System Prompt** | An instruction at the start of your request that tells the model how to behave — its persona, task, tone, or constraints. Keeping it identical across requests is the most effective way to improve your cache hit rate. |
| **Completion** | The model's response to your prompt. Also called the output or generation. You pay output token rates for completions. |
| **Token** | The unit LLMs use to read and write text. Your bill is calculated in tokens: you pay for tokens in (your prompt) and tokens out (the model's reply). |
| **Input Token** | Any token in the message you send to the model — system prompt, conversation history, user message, or pasted document. Billed at the per-model input rate, unless served from cache (free). |
| **Output Token** | Any token the model generates in its reply. Always freshly computed and billed at the per-model output rate. |
| **Context Window** | The maximum number of tokens a model can process in a single request, including both what you send and what it generates. A 131K context window fits roughly 100,000 words. |
## Caching
| Term | Meaning |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **KV Cache** *(Key-Value Cache)* | When a model processes tokens, it computes internal data structures called key-value pairs. Tensormesh saves these so that if the same tokens appear at the start of a later request, the model can skip that work entirely, answer faster, and you don't pay for those tokens. |
| **Cached Token** | An input token served from the KV cache instead of being recomputed. Cached tokens are always **\$0**. The more your requests share the same opening text, the more tokens hit the cache. |
| **Prompt Prefix** | The shared opening portion of your prompt — typically the system message and any static context. This is what the KV cache matches on. Even a single character difference at the start creates a cache miss. |
| **Cache Hit Rate** | The percentage of your input tokens served from cache rather than computed fresh. A 60% cache hit rate means 60% of your input tokens cost nothing. |
| **LMCache** | The open-source KV cache engine powering Tensormesh's persistent caching layer. When requests share a prefix, LMCache lets later requests reuse the earlier request's KV tensors instead of recomputing them. |
| **External Storage** | A persistent cache bucket that keeps your context warm across sessions. Unlike the default in-memory cache (which resets each session), External Storage persists KV cache entries so returning workloads hit the cache more often. Plans are Bronze, Silver, and Gold. |
## Inference
| Term | Meaning |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Serverless Inference** | Calling a model via API with no infrastructure to manage. You send a request, Tensormesh routes it to available GPUs, and you get a response. Pay per token, no provisioning or idle costs. |
| **Reserved Deployment** | A dedicated GPU cluster that's exclusively yours. Useful when you need guaranteed capacity, consistent low latency, or strict data isolation. |
| **TTFT** *(Time to First Token)* | How long it takes from when you send a request to when you receive the first token of the model's reply. Cached prefixes reduce TTFT because the model skips recomputing tokens it's already seen. |
| **Streaming** | Receiving the model's response token by token as it's generated, rather than waiting for the full reply. Enable it by adding `"stream": true` to your request. |
| **MoE** *(Mixture of Experts)* | A model architecture where only a fraction of the model's parameters are activated per token. For example, a 397B MoE model may only activate \~17B parameters per token — making it fast and cost-effective despite its large total size. |
## API & Platform
| Term | Meaning |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **OpenAI-Compatible API** | Tensormesh's API uses the same format as OpenAI's. Set `base_url` to `https://serverless.tensormesh.ai`, swap in your Tensormesh API key, and nothing else changes. |
| **API Key** | A secret token included in every request so Tensormesh knows who you are. Generate one under **Management → Account → API Keys**. Treat it like a password. |
# Hermes Agent on Tensormesh
Source: https://inference.docs.tensormesh.ai/hermes-agent
Drive open-weight models with stock Hermes Agent against Tensormesh — install, answer the first-launch wizard once, and chat.
Get stock [Hermes Agent](https://github.com/NousResearch/hermes-agent) — Nous Research's open-source (MIT) personal agent, and the #1 app on OpenRouter — driving open-weight models against Tensormesh in about 5 minutes. Hermes treats custom OpenAI-compatible endpoints as first-class providers — and that's exactly what Tensormesh serves at `https://serverless.tensormesh.ai/v1`. No proxy, no code changes — install, answer the setup wizard once, and chat. Every model in the [supported models](#supported-models) table passes the full Hermes flow (chat + tool use); `deepseek-ai/DeepSeek-V4-Flash` is the recommended default.
## Quick Links
Create your Tensormesh account with Google or GitHub.
Generate an `ak-...` key under **Profile → API keys**.
`curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash`
Matrix of Hermes-ready models on Tensormesh serverless.
Email [saas-support@tensormesh.ai](mailto:saas-support@tensormesh.ai) for help.
## TL;DR
Two commands — the first-launch wizard does the rest:
```bash theme={null}
# Step 1 — install Hermes Agent (macOS/Linux; see Prerequisites for Windows)
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
# Step 2 — run it; the wizard opens on first launch
hermes
```
Answer the wizard like this (full walkthrough in [Setup](#setup)):
1. *How would you like to set up Hermes?* → **Full setup** (not *Quick Setup*, which wires you to Nous Portal)
2. *Select provider* → **Custom endpoint (enter URL manually)**
3. *API base URL* → `https://serverless.tensormesh.ai/v1`
4. *API key* → your `ak-...` key
5. *API compatibility mode* → **Chat Completions**
6. *Select model* → `deepseek-ai/DeepSeek-V4-Flash` (the wizard lists every model live from the endpoint)
7. *Context length* → leave blank (auto-detected from the endpoint)
8. *Display name* → `Tensormesh`
9. Everything else (terminal backend, tools, messaging, browser/image/TTS/search providers) → keep defaults / **Skip**
The wizard drops you into a chat session running on Tensormesh. That's the whole setup.
## Prerequisites
* **Hermes Agent** installed via the install script above (macOS/Linux), `iex (irm https://hermes-agent.nousresearch.com/install.ps1)` (Windows PowerShell), or the [git-clone path](https://github.com/NousResearch/hermes-agent) (`./setup-hermes.sh` installs uv, creates the venv, and symlinks `~/.local/bin/hermes`). Verified against Hermes Agent `v0.16.0`.
* **A Tensormesh account** with an API key (`ak-...`). [Sign up](https://app.tensormesh.ai/login), then visit [Profile → API keys](https://app.tensormesh.ai/profile?tab=api).
* **A model with ≥ 64K context.** Hermes requires at least 64,000 tokens of context and rejects smaller windows when the agent initializes (the first turn on that model). Every model in the [supported models](#supported-models) table clears this bar; a few Tensormesh models don't (see the note below the table).
You do **not** need a Nous Portal subscription, an OpenRouter key, or any OAuth login. Hermes's custom-endpoint provider reads the base URL and API key you give it; the Portal/OAuth flows are for Nous-hosted and first-class cloud providers only.
You do **not** need to run any local infrastructure. Tensormesh serves the OpenAI-compatible `/v1/chat/completions` wire server-side, so stock `hermes` pointed at `serverless.tensormesh.ai/v1` is the complete setup.
## Supported models
Hermes drives 40+ tools through OpenAI-style tool calling. Every model below passes the full Hermes flow — chat + multi-step tool use — against Tensormesh serverless, verified with Hermes Agent v0.16.0 on the chat-completions wire.
| Model | Hermes status | Notes |
| ----------------------------------------- | ----------------- | ---------------------------------------------------------- |
| `deepseek-ai/DeepSeek-V4-Flash` | ✓ chat + tool use | **Recommended default**; reasoning + tools, **1M context** |
| `openai/gpt-oss-120b` | ✓ chat + tool use | Reasoning + tools, 128K context |
| `openai/gpt-oss-20b` | ✓ chat + tool use | Reasoning + tools, 128K context |
| `Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8` | ✓ chat + tool use | Coding-tuned, 256K context |
| `Qwen/Qwen3.5-397B-A17B-FP8` | ✓ chat + tool use | Reasoning + tools, 256K context |
| `Qwen/Qwen3.6-27B-FP8` | ✓ chat + tool use | Reasoning + tools, 256K context |
| `lukealonso/GLM-5.1-NVFP4-MTP` | ✓ chat + tool use | Reasoning + tools, 198K context |
| `MiniMaxAI/MiniMax-M2.5` | ✓ chat + tool use | Reasoning + tools, 192K context |
**Choosing a default:** `deepseek-ai/DeepSeek-V4-Flash` combines the largest context window in the catalog (1M tokens) with reasoning support at a very low price — the best model to start with, and the one that keeps long agentic sessions farthest from compaction. `openai/gpt-oss-20b` is the cheapest model in the catalog; for heavier reasoning, `lukealonso/GLM-5.1-NVFP4-MTP` and `MiniMaxAI/MiniMax-M2.5` are the strongest options; for coding-centric sessions, reach for `Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8` (256K).
**Below Hermes's 64K minimum** (served by Tensormesh, but rejected by Hermes): `moonshotai/Kimi-K2.6` (32K), `google/gemma-4-31B-it` (32K). Hermes lets you *select* these, then fails on the next turn with `Failed to initialize agent: ... below the minimum 64,000 required by Hermes Agent`. The error suggests a `model.context_length` override, but overstating a model's real window just trades the startup error for mid-session context overruns — not recommended.
## Setup
The wizard path from the TL;DR, with detail on each prompt.
```bash theme={null}
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
```
This installs the `hermes` command (symlinked into `~/.local/bin`). Verify with `hermes doctor`.
```bash theme={null}
hermes
```
The first launch opens the setup wizard. Choose **Full setup** — *Quick Setup* runs the Nous Portal OAuth flow and wires Hermes to Nous-hosted models, not Tensormesh. Then:
* **Select provider**: **Custom endpoint (enter URL manually)** — near the bottom of the list, not "custom (direct API)".
* **API base URL**: `https://serverless.tensormesh.ai/v1`. The wizard probes the endpoint with your key and confirms with `Verified endpoint ... (N model(s) visible)`. If that line errors instead, fix the key before continuing.
* **API key**: your `ak-...` key. Don't have one? [Generate it in your profile](https://app.tensormesh.ai/profile?tab=api).
* **API compatibility mode**: **Chat Completions**.
* **Select model**: the wizard lists every model live from the endpoint — pick `deepseek-ai/DeepSeek-V4-Flash`, or type any slug from the [table](#supported-models).
* **Context length in tokens**: leave blank. Auto-detect works against Tensormesh — the endpoint publishes `context_length` in `/v1/models` and Hermes resolves it correctly.
* **Display name**: `Tensormesh` (cosmetic — shown in the `/model` picker and session footers).
* **Remaining sections** (terminal backend, tools, messaging platforms, browser/image/TTS/search providers): keep defaults or **Skip**. The *Local* terminal backend runs commands on your machine with per-command approval prompts; pick *Docker* instead if you want container isolation. Hermes's multimodal tools (vision, image generation, TTS) route to separate *auxiliary* providers, not your main model — Tensormesh serves text-only models, so those tools have no backend unless you configure auxiliaries; they fail only if invoked.
The wizard persists everything — endpoint, API key, model, and wire mode — to the `model:` section of `~/.hermes/config.yaml`, then drops you into a chat session. Re-run just the provider part anytime with `hermes model`.
### Manual configuration (alternative)
Use this to script a setup or change an existing install. On a fresh machine, the first `hermes` launch opens the wizard regardless, so the wizard path above is usually the one you want.
Edit the `model:` section of `~/.hermes/config.yaml` — this is exactly the shape the wizard writes (merge if the section already exists; YAML keys must be unique):
```yaml theme={null}
model:
default: deepseek-ai/DeepSeek-V4-Flash
provider: custom
base_url: https://serverless.tensormesh.ai/v1
api_key: ak-...
api_mode: chat_completions
```
`context_length` is optional — Hermes resolves each model's window from the endpoint automatically; set it only to override. The wizard also writes a `custom_providers:` entry (next tab); add one if you want the endpoint listed by name in the `/model` picker.
The wizard also registers the endpoint as a named custom provider — `name` comes from the display name you chose:
```yaml theme={null}
custom_providers:
- name: Tensormesh
base_url: https://serverless.tensormesh.ai/v1
api_key: ak-...
model: deepseek-ai/DeepSeek-V4-Flash
api_mode: chat_completions
```
This is what makes the endpoint appear by name in the `/model` picker. If you manage multiple custom endpoints (a local vLLM, a corp proxy), add more entries — and you can replace `api_key` with `key_env: TENSORMESH_INFERENCE_API_KEY` to keep the key in your environment instead of the config file.
## Usage
```bash theme={null}
hermes # Interactive TUI — start a conversation
hermes model # Provider/model setup wizard (add or change endpoints)
hermes tools # Configure which of the 40+ tools are enabled
hermes doctor # Diagnose installation and configuration issues
hermes update # Update to the latest version
```
### Switching models
Two different surfaces, easy to confuse:
* **`hermes model`** (terminal, outside a session) — the full wizard. Use it to add providers, enter keys, and configure custom endpoints.
* **`/model`** (inside a chat session) — switches between models you've already configured. Bare `/model` opens an interactive picker — the Tensormesh endpoint appears under its display name with all models live-fetched from `/v1/models`. Or pass the slug directly:
```
/model Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8 # coding-tuned, 256K
/model lukealonso/GLM-5.1-NVFP4-MTP # GLM 5.1, 198K
/model # interactive picker
```
Mid-session switches are **session-only** — append `--global` to persist the new default to `config.yaml` (Hermes prints a reminder either way). Hermes re-resolves the model's context window from the endpoint on each switch, and conversation history, memory, and skills carry over. (The `custom:`-prefixed forms in Hermes's own docs also work; Hermes auto-corrects them to the bare slug.)
### Command approval
Hermes prompts before executing shell commands by default, with an allowlist for patterns you approve permanently. Keep the default prompting behavior for unfamiliar tasks; manage the allowlist via Hermes's security settings rather than disabling approval globally.
## Hermes Desktop
[Hermes Desktop](https://hermes-agent.nousresearch.com/docs/user-guide/desktop) (macOS, Windows, Linux) is a native app built around the same agent as the CLI — same `~/.hermes/config.yaml`, same API keys, sessions, and skills. If you've completed the [Setup](#setup) above, Tensormesh is already configured when you install the app — nothing extra to do. Verified against Desktop v0.16.0.
* Switch models from the selector at the **bottom-right of the chat window**, or manage the endpoint under **Settings → Providers** — the app surfaces the same Tensormesh models the CLI sees.
* Installing Desktop first, without the CLI setup? Configure Tensormesh per [Setup](#setup) — Desktop reads and writes the same config file, so either surface works.
## Troubleshooting
| Symptom | Likely cause | Fix |
| --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `command not found: hermes` | `~/.local/bin` not on `PATH`, or install incomplete | Re-run the install script; ensure `export PATH="$HOME/.local/bin:$PATH"` is in your shell rc. |
| `Failed to initialize agent: Model has a context window of N tokens, which is below the minimum 64,000 required by Hermes Agent` | Model window below Hermes's 64K floor (enforced on the first turn, not at selection time) | Pick a ≥ 64K model from the [table](#supported-models). The suggested `model.context_length` override works but invites mid-session context overruns. |
| HTTP 500 from the endpoint on every request | Most often an **invalid API key** — Tensormesh surfaces auth failures as 5xx | Probe with a request that exercises auth (`/v1/models` is public, so it can't validate a key): `curl -sS -X POST -H "Authorization: Bearer " -H "Content-Type: application/json" -d '{"model":"deepseek-ai/DeepSeek-V4-Flash","max_tokens":5,"messages":[{"role":"user","content":"hi"}]}' https://serverless.tensormesh.ai/v1/chat/completions` — HTTP 500 means the key is bad; [generate a fresh one](https://app.tensormesh.ai/profile?tab=api). |
| `Model not found` | Wrong model slug | Check spelling against the [table](#supported-models) — slugs are case-sensitive. |
| Tool calls loop or come back malformed | Model-specific tool-calling quality | Switch to `openai/gpt-oss-120b` (a known-good baseline); if it persists there, report it to us. |
Still stuck? Run `hermes doctor`, then email [saas-support@tensormesh.ai](mailto:saas-support@tensormesh.ai) with the doctor output and the failing model slug.
## Rollback / uninstall
To remove Tensormesh from your Hermes setup:
1. Run `hermes model` and select a different provider, **or** delete the Tensormesh `model:` block from `~/.hermes/config.yaml`.
2. Delete the `custom_providers:` entry named `Tensormesh` as well — your API key is stored in both places. (If you swapped in `key_env`, also unset `TENSORMESH_INFERENCE_API_KEY`.)
Hermes itself is untouched — it falls back to whatever provider you select next.
# Welcome to Tensormesh Inference
Source: https://inference.docs.tensormesh.ai/introduction-tensormesh
The AI inference platform for application and agent developers.
Tensormesh helps developers build faster, lower-cost AI applications by caching and reusing repeated context across requests. For agents, RAG systems, copilots, and multi-turn assistants, the same instructions, documents, tools, and conversation history often get processed again and again. Tensormesh uses KV caching to reuse that work automatically, reducing redundant computation and improving response latency.
***
## What You Can Do
Avoid paying to process the same context again and again. Tensormesh reuses cached context across repeated requests — cached tokens are always \$0.
Skip redundant prefill work so agents, copilots, and RAG apps can respond faster. Cached prefixes return instantly with no recomputation.
Start with serverless APIs for instant access with no setup. Move to reserved GPU clusters when you need dedicated capacity or compliance requirements.
***
## Core Technology: KV Caching
Tensormesh is built on KV caching. Instead of recomputing repeated prompts, documents, tools, and conversation history, Tensormesh stores reusable model state and serves it again when similar context appears. That means less GPU waste, faster responses, and more efficient AI applications at scale.
| | What happens | What you pay |
| ----------------------- | ------------------------------------------------------- | ------------------------- |
| **First request** | Input tokens are computed and stored in the KV cache | Standard input token rate |
| **Subsequent requests** | Matching tokens are served from cache, no recomputation | \$0.00 per cached token |
The longer and more consistent your shared context, the lower your effective cost. A 2,000-token system prompt reused across 10,000 daily requests saves the cost of 20 million input tokens.
***
## Coding Agents
Tensormesh powers some of the most capable open-weight coding agents available. Use any serverless model as the backend for Claude Code or Codex CLI:
Run Claude Code backed by Tensormesh serverless inference. Point it at any supported open-weight model and start building — no changes to your existing Claude Code workflow.
Drive open-weight models with OpenAI Codex CLI using Tensormesh as the inference provider. OpenAI-compatible API means zero configuration changes.
***
## Explore the Docs
Model catalog, per-token pricing, and quickstart examples.
When to use dedicated capacity and how to request a cluster.
Plan tiers, usage monitoring, and how persistent caching affects your costs.
How token pricing works and how to structure prompts to maximize cache hits.
Per-model token counts, cache hit rates, and cost breakdown.
Dollar value of your KV cache hits over time.
# Observability
Source: https://inference.docs.tensormesh.ai/observability
Per-model LMCache metrics for your serverless inference — cache hit rates, token flows, and L2 storage throughput.
Navigate to **Operations → Observability** to monitor real-time LMCache metrics across your serverless models.
***
## What You'll See
The Observability dashboard shows one chart per metric, with a separate series for each model you have serverless usage on. Use the model filter to narrow down to specific models, and the time range selector to zoom in or out.
### Request Performance
| Metric | What it shows |
| ----------------------- | ---------------------------------------------------------------- |
| **Time to First Token** | Average time from request submission to the first token returned |
| **Input Throughput** | Prompt tokens processed per second across your requests |
| **Output Throughput** | Generated tokens per second across your requests |
### Cache Performance
| Metric | What it shows |
| ------------------------- | ------------------------------------------------------------------------------------------ |
| **Cache Hit Rate** | Fraction of tokens served from the LMCache (L1 CPU cache or L2 External Storage) at \$0.00 |
| **Cache Hit Tokens** | Total token count served from cache in each interval |
| **CPU Read Tokens** | Tokens loaded from CPU memory into the inference engine |
| **CPU Write Tokens** | Tokens written to CPU memory by the inference engine |
| **CPU Evict Tokens** | Tokens evicted from CPU memory to make room for new entries |
| **Storage to CPU Tokens** | Tokens promoted from External Storage (L2) into CPU memory (L1) |
| **Storage Write Tokens** | Tokens written from CPU memory out to External Storage |
| **Storage Evict Tokens** | Tokens evicted from External Storage |
Chunk-based metrics (CPU reads, writes, evicts; Storage reads, writes, evicts) are displayed in tokens — each internal LMCache chunk equals 256 tokens.
***
## Request Performance Metrics
Time to First Token, Input Throughput, and Output Throughput give you a direct view of inference speed independent of caching:
* **Time to First Token (TTFT)** — how long your users wait before the model begins responding. Lower is better; a rising TTFT under stable load often signals GPU contention or queue buildup.
* **Input Throughput** — prompt tokens processed per second. Higher values mean the model is prefilling efficiently. A sudden drop can indicate the model is under heavy concurrent load.
* **Output Throughput** — generated tokens per second. This is the primary driver of streaming response speed perceived by end users.
These metrics are measured per request across all models you have active serverless usage on, and shown as an average over each time interval.
***
## Exporting Data
Click **Export CSV** to download the currently visible metrics for all selected models and the active time range. The export includes:
* Model name
* Time to First Token (avg)
* Input Throughput (avg)
* Output Throughput (avg)
* Cache Hit Rate (avg, min, max)
* Cache Hit Tokens (total)
* CPU Read / Write / Evict Tokens (total)
* Storage to CPU / Storage Write / Storage Evict Tokens (total)
***
## Understanding Cache Hit Rate
Cache Hit Rate is the most important signal for cost efficiency:
* **High hit rate** — a large fraction of your input tokens are being served from cache at \$0.00, meaning your prompts share consistent prefixes across requests.
* **Low hit rate** — most tokens are being recomputed on every request. Common causes: variable system prompts, dynamic content inserted early in the prompt, or short sessions that don't benefit from cross-session caching.
See [Cache Savings](/cache-savings) for strategies to improve hit rate.
***
## L2 (External Storage) Metrics
The Storage to CPU, Storage Write, and Storage Evict metrics only appear if you have an [External Storage](/external-storage) subscription active. They show how your L2 bucket is being used:
* **Storage to CPU** — tokens being promoted from your persistent bucket into active CPU cache. High values here mean your cross-session cache is being hit.
* **Storage Write** — tokens being persisted to your bucket for future sessions.
* **Storage Evict** — tokens being dropped from your bucket (bucket full or TTL expired).
If Storage Evict is consistently high relative to Storage Write, your bucket may be undersized for your workload. Consider upgrading your External Storage plan.
***
## Related
* [External Storage](/external-storage)
* [Cache Savings](/cache-savings)
* [Serverless Usage](/serverless-usage)
* [Pricing Overview](/pricing-overview)
# Pricing Overview
Source: https://inference.docs.tensormesh.ai/pricing-overview
Transparent, usage-based pricing aligned with your success
Tensormesh uses a transparent, usage-based pricing model designed to align with your success. You only pay for what you use, and our pricing reflects the value you receive.
***
## Serverless Token Pricing
Serverless inference is billed on a **per-token** basis. Each model has three token price tiers:
| Token Type | What It Is | Cost |
| ---------------- | ------------------------------------------------------------- | -------------- |
| **Input Token** | Tokens in your prompt (system message, user message, context) | Per-model rate |
| **Output Token** | Tokens generated in the model's response | Per-model rate |
| **Cached Token** | Input tokens served from Tensormesh's KV cache | **\$0.00** |
**Cached tokens are free.** When Tensormesh serves a token from its KV cache instead of recomputing it, you are not charged. The more your requests share common prefixes — system messages, conversation history, shared context — the higher your cache hit rate and the lower your effective cost.
Current per-model rates are displayed on the **Deploy → Serverless** page. Each model card shows the exact input, output, and cached token price.
***
## How \$0 Cached Tokens Work
Every time you send a request, Tensormesh checks whether the input tokens have already been computed and stored in the KV cache. If they have, those tokens are served instantly — at zero cost to you.
Input tokens are computed and stored in the KV cache. You pay the standard input token rate.
Matching input tokens are served from cache. **You pay \$0** for those tokens.
### What Gets Cached
* System messages and instructions
* Shared conversation prefixes
* Repeated context windows (e.g. long documents passed in every request)
* Common prompt templates
### Maximizing Your Cache Hit Rate
Keep your system prompt identical across requests. Even a single character change creates a cache miss. Use a fixed template and only vary the user message.
Structure prompts so that the content that changes least (system prompt, static context) comes before content that varies (the user's latest message). The cache matches from the start of the prompt.
Implement shared prompt templates across your application. Consistent prefixes across different users or sessions all benefit from the same cached tokens.
Check your cache hit rate under **Operations → Serverless Usage**. If it's low, look for variability in the early parts of your prompts — that's where cache misses happen.
***
## External Storage
By default, the KV cache is in-memory and scoped to a single request window. **External Storage** extends the cache to a persistent bucket that survives across requests, sessions, and even across different users in your application.
External Storage is available as a paid subscription tier. Navigate to **Operations → Storage** to view plans and subscribe.
### What External Storage Does
Without external storage, every new session starts cold — tokens that were cached in a previous session need to be recomputed. With a storage bucket, that context is persisted.
Cache entries survive beyond a single request window. Long system prompts and shared context are stored across sessions.
Users returning to an existing conversation, or requests sharing a common prefix, all benefit from cached tokens — even hours later.
New sessions that share context with previous ones skip recomputation entirely, reducing time-to-first-token.
Once your bucket is active, caching is handled transparently. No changes to your API calls required.
### Storage Tiers
Storage plans are tiered by bucket size. A **free tier (0 GB)** is available by default — you only pay when you subscribe to a plan.
| Plan | Best For |
| ---------- | ----------------------------------------------------------------- |
| **Bronze** | Getting started — low to moderate request volume |
| **Silver** | Agentic developers — more headroom for parallel workloads |
| **Gold** | Production-scale inference — high volume and large system prompts |
Subscribe or change plans anytime under **Operations → Storage**. Billing adjusts immediately — no data is lost when upgrading.
***
## Billing Details
Monthly billing cycles with detailed usage reports
Real-time cost visibility under Operations → Serverless Usage
Per-model breakdown of input, output, and cached token counts
Flat monthly rate per storage tier, billed separately from token usage
***
## Frequently Asked Questions
Yes. When a token is served from the KV cache, the cached token price is \$0.00. You are only charged the standard input token rate for tokens that need to be freshly computed.
Navigate to **Operations → Serverless Usage** to see your input, output, and cached token counts per model and per period.
No. In-memory caching is active by default and cached tokens are always \$0.00. External Storage extends caching across sessions and increases your cache hit rate, but it is not required to benefit from \$0 cached tokens.
You pay only the standard input and output token rates. There are no additional charges. A 0% cache hit rate just means you're not saving anything yet — structuring prompts with consistent prefixes is the fastest way to improve it.
No. You pay per token for serverless inference plus an optional flat monthly rate for External Storage. No setup fees, no minimums, no per-request overhead.
Check the per-model rates on the **Deploy → Serverless** page, estimate your input and output token counts, and factor in your expected cache hit rate. Your Serverless Usage history is a good baseline for projecting future spend.
# Quickstart
Source: https://inference.docs.tensormesh.ai/quickstart
Go from zero to your first inference call in under 5 minutes.
## 1. Create Your Account
Sign up at [app.tensormesh.ai](https://app.tensormesh.ai) using Google or GitHub.
***
## 2. Add a Payment Method
Navigate to **Management → Billing → Payment Methods** in the sidebar.
Click **Add Payment Method** and enter your card details.
***
## 3. Get Your API Key
Navigate to **Management → Account → API Keys** tab. Use the **Copy** icon to grab your key for programmatic access.
Treat your API key like a password. Never share it publicly or commit it to version control.
***
## 4. Make Your First API Call
The serverless API is OpenAI-compatible. Use the endpoint `https://serverless.tensormesh.ai` with your Tensormesh API key.
```bash theme={null}
curl --request POST \
--url https://serverless.tensormesh.ai/v1/chat/completions \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMaxAI/MiniMax-M2.5",
"max_tokens": 16384,
"temperature": 0.6,
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"top_p": 1,
"top_k": 40,
"presence_penalty": 0,
"frequency_penalty": 0
}'
```
```python theme={null}
import requests
url = "https://serverless.tensormesh.ai/v1/chat/completions"
payload = {
"model": "MiniMaxAI/MiniMax-M2.5",
"max_tokens": 16384,
"temperature": 0.6,
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"top_p": 1,
"top_k": 40,
"presence_penalty": 0,
"frequency_penalty": 0
}
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
```
Install the [Tensormesh Python SDK](/sdk/index) (`pip install tensormesh`), then:
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatMessage
with Tensormesh(inference_api_key="YOUR_API_KEY") as client:
completion = client.inference.serverless.chat.completions.create(
model="MiniMaxAI/MiniMax-M2.5",
messages=[
ChatMessage(role="user", content="Hello, how are you?"),
],
)
print(completion.choices[0].message.content)
```
For the full model list and per-model pricing, go to **Deploy → Serverless** in the dashboard.
***
## 5. Enable External Storage (Optional)
By default, the KV cache only lasts for a single session. External Storage persists your cache across sessions and users — so repeated system prompts and shared context stay warm and cost nothing on return visits.
Navigate to **Operations → Storage** in the sidebar.
Subscribe to a Bronze, Silver, or Gold plan depending on your cache volume needs. Billing starts immediately and you can upgrade or downgrade at any time.
See [External Storage](/external-storage) for a full breakdown of plan tiers and how persistent caching affects your costs.
***
## Next Steps
Full model catalog, per-token pricing, and capability details.
How \$0 cached tokens work and how to structure prompts to maximize savings.
Plan tiers, usage monitoring, and how persistent caching affects your costs.
Manage your API keys, notification preferences, and profile settings.
# Reserved Deployments
Source: https://inference.docs.tensormesh.ai/reserved-deployments
Dedicated GPU clusters for high-volume production workloads and enterprise-grade inference.
Reserved Deployments provide dedicated GPU clusters tailored to your specific infrastructure needs — guaranteed capacity, consistent performance, and no resource contention.
Navigate to **Deploy → Reserved** to submit a request.
***
## When To Use Reserved
Workloads that require consistent throughput at a scale where serverless costs exceed a flat cluster rate.
Applications with strict latency requirements that need dedicated, non-shared GPU resources.
Deployments that require data isolation, custom networking, or specific compliance guarantees.
A flat cluster rate replaces variable per-token billing — easier to budget at scale and priced to your specific workload and capacity requirements.
***
## Pricing
Reserved deployments start from **\$250k / year**. A 20% deposit is required upfront to reserve your nodes, and pricing is locked for the full contract term.
Nodes are allocated exclusively to your account and not shared with other tenants.
Pricing is fixed for the duration of your contract term.
Uptime guarantee backed by a formal SLA agreement.
***
## Requesting a Cluster
Submit a request through the form at **Deploy → Reserved**.
**Contact Info**
**Full Name** — Your name (pre-filled from your profile)\
**Work Email** — Your business email address\
**Company** — Your organization name\
**Job Title** — Your role (optional)
**Cluster Requirements**
**Preferred GPU** — Choose from NVIDIA H200 or NVIDIA B200\
**Total GPUs Needed** — Capacity is reserved in full nodes of 8 GPUs each; select 8 (1 node), 16 (2 nodes), or 24 (3 nodes)\
**Contract Length** — Choose a 1-year (12 months) or 2-year (24 months) term; pricing is locked for the full duration\
**Workload / Use Case** — Select the primary workload type: Inference / Serving, RAG / Retrieval-Augmented Apps, Agentic / Tool-Using Systems, or Other
Use the **Networking / Storage** field to describe bandwidth targets, storage needs, or interconnect preferences. Use **Other Notes** for compliance requirements, SLA expectations, or anything else the team should know.
***
## What Happens Next
Fill out the form with your GPU and workload requirements and click **Submit Request**.
Our team reviews your needs and follows up within 1 business day with a custom proposal.
Once the contract is signed and deposit received, we spin up your dedicated cluster.
***
## Not Ready for Reserved?
Start with [Serverless Inference](/serverless-inference) — instant access, pay-per-token, no setup required. Serverless is suitable for most development and production API workloads. Move to reserved when volume or latency requirements exceed what serverless offers.
You can also reach us directly via **Management → Contact Us** to discuss your capacity needs before submitting a formal request.
# Auth And Config
Source: https://inference.docs.tensormesh.ai/sdk/guides/auth-and-config
Understand Tensormesh SDK auth, environment variables, and the difference between serverless and control-plane usage.
The SDK keeps auth and routing explicit. It does not read CLI config files by default.
The public inference surface exposes `chat.completions`, `models`, `completions`, `responses`, `tokenize`, `detokenize`, `health`, and `version`.
The SDK resolves configuration in this order:
1. constructor arguments
2. environment variables
3. built-in defaults
## Surface Boundaries
* **Control Plane**
* auth: bearer token
* client namespace: `client.control_plane`
* **Serverless inference**
* auth: inference API key for POST routes; the default public host also serves `models`, `health`, and `version` without one
* client namespace: `client.inference.serverless`
* extra namespaces: `models`, `completions`, `responses`, `tokenize`, `detokenize`, `health`, and `version`
* model value: serverless model name
## Get Credentials
* For a Control Plane bearer token, use [CLI Authentication](/cli/guides/authentication). The CLI browser flow stores the token locally, and `tm auth print-token --yes-i-know` can print it for a controlled SDK setup when you need it outside the CLI.
* For an inference API key, either use the key your Tensormesh environment already issued to you, or create one through the authenticated workflow:
```sh theme={null}
tm auth login
USER_ID="$(tm --output json auth whoami | python3 -c 'import json,sys; print(json.load(sys.stdin)["user"]["id"])')"
tm users api-keys create --user-id "$USER_ID" --name sdk-key --yes
```
If your environment does not expose self-serve API key creation, ask your operator or admin for the exact inference API key to use.
* If you only have inference credentials, you can still use the serverless SDK surface without Control Plane login.
If you are coming from the CLI-managed flow, `gateway_api_key` in `config.toml` is the stored inference API key used by the SDK as `inference_api_key`.
## Environment Variables
The SDK supports these environment variables:
* `TENSORMESH_CONTROL_PLANE_TOKEN`
* `TENSORMESH_CONTROL_PLANE_BASE_URL`
* `TENSORMESH_INFERENCE_API_KEY`
* `TENSORMESH_SERVERLESS_BASE_URL`
* `TENSORMESH_TIMEOUT_SECONDS`
* `TENSORMESH_MAX_RETRIES`
* `TENSORMESH_CA_BUNDLE`
Blank environment-variable values are treated as unset. Explicit constructor
arguments still need to be valid non-empty values.
## Constructor-Based Configuration
```python theme={null}
from tensormesh import Tensormesh
client = Tensormesh(
control_plane_token="YOUR_CONTROL_PLANE_TOKEN",
inference_api_key="YOUR_INFERENCE_API_KEY",
timeout=30,
max_retries=2,
)
```
`max_retries` applies to idempotent HTTP methods. The main inference calls on this SDK surface are POST requests such as `/v1/chat/completions`, `/v1/completions`, `/v1/responses`, `/tokenize`, and `/detokenize`, so those requests are not retried automatically.
## Environment-Based Configuration
```sh theme={null}
export TENSORMESH_CONTROL_PLANE_TOKEN="YOUR_CONTROL_PLANE_TOKEN"
export TENSORMESH_INFERENCE_API_KEY="YOUR_INFERENCE_API_KEY"
```
```python theme={null}
from tensormesh import Tensormesh
client = Tensormesh()
```
## When To Use CLI Login
The SDK does not require `tm auth login`.
* **Production deployments and CI environments**: supply credentials through environment variables (`TENSORMESH_INFERENCE_API_KEY`, `TENSORMESH_CONTROL_PLANE_TOKEN`, etc.). No browser interaction is required.
* **Local development**: use `tm auth login` for the browser-based Control Plane auth flow when you want the CLI to store and manage the token locally.
## Common Mistakes
* trying to use a control-plane bearer token for inference
* assuming the SDK reads `~/.config/tensormesh/` automatically
## Related Guides
* [Getting Started](/sdk/guides/getting-started)
* [Inference](/sdk/guides/inference)
* [Control Plane](/sdk/guides/control-plane)
# Control Plane
Source: https://inference.docs.tensormesh.ai/sdk/guides/control-plane
Use the Tensormesh Python SDK for users, billing, support, observability, and pagination-aware workflows.
Use the Control Plane SDK surface when you are managing Tensormesh resources instead of sending inference requests.
Common tasks include:
* reading the current user profile or API keys
* checking balance, transactions, and support tickets
* accessing admin or observability APIs from application code
The control-plane SDK surface lives under `client.control_plane`.
Use it with a control-plane bearer token:
```python theme={null}
from tensormesh import Tensormesh
client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")
```
When you compare this guide to the generated Control Plane reference, remember that some mixed resource families include both standard and admin routes, and some internal-only routes such as Stripe webhook delivery are intentionally omitted from the public SDK surface.
## Start With Common Read-Only Tasks
```python theme={null}
from tensormesh import Tensormesh
client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")
profile = client.control_plane.users.get_auth_profile()
api_keys = client.control_plane.users.api_keys.list()
print(profile.display_name)
print([item.name for item in api_keys])
```
## Check Billing And Support
```python theme={null}
from tensormesh import Tensormesh
client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")
balance = client.control_plane.billing.balance.get()
tickets = client.control_plane.support.tickets.list(size=20)
print(balance.units if balance is not None else "0")
print([ticket.subject for ticket in tickets.tickets])
```
## Stripe Billing Flows
```python theme={null}
from tensormesh import Tensormesh
client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")
customer = client.control_plane.billing.stripe.customer.get_or_create()
payment_methods = client.control_plane.billing.stripe.payment_methods.list()
setup_intent = client.control_plane.billing.stripe.setup_intents.create()
print(customer.stripe_customer_id)
print(payment_methods.stripe_payment_method_ids)
print(setup_intent.client_secret)
```
## Auto-Pagination
Use `auto_paging_iter(...)` on paged resources when you want items instead of manual page handling.
```python theme={null}
from tensormesh import Tensormesh
client = Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN")
for transaction in client.control_plane.billing.transactions.auto_paging_iter(
page_size=100,
):
print(transaction.transaction_id, transaction.amount)
```
## Async Control Plane Usage
```python theme={null}
import asyncio
from tensormesh import AsyncTensormesh
async def main() -> None:
async with AsyncTensormesh(
control_plane_token="YOUR_CONTROL_PLANE_TOKEN",
) as client:
tickets = await client.control_plane.support.tickets.list(size=20)
print([ticket.subject for ticket in tickets.tickets])
asyncio.run(main())
```
## Related Guides
* [Getting Started](/sdk/guides/getting-started)
* [Auth And Config](/sdk/guides/auth-and-config)
* [Inference](/sdk/guides/inference)
## Related Reference
Use the **Control Plane API** tab in the docs navigation for generated management API reference.
# Getting Started
Source: https://inference.docs.tensormesh.ai/sdk/guides/getting-started
Make a first successful Tensormesh SDK request with the sync or async client.
This is the shortest SDK-first path to a working request.
The public inference surface exposes `chat.completions`, `models`, `completions`, `responses`, `tokenize`, `detokenize`, `health`, and `version`.
## 1. Install The Package
Prerequisite: Python `3.12` or newer.
For a published release:
```sh theme={null}
pip install tensormesh
```
## 2. Pick A Surface
* **Serverless inference**: use `client.inference.serverless`
* **Control Plane**: use `client.control_plane`
Inference usually uses an inference API key. On the default public serverless host, `models`, `health`, and `version` also work without one. Control Plane uses a bearer token.
For a first successful SDK request, start with serverless inference.
Model naming: serverless examples expect a serverless model name.
If you are coming from the CLI-managed flow, `gateway_api_key` is the stored inference API key used by the SDK as `inference_api_key`.
## 3. Get Credentials
* For a Control Plane bearer token, use the browser login flow in [CLI Authentication](/cli/guides/authentication), then use `tm auth print-token --yes-i-know` only in a controlled shell when you need to pass that token into SDK code.
* For an inference API key, either use the key your Tensormesh environment already issued to you, or create one through the authenticated Control Plane flow:
```sh theme={null}
tm auth login
USER_ID="$(tm --output json auth whoami | python3 -c 'import json,sys; print(json.load(sys.stdin)["user"]["id"])')"
tm users api-keys create --user-id "$USER_ID" --name sdk-key --yes
```
If your environment does not expose self-serve API key creation, ask your operator or admin for the exact inference API key to use.
## 4. Choose A Model Name
* Pass a serverless model name that is valid for the selected serverless host.
* If you have Control Plane access for the same Tensormesh environment, discover published serverless models with `tm billing pricing serverless list`.
* Use the returned `pricing[].model` value as the `model` argument.
* If you only have inference credentials, or you are targeting a different serverless host override, ask your operator or admin for the exact serverless `model` string for that host before sending the request.
If you do not already have a valid serverless model name, resolve it before using the serverless examples below. The supported paths are `tm billing pricing serverless list` for the same Tensormesh environment, or asking your operator or admin for the exact serverless `model` string.
## 5. First Sync Request
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatMessage
with Tensormesh(
inference_api_key="YOUR_INFERENCE_API_KEY",
) as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
completion = client.inference.serverless.chat.completions.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="Say hello.")],
)
print(completion.choices[0].message.content)
```
## 6. First Async Request
```python theme={null}
import asyncio
from tensormesh import AsyncTensormesh
from tensormesh.types import ChatMessage
async def main() -> None:
async with AsyncTensormesh(
inference_api_key="YOUR_INFERENCE_API_KEY",
) as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
completion = await client.inference.serverless.chat.completions.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="Say hello.")],
)
print(completion.choices[0].message.content)
asyncio.run(main())
```
## 7. First Control-Plane Request
```python theme={null}
from tensormesh import Tensormesh
with Tensormesh(control_plane_token="YOUR_CONTROL_PLANE_TOKEN") as client:
profile = client.control_plane.users.get_auth_profile()
print(profile.display_name)
```
## Next Steps
* If you are deciding which credentials and base URLs to use, continue with [Auth And Config](/sdk/guides/auth-and-config).
* If you want chat completions plus the other verified serverless endpoints, continue with [Inference](/sdk/guides/inference).
* If you are migrating an existing OpenAI or Fireworks chat integration, continue with [Migration From OpenAI And Fireworks](/sdk/guides/migration-from-openai-fireworks).
* If you want models, billing, users, or support examples, continue with [Control Plane](/sdk/guides/control-plane).
* If you want the CLI operator path for Control Plane tasks, continue with [Control Plane Workflows](/cli/guides/control-plane-workflows).
## Related Reference
* [Raw Inference API Reference](/api-reference)
* [Control Plane API Reference](/tensormesh-api)
* [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list)
Use the **Control Plane API** tab in the docs navigation for generated Control Plane reference.
# Inference
Source: https://inference.docs.tensormesh.ai/sdk/guides/inference
Use Tensormesh serverless inference endpoints from the Python SDK, including streaming and raw responses.
The SDK exposes the serverless inference surface:
* `client.inference.serverless.chat.completions`
* `client.inference.serverless.models`
* `client.inference.serverless.completions`
* `client.inference.serverless.responses`
* `client.inference.serverless.tokenize`
* `client.inference.serverless.detokenize`
* `client.inference.serverless.health`
* `client.inference.serverless.version`
The public inference surface exposes `chat.completions`, `models`, `completions`, `responses`, `tokenize`, `detokenize`, `health`, and `version`.
Model naming: pass a serverless model name that is valid for the selected host.
If you are coming from the CLI-managed flow, `gateway_api_key` is the stored inference API key used by the SDK as `inference_api_key`.
## Choosing A Model Name
* Choose a serverless model name that is valid for the selected host.
* If you have Control Plane access for the same Tensormesh environment, discover published serverless models with `tm billing pricing serverless list`.
* Use the returned `pricing[].model` value in your request.
* If you only have inference credentials, or you are targeting a different serverless host override, ask your operator or admin for the exact serverless `model` string for that host before sending the request.
If you do not already have a valid serverless model name for your target host, discover it with `tm billing pricing serverless list` for the same Tensormesh environment, or ask your operator or admin for the exact serverless `model` string first.
## Verified Serverless Endpoint Map
* `client.inference.serverless.chat.completions`: OpenAI-compatible chat completions
* `client.inference.serverless.models`: list models from the verified serverless host
* `client.inference.serverless.completions`: text completions
* `client.inference.serverless.responses`: responses API
* `client.inference.serverless.tokenize`: tokenize text
* `client.inference.serverless.detokenize`: convert token ids back to text
* `client.inference.serverless.health`: health endpoint
* `client.inference.serverless.version`: version endpoint
## Serverless Chat Completions
Use a serverless model name here.
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatMessage
with Tensormesh(inference_api_key="YOUR_INFERENCE_API_KEY") as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
completion = client.inference.serverless.chat.completions.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="Say hello.")],
)
print(completion.choices[0].message.content)
```
## Serverless Model Listing
On the default public serverless host, model listing also works without an inference API key.
```python theme={null}
from tensormesh import Tensormesh
with Tensormesh() as client:
models = client.inference.serverless.models.list()
print(models.data[0].id)
```
## Serverless Text Completions
```python theme={null}
from tensormesh import Tensormesh
with Tensormesh(inference_api_key="YOUR_INFERENCE_API_KEY") as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
completion = client.inference.serverless.completions.create(
model=serverless_model_name,
prompt="Reply with ok.",
)
print(completion.choices[0].text)
```
## Serverless Responses
```python theme={null}
from tensormesh import Tensormesh
with Tensormesh(inference_api_key="YOUR_INFERENCE_API_KEY") as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
response = client.inference.serverless.responses.create(
model=serverless_model_name,
input="Say hello.",
)
print(response.output[0].content[0].text)
```
## Tokenize And Detokenize
```python theme={null}
from tensormesh import Tensormesh
with Tensormesh(inference_api_key="YOUR_INFERENCE_API_KEY") as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
tokens = client.inference.serverless.tokenize.create(
model=serverless_model_name,
prompt="Hello!",
)
prompt = client.inference.serverless.detokenize.create(
model=serverless_model_name,
tokens=tokens.tokens,
)
print(tokens.tokens)
print(prompt.prompt)
```
## Health And Version
On the default public serverless host, these routes also work without an inference API key.
```python theme={null}
from tensormesh import Tensormesh
with Tensormesh() as client:
health = client.inference.serverless.health.get()
version = client.inference.serverless.version.get()
print(health.status)
print(version.version)
```
## Streaming On Serverless
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatMessage
with Tensormesh(
inference_api_key="YOUR_INFERENCE_API_KEY",
) as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
stream = client.inference.serverless.chat.completions.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="Stream a short reply.")],
stream=True,
)
for text in stream.text_deltas():
print(text, end="")
```
The text-completions and responses endpoints also support raw SSE access:
```python theme={null}
from tensormesh import Tensormesh
with Tensormesh(
inference_api_key="YOUR_INFERENCE_API_KEY",
) as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
stream = client.inference.serverless.completions.with_streaming_response.create(
model=serverless_model_name,
prompt="Stream a short reply.",
stream=True,
)
try:
for line in stream.iter_lines(decode_unicode=True):
print(line)
finally:
stream.close()
```
## Tool Calling
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatCompletionFunction
from tensormesh.types import ChatCompletionTool
from tensormesh.types import ChatMessage
with Tensormesh(inference_api_key="YOUR_INFERENCE_API_KEY") as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
tools = [
ChatCompletionTool(
function=ChatCompletionFunction(
name="lookup_weather",
description="Look up weather for a city.",
parameters={
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": ["city"],
},
),
)
]
completion = client.inference.serverless.chat.completions.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="What is the weather in Hanoi?")],
tools=tools,
tool_choice="auto",
)
choice = completion.choices[0]
print(choice.message.content)
print(choice.message.tool_calls)
```
Tool-calling caveats on this SDK surface:
* tool calling is documented on the chat-completions surface only
* `text_deltas()` is a text-oriented helper; use `with_streaming_response` if you need raw stream lines for richer event handling
* if your current OpenAI or Fireworks app depends on broader tool-stream semantics, verify the exact wire behavior against your target deployment before migrating
## Structured Output
The currently documented structured-output mode is JSON mode:
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatMessage
from tensormesh.types import ResponseFormat
with Tensormesh(inference_api_key="YOUR_INFERENCE_API_KEY") as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
completion = client.inference.serverless.chat.completions.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="Respond with valid JSON.")],
response_format=ResponseFormat(type="json_object"),
)
print(completion.choices[0].message.content)
```
Structured-output caveats on this SDK surface:
* `response_format.type` currently supports only `json_object` and `text`
* JSON Schema-style `response_format={"type": "json_schema", ...}` is not supported on this surface
* unsupported extra keys inside `response_format` are rejected explicitly by the SDK instead of being silently dropped
* use `client.inference.serverless.responses` when you want the verified serverless responses endpoint instead of chat completions
* if an upstream runtime leaks leading `...` blocks into assistant text, the SDK strips them from `message.content`, stores the extracted text in `message.reasoning` when possible, and `text_deltas()` suppresses those leaked blocks in streamed text output
## Raw Responses
Use raw responses when you want the unwrapped HTTP payload instead of the parsed SDK model.
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatMessage
with Tensormesh(inference_api_key="YOUR_INFERENCE_API_KEY") as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
raw_response = client.inference.serverless.chat.completions.with_raw_response.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="Say hello.")],
)
print(raw_response.json())
```
## Async Streaming Response Access
```python theme={null}
import asyncio
from tensormesh import AsyncTensormesh
from tensormesh.types import ChatMessage
async def main() -> None:
async with AsyncTensormesh(
inference_api_key="YOUR_INFERENCE_API_KEY",
) as client:
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
raw_stream = await client.inference.serverless.chat.completions.with_streaming_response.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="Stream a short reply.")],
stream=True,
)
try:
async for line in raw_stream.iter_lines():
print(line)
finally:
await raw_stream.close()
asyncio.run(main())
```
## Related Guides
* [Auth And Config](/sdk/guides/auth-and-config)
* [Migration From OpenAI And Fireworks](/sdk/guides/migration-from-openai-fireworks)
* [Control Plane](/sdk/guides/control-plane)
## Related Reference
* [Raw Inference API Reference](/api-reference)
* [Raw Serverless Inference Reference](/api-reference/serverless)
* [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list)
# Migration From OpenAI And Fireworks
Source: https://inference.docs.tensormesh.ai/sdk/guides/migration-from-openai-fireworks
What changes when moving an existing OpenAI- or Fireworks-style chat integration onto the current Tensormesh SDK surface.
The current Tensormesh SDK supports the narrowest migration path on the inference side:
* serverless chat completions
* serverless Responses client
* no embeddings client
## Fastest Serverless Migration
If your existing app already uses chat completions, serverless is the closest fit.
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatMessage
client = Tensormesh(inference_api_key="YOUR_INFERENCE_API_KEY")
serverless_model_name = "YOUR_SERVERLESS_MODEL_NAME"
completion = client.inference.serverless.chat.completions.create(
model=serverless_model_name,
messages=[ChatMessage(role="user", content="Say hello.")],
)
print(completion.choices[0].message.content)
```
## What Changes From OpenAI Or Fireworks
* Serverless uses `client.inference.serverless.chat.completions.create(...)`, not `client.chat.completions.create(...)`.
* Serverless also exposes `client.inference.serverless.responses.create(...)` when you want the verified responses surface.
* This SDK does not currently expose embeddings.
* Message content is text-oriented in this SDK surface; multimodal content-part request shapes are not modeled here.
* Structured output is limited to `response_format={"type": "json_object"}` or `ResponseFormat(type="json_object")`. JSON Schema-style `json_schema` response formats are not supported on this surface.
* CLI login state is not read automatically by the Python SDK. Application code must pass credentials explicitly or via the documented SDK environment variables.
## Recommended Decision
* Use serverless for an OpenAI-style chat flow on this SDK surface.
* If you do not already know a valid serverless model name, start with [Choose A Serverless Model Name](/serverless-model-selection) before copying the serverless example.
## Related Guides
* [Getting Started](/sdk/guides/getting-started)
* [Auth And Config](/sdk/guides/auth-and-config)
* [Inference](/sdk/guides/inference)
## Related Reference
* [Raw Inference API Reference](/api-reference)
* [Choose A Serverless Model Name](/serverless-model-selection)
# Tensormesh Python SDK
Source: https://inference.docs.tensormesh.ai/sdk/index
Overview, install guidance, and the main client surfaces for the Tensormesh Python SDK.
The Tensormesh Python SDK is the main application-integration surface for Tensormesh.
Use it when you want to:
* call serverless inference endpoints from Python, including chat completions, `models`, `completions`, `responses`, `tokenize`, `detokenize`, `health`, and `version`
* work with Tensormesh control-plane resources such as models, users, billing, and support
* choose between synchronous and asynchronous clients without changing the overall API shape
The SDK ships in the `tensormesh` Python distribution. The `tm` CLI ships in the same distribution, but the SDK is the better starting point when you are building application code or services.
The public inference surface exposes `chat.completions`, `models`, `completions`, `responses`, `tokenize`, `detokenize`, `health`, and `version`. On the default public serverless host, `models`, `health`, and `version` also work without an inference API key. Embeddings and audio endpoints are not currently exposed on this SDK surface.
For the shortest first-success path, set up serverless inference with an inference API key.
## Prerequisites
Python `3.12` or newer.
## Install
```sh theme={null}
pip install tensormesh
```
## Main Client Surfaces
* `Tensormesh`: synchronous client for scripts, notebooks, and request/response applications
* `AsyncTensormesh`: asynchronous client for services and async application stacks
Both clients expose the same top-level namespaces:
* `client.inference.serverless`
* `client.control_plane`
The inference namespace exposes `chat.completions`, `models`, `completions`, `responses`, `tokenize`, `detokenize`, `health`, and `version`.
## Choose A Guide
* [Getting Started](/sdk/guides/getting-started)
* [Auth And Config](/sdk/guides/auth-and-config)
* [Inference](/sdk/guides/inference)
* [Migration From OpenAI And Fireworks](/sdk/guides/migration-from-openai-fireworks)
* [Control Plane](/sdk/guides/control-plane)
## Related Reference
* [Raw Inference API Reference](/api-reference)
* [`tm billing pricing serverless list`](/cli/reference/billing/pricing/serverless/list)
* [CLI Guides](/cli)
Use the **Control Plane API** tab in the docs navigation for generated management API reference.
# Serverless Inference
Source: https://inference.docs.tensormesh.ai/serverless-inference
Call any supported LLM via API with pay-per-token pricing and no infrastructure to manage.
Serverless inference lets you call any supported model through a simple API — no GPU provisioning, no deployments, no setup. Pay per token and start immediately.
Navigate to **Deploy → Serverless** from the sidebar to browse models and get your API key.
***
## How It Works
View all available serverless models in the model catalog. Each card shows the model name, family, context window, and per-token pricing.
Use the search bar, capability filters (Coding, Reasoning, Agentic, Tool Use, Chat), or use case filters (Production APIs, Automation, Low-Latency, Research, etc.) to find the right model for your workload.
Select a model to view its full specifications — parameter count, architecture, context window, capabilities, and detailed pricing breakdown.
Use the provided code examples (cURL, Python, SDK, or CLI) with your API key to start sending requests immediately. No deployment step required.
***
## Pricing
Serverless models use **pay-per-token** pricing, displayed as a rate per 1M tokens on each model card. You are charged for input and output tokens at per-model rates. **Cached tokens are \$0.00** — when Tensormesh serves a token from its KV cache, you are not charged for it.
Current pricing for each model is displayed on the **Deploy → Serverless** page. For a full breakdown, see [Pricing Overview](/pricing-overview).
Track your token usage and costs at any time under **Operations → Serverless Usage**. See [Serverless Usage](/serverless-usage) for the full per-model breakdown.
***
## Choosing the Right Model
Look for large MoE models with long context windows. Higher parameter counts generally mean stronger reasoning and tool use for complex agentic workflows.
Coding-specialized models with large context windows are best for multi-file tasks, code review, and agentic workflows. Smaller coding models offer a faster, cheaper alternative for simpler tasks.
Smaller, compact models are the fastest and most cost-effective — ideal for real-time assistants, chatbots, and high-volume API services where speed matters more than raw capability.
For workflows that process large documents, codebases, or long conversation histories, prioritize models with the largest context windows available in the catalog.
***
## Quick Start
```bash theme={null}
curl --request POST \
--url https://serverless.tensormesh.ai/v1/chat/completions \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '
{
"model": "MODEL_NAME",
"max_tokens": 16384,
"temperature": 0.6,
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"top_p": 1,
"top_k": 40,
"presence_penalty": 0,
"frequency_penalty": 0
}
'
```
```python theme={null}
import requests
url = "https://serverless.tensormesh.ai/v1/chat/completions"
payload = {
"model": "MODEL_NAME",
"max_tokens": 16384,
"temperature": 0.6,
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
}
],
"top_p": 1,
"top_k": 40,
"presence_penalty": 0,
"frequency_penalty": 0
}
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
```
Install the [Tensormesh Python SDK](/sdk/index) (`pip install tensormesh`), then:
```python theme={null}
from tensormesh import Tensormesh
from tensormesh.types import ChatMessage
with Tensormesh(inference_api_key="YOUR_API_KEY") as client:
completion = client.inference.serverless.chat.completions.create(
model="MODEL_NAME",
messages=[
ChatMessage(role="user", content="Hello, how are you?"),
],
)
print(completion.choices[0].message.content)
```
The serverless API is **OpenAI-compatible**. You can use any OpenAI SDK or client library by pointing the base URL to `https://serverless.tensormesh.ai` and using your Tensormesh API key.
# Choose A Serverless Model Name
Source: https://inference.docs.tensormesh.ai/serverless-model-selection
How to think about Tensormesh serverless model names before sending your first request.
Serverless quickstarts need a model name such as `MiniMaxAI/MiniMax-M2.5`.
## How To Discover A Serverless Model
If you have Control Plane access for the same Tensormesh environment, log in first and then use the pricing command:
```sh theme={null}
tm auth login
tm billing pricing serverless list
```
For machine-friendly output:
```sh theme={null}
tm --output json billing pricing serverless list --active-only
```
Use the returned `pricing[].model` value in SDK, CLI, or raw API requests.
* Control Plane pricing records can help you discover published serverless models for the current Tensormesh environment.
* Serverless requests use a model name string, not a Control Plane `modelId` UUID.
* The `pricing[].model` field is the value to pass as `model`.
* The `id` field is the pricing record id, not the inference model name.
* The `name` field is display-oriented; use `model` when sending requests.
## What To Do In Practice
* If your team already has a known serverless target, use that exact `model` value in the SDK, CLI, or raw API request.
* If you have Control Plane access for the same environment, run `tm billing pricing serverless list` and pick the model from the returned records.
* If you only have inference credentials, or you are targeting a different serverless host or base URL override, ask your operator or admin for the exact serverless `model` string for that host before sending the request.
## Related Docs
* [API Quickstart](/api-quickstart)
* [Serverless Chat Completions Reference](/api-reference/serverless)
* [CLI Getting Started](/cli/guides/getting-started)
* [SDK Getting Started](/sdk/guides/getting-started)
# Serverless Usage
Source: https://inference.docs.tensormesh.ai/serverless-usage
Monitor token consumption, cache hit rates, and per-model costs for your serverless inference calls.
Navigate to **Operations → Serverless Usage** to monitor your token consumption across serverless inference calls.
***
## What You'll See
| Metric | What it shows |
| --------------------- | -------------------------------------------------------------------------------------------------------- |
| **Input Tokens** | Total tokens sent in requests (system prompt + messages) |
| **Output Tokens** | Total tokens generated by models |
| **Cached Tokens** | Input tokens served from the KV cache at \$0.00 |
| **GPU Cache Hit** | Subset of cached tokens served from the vLLM prefix cache (L0 — GPU memory). Fastest possible cache hit. |
| **CPU & Storage Hit** | Subset of cached tokens served from LMCache (L1 CPU memory or L2 External Storage). |
| **Cache Hit Rate** | Percentage of input tokens served from cache |
A chart tracks your cache hit performance over time so you can see whether prompt changes are improving cache efficiency.
***
## Cache Hit Rate
* Shows what percentage of input tokens were served from cache at **\$0.00**
* Higher = your prompts share consistent prefixes, no repeated compute costs
* **If it's low:** the most common cause is a variable or inconsistent system prompt, or dynamic content appearing too early in the prompt
See [Pricing Overview](/pricing-overview) for strategies to improve cache hit rate.
***
## Per-Model Cost
The usage table breaks down by model:
* Token counts (input, output, cached) per model
* Cost per model
* Useful for spotting which models drive most of your spend
* A low cache hit rate on a specific model often signals inconsistent prompts in that flow
***
## Token Pricing
| Token Type | Cost |
| ---------------- | -------------------------------------------- |
| **Input Token** | Per-model rate (see **Deploy → Serverless**) |
| **Output Token** | Per-model rate |
| **Cached Token** | **\$0.00** |
***
## Related
* [Cache Savings](/cache-savings)
* [Pricing Overview](/pricing-overview)
* [External Storage](/external-storage)
# Support & Community
Source: https://inference.docs.tensormesh.ai/support-community
Get help through support tickets or join our Slack community
Tensormesh offers two primary channels for getting help: our **ticketing system** for tracked support requests and our **Slack community** for real-time collaboration.
***
## Support Tickets
Support tickets provide a formal, tracked way to get help from our team. Each ticket is assigned a unique identifier and tracked through resolution.
### Creating a Support Ticket
Navigate to **Management → Contact Us** in the sidebar.
Click the **"New Ticket"** button in the top right corner
Choose the appropriate category:
Use this category when reporting issues or unexpected behavior. Include reproduction steps, error messages, and your environment configuration to help us diagnose the problem quickly.
For general questions about using Tensormesh, configuration options, or clarification on features. If you need quick answers, consider asking in Slack first.
Submit ideas for new features or improvements to existing functionality. Describe the use case, expected behavior, and how it would benefit your workflow.
For inquiries that don't fit other categories, such as partnership opportunities, general feedback, or other non-technical topics.
Include a clear, descriptive title and detailed information:
* Steps to reproduce (for bugs)
* Expected vs actual behavior
* Environment details (deployment type, model, configuration)
* Relevant logs or error messages
Add screenshots, log files, or other supporting documents to help the team diagnose your issue faster.
### Ticket Lifecycle
Ticket has been created and is awaiting response from the support team
A team member is actively working on your ticket
We've replied and are waiting for additional information from you
The issue has been resolved or the question has been answered
***
## Slack Community
The Tensormesh Slack community is an active workspace where users, developers, and the Tensormesh team collaborate in real-time.
### Why Join Our Slack Community?
Get answers from experienced users across different time zones.
Tensormesh engineers actively participate and answer technical questions.
Immediate back-and-forth conversations for troubleshooting and brainstorming.
Be the first to hear about new features, beta programs, and platform updates.
### Getting Started on Slack
Join our Slack workspace: [tensormesh.slack.com](https://tensormeshsaa-w2c5033.slack.com)
Click the link above or use the invite link provided in **Contact Us → Slack Community**
Create a Slack account or sign in with an existing account
Add your name and a brief description of your use case
### Community Guidelines
**Please follow these guidelines to keep our community welcoming and productive:**
* **Be respectful** — Treat all community members with courtesy and professionalism
* **Stay on topic** — Use the appropriate channel for your question or discussion
* **Share knowledge** — If you solve a problem, share the solution to help others
* **No spam or self-promotion** — Keep discussions focused on Tensormesh and related technologies
* **Keep it public** — Ask questions in channels rather than DMs so everyone can learn
# Activities
Source: https://inference.docs.tensormesh.ai/tensormesh-api/activity/v1/activity_service
Activity listing and detail reads from the Control Plane.
Use this group to inspect recorded activity entries.
Common operations:
* [List activities](/tensormesh-api/activity/v1/activity_service/activityservice/list-activities)
* [Get activity](/tensormesh-api/activity/v1/activity_service/activityservice/get-activity)
# Get Activity
Source: https://inference.docs.tensormesh.ai/tensormesh-api/activity/v1/activity_service/activityservice/get-activity
/tensormesh-api/specs/activity/v1/activity_service.openapi.json get /v1/activities/{activityId}
Retrieves an activity event by ID.
# List Activities
Source: https://inference.docs.tensormesh.ai/tensormesh-api/activity/v1/activity_service/activityservice/list-activities
/tensormesh-api/specs/activity/v1/activity_service.openapi.json get /v1/activities
Lists activity events with optional filters.
# Admin Billing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_billing_service
Admin-only balance and spending summary operations.
Use this group for admin billing workflows.
Common operations:
* [Get user balances](/tensormesh-api/billing/v1/admin_billing_service/admin-billing/get-user-balances)
* [Add user balance](/tensormesh-api/billing/v1/admin_billing_service/admin-billing/add-user-balance)
* [Get spending summary](/tensormesh-api/billing/v1/admin_billing_service/admin-billing/get-spending-summary)
# Add User Balance
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_billing_service/adminbillingservice/add-user-balance
/tensormesh-api/specs/billing/v1/admin_billing_service.openapi.json post /v1/admin/billing/balances:add
Increments a user's balance by a specific amount.
# Get Users Balance
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_billing_service/adminbillingservice/get-users-balance
/tensormesh-api/specs/billing/v1/admin_billing_service.openapi.json post /v1/admin/billing/balances
Retrieves current balances for multiple users.
# Get Users Spending Summary
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_billing_service/adminbillingservice/get-users-spending-summary
/tensormesh-api/specs/billing/v1/admin_billing_service.openapi.json post /v1/admin/billing/spending/summary
Returns rolling-window spending totals.
# Admin List Serverless Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_pricing_service/pricingservice/admin-list-serverless-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json get /v1/admin/billing/serverless-pricing
# Delete GPU Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_pricing_service/pricingservice/delete-gpu-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json delete /v1/admin/billing/gpu-pricing/{gpuType}/{cloudProvider}
# Delete Serverless Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_pricing_service/pricingservice/delete-serverless-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json delete /v1/admin/billing/serverless-pricing
# Insert GPU Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_pricing_service/pricingservice/insert-gpu-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json post /v1/admin/billing/gpu-pricing
# Insert Serverless Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_pricing_service/pricingservice/insert-serverless-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json post /v1/admin/billing/serverless-pricing
# Update GPU Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_pricing_service/pricingservice/update-gpu-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json put /v1/admin/billing/gpu-pricing
# Update Serverless Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_pricing_service/pricingservice/update-serverless-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json put /v1/admin/billing/serverless-pricing
# Admin List Products
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_product_service/productservice/admin-list-products
/tensormesh-api/specs/billing/v1/product_service.openapi.json get /v1/admin/products
# Upsert Product
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/admin_product_service/productservice/upsert-product
/tensormesh-api/specs/billing/v1/product_service.openapi.json post /v1/admin/products
# Billing Addresses
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_address_service
Read and update the billing address for the current user.
Use this group for current-user billing address management.
Common operations:
* [Get billing address](/tensormesh-api/billing/v1/billing_address_service/billingaddressservice/get-billing-address)
* [Update billing address](/tensormesh-api/billing/v1/billing_address_service/billingaddressservice/update-billing-address)
# Get Billing Address
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_address_service/billingaddressservice/get-billing-address
/tensormesh-api/specs/billing/v1/billing_address_service.openapi.json get /v1/billing/address
Retrieves the billing address for a user.
# Update Billing Address
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_address_service/billingaddressservice/update-billing-address
/tensormesh-api/specs/billing/v1/billing_address_service.openapi.json put /v1/billing/address
Updates the billing address for a user.
# Deploy Model
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_model_service/billingmodelservice/deploy-model
/tensormesh-api/specs/billing/v1/billing_model_service.openapi.json post /v1/models
Provisions a model after billing checks and forwards to ModelService.
# Model Check
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_model_service/billingmodelservice/model-check
/tensormesh-api/specs/billing/v1/billing_model_service.openapi.json post /v1/models/check
Returns model memory requirements used for billing and scheduling checks.
# Transactions
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_transaction_service
Spending history, spending summary, and billing transaction reads.
Use this group to inspect spending and transaction history.
Common operations:
* [List transactions](/tensormesh-api/billing/v1/billing_transaction_service/transactions/list-transactions)
* [Get spending history](/tensormesh-api/billing/v1/billing_transaction_service/transactions/get-spending-history)
* [Get spending summary](/tensormesh-api/billing/v1/billing_transaction_service/transactions/get-spending-summary)
# Get User Spending History
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_transaction_service/billingtransactionservice/get-user-spending-history
/tensormesh-api/specs/billing/v1/billing_transaction_service.openapi.json get /v1/billing/spending/history
Returns last month spending buckets.
# Get User Spending Summary
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_transaction_service/billingtransactionservice/get-user-spending-summary
/tensormesh-api/specs/billing/v1/billing_transaction_service.openapi.json get /v1/billing/spending/summary
Returns rolling-window spending totals.
# List Billing Transactions
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/billing_transaction_service/billingtransactionservice/list-billing-transactions
/tensormesh-api/specs/billing/v1/billing_transaction_service.openapi.json get /v1/billing/transactions
Lists a user's billing transactions.
# Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/pricing_service
Pricing lookups plus admin pricing operations for serverless billing.
Use this group for pricing lookups and pricing administration.
Public and admin operations share one published group today:
* Public pricing reads use `/v1/billing/...`
* Admin pricing changes use `/v1/admin/billing/...`
For onboarding and customer-facing docs, start with the public list endpoints. Use the admin operations only when you are managing pricing for an environment.
Public operations:
* [List serverless pricing](/tensormesh-api/billing/v1/pricing_service/pricing/list-serverless-pricing)
Admin operations:
* [List serverless pricing (admin)](/tensormesh-api/billing/v1/pricing_service/pricing/list-serverless-pricing-admin)
* [Create serverless pricing](/tensormesh-api/billing/v1/pricing_service/pricing/create-serverless-pricing)
* [Update serverless pricing](/tensormesh-api/billing/v1/pricing_service/pricing/update-serverless-pricing)
* [Delete serverless pricing](/tensormesh-api/billing/v1/pricing_service/pricing/delete-serverless-pricing)
# List GPU Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/pricing_service/pricingservice/list-gpu-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json get /v1/billing/gpu-pricing
# List Serverless Pricing
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/pricing_service/pricingservice/list-serverless-pricing
/tensormesh-api/specs/billing/v1/pricing_service.openapi.json get /v1/billing/serverless-pricing
# Products
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/product_service
Public product listing plus admin product management.
Use this group for product catalog reads and product administration.
Public and admin operations share one published group today:
* Public product discovery uses `/v1/products`
* Admin catalog management uses `/v1/admin/products`
If you are documenting or onboarding a non-admin user, start with the public read path and treat the admin operations below as environment-management actions.
Public operations:
* [List products](/tensormesh-api/billing/v1/product_service/products/list-products)
Admin operations:
* [List products (admin)](/tensormesh-api/billing/v1/product_service/products/list-products-admin)
* [Create or update product](/tensormesh-api/billing/v1/product_service/products/create-or-update-product)
* [Delete product](/tensormesh-api/billing/v1/product_service/products/delete-product)
# Delete Product
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/product_service/productservice/delete-product
/tensormesh-api/specs/billing/v1/product_service.openapi.json delete /v1/products/{id}
# List Available Products
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/product_service/productservice/list-available-products
/tensormesh-api/specs/billing/v1/product_service.openapi.json get /v1/products
# Stripe
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/stripe_service
Customer, payment method, payment intent, and setup intent operations.
Use this group for Stripe-backed billing flows.
Webhook delivery is intentionally excluded from the public docs and SDK surface.
Common operations:
* [Get or create Stripe customer](/tensormesh-api/billing/v1/stripe_service/stripeservice/get-or-create-stripe-customer)
* [List payment methods](/tensormesh-api/billing/v1/stripe_service/stripeservice/list-stripe-payment-methods)
* [Attach payment method](/tensormesh-api/billing/v1/stripe_service/stripeservice/attach-stripe-payment-method)
* [Create payment intent](/tensormesh-api/billing/v1/stripe_service/stripeservice/create-stripe-payment-intent)
* [Create setup intent](/tensormesh-api/billing/v1/stripe_service/stripeservice/create-stripe-setup-intent)
# Attach Stripe Payment Method
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/stripe_service/stripeservice/attach-stripe-payment-method
/tensormesh-api/specs/billing/v1/stripe_service.openapi.json post /v1/billing/stripe/customers/payment-methods
Attaches a payment method to a customer.
# Confirm Stripe Payment Intent
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/stripe_service/stripeservice/confirm-stripe-payment-intent
/tensormesh-api/specs/billing/v1/stripe_service.openapi.json post /v1/billing/stripe/payment-intents/confirm
Confirms a payment intent after client confirmation.
# Create Stripe Payment Intent
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/stripe_service/stripeservice/create-stripe-payment-intent
/tensormesh-api/specs/billing/v1/stripe_service.openapi.json post /v1/billing/stripe/payment-intents
Creates a Stripe payment intent for a user.
# Create Stripe Setup Intent
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/stripe_service/stripeservice/create-stripe-setup-intent
/tensormesh-api/specs/billing/v1/stripe_service.openapi.json post /v1/billing/stripe/setup-intents
Creates a Stripe setup intent for a user.
# Detach Stripe Payment Method
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/stripe_service/stripeservice/detach-stripe-payment-method
/tensormesh-api/specs/billing/v1/stripe_service.openapi.json delete /v1/billing/stripe/customers/payment-methods
Removes a payment method from a customer.
# Get Or Create Stripe Customer
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/stripe_service/stripeservice/get-or-create-stripe-customer
/tensormesh-api/specs/billing/v1/stripe_service.openapi.json get /v1/billing/stripe/customers
# List Stripe Payment Methods
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/stripe_service/stripeservice/list-stripe-payment-methods
/tensormesh-api/specs/billing/v1/stripe_service.openapi.json get /v1/billing/stripe/customers/payment-methods
Lists a user's attached payment methods.
# Balances
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/user_balance_service
Current-user balance lookup.
Use this group to read the current user's available balance.
Common operations:
* [Get billing balance](/tensormesh-api/billing/v1/user_balance_service/userbalanceservice/get-user-balance)
# Get User Balance
Source: https://inference.docs.tensormesh.ai/tensormesh-api/billing/v1/user_balance_service/userbalanceservice/get-user-balance
/tensormesh-api/specs/billing/v1/user_balance_service.openapi.json get /v1/billing/balance
Get user's current balance.
# Delete Model
Source: https://inference.docs.tensormesh.ai/tensormesh-api/model/v1/admin_model_service/adminmodelservice/delete-model
/tensormesh-api/specs/model/v1/admin_model_service.openapi.json delete /v1/admin/models/{modelId}
Deletes a model by id (admin only). Does not require ownership.
# List Models
Source: https://inference.docs.tensormesh.ai/tensormesh-api/model/v1/admin_model_service/adminmodelservice/list-models
/tensormesh-api/specs/model/v1/admin_model_service.openapi.json get /v1/admin/models
Lists all models that are not deleted.
# Chat With Model
Source: https://inference.docs.tensormesh.ai/tensormesh-api/model/v1/model_service/modelservice/chat-with-model
/tensormesh-api/specs/model/v1/model_service.openapi.json post /v1/models/{modelId}:chat
Sends a chat message to a deployed model and returns the response.
# Delete Model
Source: https://inference.docs.tensormesh.ai/tensormesh-api/model/v1/model_service/modelservice/delete-model
/tensormesh-api/specs/model/v1/model_service.openapi.json delete /v1/models/{modelId}
Deletes an existing model deployment.
# Get Model
Source: https://inference.docs.tensormesh.ai/tensormesh-api/model/v1/model_service/modelservice/get-model
/tensormesh-api/specs/model/v1/model_service.openapi.json get /v1/models/{modelId}
Retrieves details of a specific model deployment.
# List Models
Source: https://inference.docs.tensormesh.ai/tensormesh-api/model/v1/model_service/modelservice/list-models
/tensormesh-api/specs/model/v1/model_service.openapi.json get /v1/models
Lists all models owned by a user.
# List Models By Infra
Source: https://inference.docs.tensormesh.ai/tensormesh-api/model/v1/model_service/modelservice/list-models-by-infra
/tensormesh-api/specs/model/v1/model_service.openapi.json post /v1/models:search-by-infra
Lists all model deployments in a specific cluster.
# Validate Model Name
Source: https://inference.docs.tensormesh.ai/tensormesh-api/model/v1/model_service/modelservice/validate-model-name
/tensormesh-api/specs/model/v1/model_service.openapi.json post /v1/models:validate
Validates whether a model nick name is available and valid.
# Observability
Source: https://inference.docs.tensormesh.ai/tensormesh-api/observability/v1/observability_service
User metrics reads.
Use this group for user-level metrics reads.
Common operations:
* [Get user metrics](/tensormesh-api/observability/v1/observability_service/observabilityservice/get-user-metrics)
# Get Model Logs
Source: https://inference.docs.tensormesh.ai/tensormesh-api/observability/v1/observability_service/observabilityservice/get-model-logs
/tensormesh-api/specs/observability/v1/observability_service.openapi.json get /v1/observability/deployments/{deploymentId}/logs
Retrieves logs for a specific model deployment.
# Get Model Metrics
Source: https://inference.docs.tensormesh.ai/tensormesh-api/observability/v1/observability_service/observabilityservice/get-model-metrics
/tensormesh-api/specs/observability/v1/observability_service.openapi.json get /v1/observability/deployments/{deploymentId}/metrics
Retrieves metrics for a specific model deployment.
# Get User Metrics
Source: https://inference.docs.tensormesh.ai/tensormesh-api/observability/v1/observability_service/observabilityservice/get-user-metrics
/tensormesh-api/specs/observability/v1/observability_service.openapi.json get /v1/observability/users/metrics
Retrieves metrics for a specific user.
# Reserved Deployments
Source: https://inference.docs.tensormesh.ai/tensormesh-api/support/v1/reserved_deployment_service
Submit reserved deployment requests.
Use this group for reserved deployment submission workflows.
Common operations:
* [Submit reserved deployment](/tensormesh-api/support/v1/reserved_deployment_service/reserveddeploymentservice/submit-reserved-deployment)
# Submit Reserved Deployment
Source: https://inference.docs.tensormesh.ai/tensormesh-api/support/v1/reserved_deployment_service/reserveddeploymentservice/submit-reserved-deployment
/tensormesh-api/specs/support/v1/reserved_deployment_service.openapi.json post /v1/support/reserved-deployments
Submits a reservation request and triggers an email notification.
# Support
Source: https://inference.docs.tensormesh.ai/tensormesh-api/support/v1/support_service
Ticket listing, ticket detail, ticket creation, closure, and message append operations.
Use this group for support-ticket workflows.
Common operations:
* [List tickets](/tensormesh-api/support/v1/support_service/support/list-tickets)
* [Create ticket](/tensormesh-api/support/v1/support_service/support/create-ticket)
* [Get ticket](/tensormesh-api/support/v1/support_service/support/get-ticket)
* [Close ticket](/tensormesh-api/support/v1/support_service/support/close-ticket)
* [Add ticket message](/tensormesh-api/support/v1/support_service/support/add-ticket-message)
# Append Ticket Message
Source: https://inference.docs.tensormesh.ai/tensormesh-api/support/v1/support_service/supportservice/append-ticket-message
/tensormesh-api/specs/support/v1/support_service.openapi.json post /v1/support/tickets/{ticketId}/messages
Appends a conversation message to a ticket.
# Close Ticket
Source: https://inference.docs.tensormesh.ai/tensormesh-api/support/v1/support_service/supportservice/close-ticket
/tensormesh-api/specs/support/v1/support_service.openapi.json delete /v1/support/tickets/{ticketId}
Closes a support ticket.
# Create Ticket
Source: https://inference.docs.tensormesh.ai/tensormesh-api/support/v1/support_service/supportservice/create-ticket
/tensormesh-api/specs/support/v1/support_service.openapi.json post /v1/support/tickets
Creates a new support ticket.
# Get Ticket
Source: https://inference.docs.tensormesh.ai/tensormesh-api/support/v1/support_service/supportservice/get-ticket
/tensormesh-api/specs/support/v1/support_service.openapi.json get /v1/support/tickets/{ticketId}
Retrieves a support ticket by ID.
# List Tickets
Source: https://inference.docs.tensormesh.ai/tensormesh-api/support/v1/support_service/supportservice/list-tickets
/tensormesh-api/specs/support/v1/support_service.openapi.json get /v1/support/tickets
Lists support tickets with optional filters.
# Admin Users
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/admin_user_service
Admin-only user listing and role-change operations.
Use this group for admin user-management operations.
Common operations:
* [List users](/tensormesh-api/user/v1/admin_user_service/adminuserservice/list-users)
* [Change user role](/tensormesh-api/user/v1/admin_user_service/adminuserservice/change-user-role)
# Change User Role
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/admin_user_service/adminuserservice/change-user-role
/tensormesh-api/specs/user/v1/admin_user_service.openapi.json post /v1/admin/users/change_role
Updates a user's role.
# List Users
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/admin_user_service/adminuserservice/list-users
/tensormesh-api/specs/user/v1/admin_user_service.openapi.json get /v1/admin/users
Lists users with pagination.
# Users
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service
Current-user auth profile, user records, terms of service, and user API key operations.
Use this group for two related concerns:
* `/auth/profile` returns the authenticated caller profile
* `/v1/users/...` covers user records, terms of service, and user API keys
The routes live under different prefixes, but they are published together because they are typically used in the same account-management workflows.
Current-user operations:
* [Get auth profile](/tensormesh-api/user/v1/user_service/users/get-auth-profile)
* [List user API keys](/tensormesh-api/user/v1/user_service/users/list-user-api-keys)
* [Create user API key](/tensormesh-api/user/v1/user_service/users/create-user-api-key)
User record operations:
* [Get user by email](/tensormesh-api/user/v1/user_service/users/get-user-by-email)
* [Get user by id](/tensormesh-api/user/v1/user_service/users/get-user-by-id)
* [Update user](/tensormesh-api/user/v1/user_service/users/update-user)
# Accept Tos
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service/userservice/accept-tos
/tensormesh-api/specs/user/v1/user_service.openapi.json post /v1/users/accept-tos
Marks a user as having accepted terms of service.
# Create User API Key
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service/userservice/create-user-api-key
/tensormesh-api/specs/user/v1/user_service.openapi.json post /v1/users/api-keys
Creates an API key for a user.
# Delete User API Key
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service/userservice/delete-user-api-key
/tensormesh-api/specs/user/v1/user_service.openapi.json delete /v1/users/api-keys
Soft deletes an API key for a user.
# Get Auth Profile
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service/userservice/get-auth-profile
/tensormesh-api/specs/user/v1/user_service.openapi.json get /auth/profile
Returns the authenticated user profile for the current bearer token.
# Get User Profile
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service/userservice/get-user-profile
/tensormesh-api/specs/user/v1/user_service.openapi.json get /v1/users/{userId}
Retrieves an existing user profile by ID or email.
# Get User Profile 2
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service/userservice/get-user-profile-2
/tensormesh-api/specs/user/v1/user_service.openapi.json get /v1/users/by-email/{userEmail}
GetUserProfile retrieves an existing user profile by ID or email.
# List User API Keys
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service/userservice/list-user-api-keys
/tensormesh-api/specs/user/v1/user_service.openapi.json get /v1/users/api-keys
Lists API keys for a user.
# Update User Profile
Source: https://inference.docs.tensormesh.ai/tensormesh-api/user/v1/user_service/userservice/update-user-profile
/tensormesh-api/specs/user/v1/user_service.openapi.json put /v1/users/{userId}
Updates an existing user profile.