CLI
Install the sference CLI and authenticate with an API key.
CLI
The sference command-line tool is published on PyPI as sference-cli. It wraps the same inference API as the Python SDK: auth, batches, streams, and responses.
Install (one line)
macOS and Linux:
curl -fsSL https://raw.githubusercontent.com/s-ference/sference/main/install.sh | shThat script installs sference on your PATH (via uv tool when available).
Other install options
uv tool install sference-clipip install sference-cli
# or
pipx install sference-cliThen verify:
sference --helpAuthenticate
Create an API key in the sference console, then:
export SFERENCE_API_KEY='sk_...'
sference auth login --api-key "$SFERENCE_API_KEY"
sference auth me --jsonSFERENCE_API_KEY overrides the saved credential file for every subcommand.
Batch JSONL
Each line in a batch input file becomes one row in POST /v1/batches. All rows must use the same model: either repeat body.model on every OpenAI-style line or set --model once for content-only lines. The model must be catalog-available; invalid or mixed models return 400 at create.
Inner body accepts chat completions (messages) or Responses (input). Responses fields are normalized at create; invalid rows return 400 with row index / custom_id.
{"custom_id":"a","method":"POST","url":"/v1/chat/completions","body":{"model":"…","messages":[{"role":"user","content":"hi"}]}}
{"custom_id":"b","method":"POST","url":"/v1/responses","body":{"model":"…","input":[{"role":"user","content":"hi"}]}}
{"content":"content-only, pass --model on submit"}Full guide: Batch inference. Subcommand reference: OSS CLI README.
Go deeper
Subcommands, JSONL batch formats, and stream workflows live in the sference OSS repository (cli/README.md).