Skip to main content
PRE-RELEASE: route commands are not GA yet. Their arguments, flags, and output may change.
Manage routes. Baseten derives each route’s name from its target. A route’s name, team, and target cannot be changed after creation.

list

List all routes you can invoke, newest first.

Options

TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID to scope the listing to. Defaults to all routes you can invoke.
BOOL
Enable verbose logging

Examples

List all visible routes
Filter by team

Filter output with --jq

Print route names

Output

Text mode (--output text): Table with columns: ID, NAME, DISPLAY NAME, TEAM, TARGET, CREATED. When no routes match, prints “No routes found.” to stderr. JSON mode (--output json): payload type cmd.RouteList. All matching routes in items. target.type is BASETEN_MODEL_API, ANTHROPIC, OPENAI, or XAI. Every target includes model. External targets also include secret_name.

describe

Describe a route by ID or exact name. Pass exactly one of --id or --name.

Options

TEXT
Stable route ID.Mutually exclusive with other flags in group route-ref.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
Exact route name, including its organization-owned prefix.Mutually exclusive with other flags in group route-ref.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Enable verbose logging

Examples

Describe a route by name

Filter output with --jq

Print the invoke URL

Output

Text mode (--output text): Field-per-line summary of the route, including its target, invoke URL, and team name. Unrecognized target types are shown as <unrecognized type>. JSON mode (--output json): payload type managementapi.Route. target.type is BASETEN_MODEL_API, ANTHROPIC, OPENAI, or XAI. Every target includes model. External targets also include secret_name.

create

Create a route with --target-type and --target-model. Baseten derives the route’s name from its target. Find Model API names with baseten model-api list. Omit --team to use the organization’s default team. External targets require --target-secret, the name of an existing secret in the route’s team. Store credentials in a secret with baseten org secret set --name <secret-name>; pass the same --team value if the route uses a specific team. Set optional metadata with --display-name and --description.

Options

TEXT
Optional route description (up to 1000 characters).
TEXT
Display name (1 to 255 characters). Defaults to the route name.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
required
Model API name or external provider model name.
TEXT
Name of an existing secret in the route’s team. Required for external targets.
TEXT
required
Target type.One of: baseten-model-api, anthropic, openai, xai
TEXT
Team name or ID the route belongs to. Defaults to the organization’s default team. Run ‘baseten org team list’ to see teams.
BOOL
Enable verbose logging

Examples

Create a Model API route
Create an external provider route

Filter output with --jq

Print the created route ID

Output

Text mode (--output text): On success, prints “Created route name (id)” to stderr; no stdout output. JSON mode (--output json): payload type managementapi.Route. target.type is BASETEN_MODEL_API, ANTHROPIC, OPENAI, or XAI. Every target includes model. External targets also include secret_name.

update

Update a route by ID or exact name. Pass exactly one of --id or --name. Pass --display-name or --description; omitted fields are unchanged. Pass --description '' to clear the description. Name, team, and target cannot be changed; to change a target, create a new route.

Options

TEXT
New description (up to 1000 characters). Pass an empty string to clear it.
TEXT
New display name (1 to 255 characters). Omit to keep it unchanged.
TEXT
Stable route ID.Mutually exclusive with other flags in group route-ref.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
Exact route name, including its organization-owned prefix.Mutually exclusive with other flags in group route-ref.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Enable verbose logging

Examples

Change a route’s description

Filter output with --jq

Change the display name and print it

Output

Text mode (--output text): On success, prints “Updated route name (id)” to stderr; no stdout output. JSON mode (--output json): payload type managementapi.Route. target.type is BASETEN_MODEL_API, ANTHROPIC, OPENAI, or XAI. Every target includes model. External targets also include secret_name.

delete

Delete a route by ID or exact name. Pass exactly one of --id or --name. Prompts for confirmation. Pass --yes to skip the prompt. When stdin is not a terminal, --yes is required.

Options

TEXT
Stable route ID.Mutually exclusive with other flags in group route-ref.
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
Exact route name, including its organization-owned prefix.Mutually exclusive with other flags in group route-ref.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Delete a route without prompting

Filter output with --jq

Print the deleted route’s ID

Output

Text mode (--output text): On success, prints “Deleted route name (id)” to stderr; no stdout output. JSON mode (--output json): payload type managementapi.RouteTombstone.

usage

Show routes usage and estimated costs as daily UTC buckets, oldest first, broken down by the dimensions passed to --group-by. Defaults match the API: the previous UTC day through today, grouped by model. Organization admins see usage from every routes API key in the organization; other members see only usage from keys they created. Usage comes in whole UTC days: --start is snapped down to its day and --end is rounded up to the end of its day. Every bucket in the window is fetched, paging as needed, until --limit buckets are collected. Usage can lag by up to 15 minutes and is retained for 92 days. Model API costs use your prices and include tool calls. OpenAI, Anthropic, and xAI costs estimate what those providers charge and are not Baseten charges. Vertex and OpenAI-compatible usage isn’t included. For your own usage this month, see baseten harness usage. For machine-readable streaming, prefer --output jsonl over --output json.

Options

TEXT
End of the range, exclusive, rounded up to the end of its UTC day. ISO 8601, local when no timezone is given. Defaults to now.
TEXT (repeatable)
default:"model"
Dimension to break usage down by. May be repeated.One of: user, model, provider
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
INTEGER
Maximum number of daily buckets, paging as needed. 0 for no limit.
TEXT (repeatable)
Only return usage for these models. May be repeated.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT (repeatable)
Only return usage for these providers. May be repeated.One of: baseten-model-api, openai, anthropic, xai, vertex, openai-compatible
TEXT
Window from a relative time ago until now (e.g. ‘7d’). Mutually exclusive with —start and —end.
TEXT
Start of the range, inclusive, snapped down to its UTC day. ISO 8601, local when no timezone is given. Defaults to the day before —end.
TEXT (repeatable)
Only return usage from routes API keys created by these user IDs. May be repeated. ‘baseten whoami’ shows your own.
BOOL
Enable verbose logging

Examples

Show usage per model since yesterday
Show which users drove usage over the last 7 days (admins)

Filter output with --jq

Stream each day’s cost per model as a JSONL stream

Output

Text mode (--output text): Table with a DATE column, one column per --group-by dimension, then INPUT, CACHED, and OUTPUT token counts and COST, followed by an ALL totals row. A day with no usage renders as a single “(no usage)” row. A cost of ”-” means some of that usage couldn’t be priced. The window goes to stderr. When no day 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.RoutesUsageBucket. One record per UTC day, as returned by the API: its date and the per-dimension usage in results, including days with no usage. cost_usd values are exact decimal strings.