baseten auth login or the BASETEN_API_KEY environment variable.
describe
Options
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
Examples
Describe a Model API by nameFilter output with --jq
Print the Model API’s invoke URL
Output
Text mode (--output text): Field-per-line summary of the Model API.
JSON mode (--output json): payload type managementapi.ModelAPI.
list
--added-only to restrict to just the Model APIs the workspace has added.
CLI v0.3.0 removed
--all and changed the default: baseten model-api list now returns the full catalog instead of just added Model APIs. Scripts that relied on the old default should pass --added-only.Options
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
Examples
List the full visible catalog of Model APIsFilter output with --jq
Print just the Model API names
Output
Text mode (--output text): Table with columns: NAME, CONTEXT, /1M OUT, ADDED. When no Model APIs match, prints “No Model APIs found.” to stderr.
JSON mode (--output json): payload type cmd.ModelAPIList.
predict
--url, which defaults to the OpenAI chat-completions endpoint on the shared inference host. Override it for other shapes (e.g. /v1/messages, /v1/embeddings) or different hosts.
--content is the simple path: it builds an OpenAI chat-completions body with a single user message and --model as the model, and prints just the assistant’s reply. It is only valid for OpenAI chat URLs and requires --model.
--data and --file send a request body verbatim, so any format the endpoint accepts works (OpenAI, Anthropic, embeddings, custom). The response is written as-is: JSON is pretty-printed, streams and binary bodies are passed through.
Pass --verbose to log the request URL, the response status, and the response headers to stderr.
Options
Single user message; builds an OpenAI chat-completions request and prints the assistant’s reply. Only valid for OpenAI chat URLs and requires
--model.Mutually exclusive with other flags in group predict-input.Inline request body, sent verbatim. The accepted shapes are documented at https://docs.baseten.co/inference/model-apis/overview.Mutually exclusive with other flags in group
predict-input.Path to a file containing the request body, sent verbatim. Use ’-’ for stdin.Mutually exclusive with other flags in group
predict-input.Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
Endpoint to POST the request to. Defaults to https://inference.baseten.co/v1/chat/completions.
Examples
Send a single user messageFilter output with --jq
Extract the assistant’s message content
Output
Text mode (--output text): With --content, the assistant message text. With --data/--file, the response body as-is (pretty-printed JSON, or a raw stream/binary body).
JSON mode (--output json): payload type cmd.JSONUndefined.
Under --output json, --content emits the full chat-completions response. For --data/--file, a streamed response becomes one JSON record per chunk under --output jsonl, and a binary body is base64-encoded under a ‘body’ key.
usage
--group-by team to compare teams or --team to filter by team name or ID.
Buckets with no usage are included, so the series has no gaps. Usage is retained for 92 days; buckets older than that come back empty. Every bucket in the window is fetched, paging as needed, until --limit buckets are collected.
Usage is attributed to a user when the request was authenticated with a personal API key or an OAuth credential. Usage from workspace or other non-user-scoped credentials has no user.
For machine-readable streaming, prefer --output jsonl over --output json.
Options
Width of each time bucket. Also sets the default window: 7d for 1d, 24h for 1h, 60m for 1m.One of:
1m, 1h, 1dDimension to break usage down by. May be repeated. One of: api-key, user, model, team. Defaults to model.
Maximum number of time buckets, paging as needed. Rows per bucket depend on
--group-by. 0 for no limit.Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
Window from a relative time ago until now (e.g. ‘30m’, ‘3d’). Mutually exclusive with
--start and --end.Start of the range, inclusive, snapped down to its bucket start. ISO 8601, local when no timezone is given.
Only return usage for these teams, by name or ID. May be repeated. Defaults to all teams you can manage. Run ‘baseten org team list’ to see teams.
Examples
Show daily usage per model over the last 7 daysFilter output with --jq
Stream each bucket’s per-user output tokens as a JSONL stream
Output
Text mode (--output text): Table with a time column, one column per --group-by dimension, then REQUESTS, INPUT, CACHED, and OUTPUT token counts, followed by an ALL totals row. A bucket with no usage renders as a single “(no usage)” row. When no bucket in the window has any usage, prints “No usage in the selected window.” to stderr instead of a table.
JSON mode (--output json): payload type managementapi.ModelApisUsageBucket.
One record per time bucket: its start_time, end_time, and the per-dimension usage totals in results.
metrics
Fetch a snapshot of request and token metrics for a Model API. Replace<MODEL_NAME> with a name from baseten model-api list.
--mode summary for an aggregate over a time window or --mode series to see how the metrics change over time. Both modes accept windows of up to 7 days. For example, to plot the last 6 hours for one team, run:
--team, the response includes every team you can manage. Use --output json to read the metric descriptors, values, and time window programmatically.
Options
End of the metrics time range. Accepts ISO 8601; values without a timezone designator are interpreted in the local timezone. If omitted, the server defaults the end to now. Window must be at most 7 days.
Name of a metric to return; see https://docs.baseten.co/observability/export-metrics/supported-metrics for the available names. May be repeated. When omitted, a default set is returned.
Aggregation mode. ‘current’ returns an instantaneous snapshot at now; ‘summary’ aggregates the whole window into one value per metric; ‘series’ returns evenly-spaced points across the window.
--start/--end/--since are only meaningful for summary and series.One of: current, summary, seriesUse a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
Shortcut for a window from a relative time ago until now. Accepts a duration (e.g. ‘30m’, ‘1h30m’) or ‘
Nd’ (e.g. ‘3d’). Maximum ‘7d’. Mutually exclusive with --start and --end.Start of the metrics time range. Accepts ISO 8601 (e.g. ‘2026-05-14’, ‘2026-05-14T12:00:00’, ‘2026-05-14T12:00:00Z’). Values without a timezone designator are interpreted in the local timezone. If omitted, the server defaults the start to one hour before the end. Window must be at most 7 days.
Only return metrics for these teams, by name or ID. May be repeated. Defaults to all teams you can manage. Run ‘baseten org team list’ to see teams.