CLI reference
The gseai command-line tool lets you interact with the server without writing
any Python.
Authentication
Every command requires a bearer token. Set it once as an environment variable so you don’t have to type it on every call:
export GSEAI_API_TOKEN=your-api-token
You can also pass it inline with -t / --token.
Global options
These options apply to every command and must come before the subcommand.
gseai [OPTIONS] COMMAND [ARGS]...
Flag |
Env var |
Description |
|---|---|---|
|
|
Bearer auth token (required) |
|
|
Server hostname (default: |
|
|
Server port (default: |
|
|
Request timeout in seconds (default: no timeout) |
Models
gseai models # one model ID per line
gseai models -j # raw JSON
Chat
Single-turn chat with a plain-text prompt:
gseai chat gemma-4-e2b-it "What is machine learning?"
# Read the prompt from a file
gseai chat gemma-4-e2b-it -f prompt.txt
# Interactive session (multi-turn, retains conversation history)
gseai chat gemma-4-e2b-it -i
# Interactive with a system prompt and streaming
gseai chat gemma-4-e2b-it -i -s "You are a concise tutor." -S
Type exit or press Ctrl+C to end an interactive session.
Flag |
Description |
|---|---|
|
Read the prompt from a file |
|
Start a multi-turn chat session, retaining conversation history |
|
System prompt |
|
Sampling temperature (0–2) |
|
Maximum tokens to generate per turn |
|
Stream tokens as they arrive |
|
Print full JSON response (single-turn only) |
Completions
Legacy text completion (no chat structure):
gseai completions gemma-4-e2b-it "Once upon a time"
Accepts the same -t, -m, -S, -j flags as chat.
Embeddings
gseai embeddings nomic-embed-text "Hello world"
# model: nomic-embed-text
# dimensions: 768
# values: [0.0142, -0.0317, ...]
gseai embeddings nomic-embed-text "Hello world" -j # full JSON
Audio
transcribe
Transcribe an audio file to text using Whisper:
gseai audio transcribe whisper recording.mp3
gseai audio transcribe whisper lecture.mp3 -l fr # French source
gseai audio transcribe whisper lecture.mp3 -f srt # SRT subtitles
Flag |
Description |
|---|---|
|
Source language code (e.g. |
|
Context hint passed to the model |
|
Response format: |
|
Print full JSON (equivalent to |
translate
Transcribe and translate to English in one step:
gseai audio translate whisper french_lecture.mp3
Accepts the same -p, -f, -j flags as transcribe.
speech
Synthesize speech from text (requires a TTS model):
gseai audio speech tts-model "Hello, world" -o hello.mp3
Flag |
Description |
|---|---|
|
Output file path (default: |
|
Voice identifier |
|
Playback speed (default: |
Images
generate
Generate an image from a text prompt:
gseai images generate stable-diffusion "a red barn in a snowy field"
gseai images generate stable-diffusion "a red barn" -o barn.png -n 3
When --n is greater than 1 the output filenames are numbered:
barn_1.png, barn_2.png, etc.
Flag |
Description |
|---|---|
|
Output file path (default: |
|
Number of images to generate (default: |
|
Image dimensions, e.g. |
|
Diffusion steps |
|
Random seed for reproducibility |
|
Print raw JSON response |
edit
Edit an existing image guided by a text prompt:
gseai images edit stable-diffusion photo.png "replace the sky with a sunset"
gseai images edit stable-diffusion photo.png "repaint the sky" -m mask.png
Flag |
Description |
|---|---|
|
Greyscale mask image (white = area to edit) |
|
Output file path (default: |
|
Number of variants |
|
Output dimensions |
|
Print raw JSON response |
variation
Generate variations of an existing image:
gseai images variation stable-diffusion photo.png -n 3
Flag |
Description |
|---|---|
|
Output file path (default: |
|
Number of variations (default: |
|
Output dimensions |
|
Print raw JSON response |
Queue
The queue lets you submit long-running inference jobs and collect results later, without keeping a connection open. Each user sees only their own jobs.
There are two submission commands depending on whether the job takes a text prompt or a file as input:
Text-in (
chat,embeddings,speech,image_generate): usequeue submitFile-in (
transcribe,translate,image_edit,image_variation): usequeue upload
submit
Submit a text-in job and print its ID:
gseai queue submit qwen2.5-coder "Summarise this paper: ..." -n my-job
# a3f1c7d2-4b5e-...
# Generate speech
gseai queue submit kokoros "Hello, world." --job-type speech -n tts
# Generate an image
gseai queue submit stable-diffusion "A red barn." --job-type image_generate -n barn
# Read the prompt from a file
gseai queue submit qwen2.5-coder -f prompt.txt -n my-job
Flag |
Description |
|---|---|
|
Read the prompt from a file |
|
Human-readable job name (default: |
|
|
|
System prompt ( |
|
Sampling temperature ( |
|
Maximum tokens to generate ( |
upload
Submit a file-in job and print its ID:
# Transcribe an audio file
gseai queue upload whisper lecture.mp3 --job-type transcribe -n lecture
# Translate audio to English
gseai queue upload whisper talk.mp3 --job-type translate -n talk-en
# Generate a variation of an image
gseai queue upload stable-diffusion photo.png --job-type image_variation -n var
# Edit an image with a text instruction
gseai queue upload stable-diffusion photo.png --job-type image_edit \
--prompt "replace the sky with a sunset" -n edit
Flag |
Description |
|---|---|
|
Required. One of |
|
Human-readable job name (default: |
|
Edit instruction ( |
status
Show the current status of a job:
gseai queue status a3f1c7d2-...
gseai queue status a3f1c7d2-... -j # raw JSON
Human-readable output shows job ID, name, type, model, status, token count, timestamps, and the result or error once the job has finished.
Flag |
Description |
|---|---|
|
Print full JSON record |
list
List your jobs with optional filtering:
gseai queue list
gseai queue list --status pending
gseai queue list --job-type speech
gseai queue list --model qwen2.5-coder --limit 50
Output is a table of job ID (first 8 chars), name, type, model, status, and creation time.
Flag |
Description |
|---|---|
|
Filter by status: |
|
Filter by model identifier |
|
Filter by job type ( |
|
Maximum results (default: |
|
Print raw JSON list |
cancel
Cancel a pending job, or all pending jobs:
gseai queue cancel a3f1c7d2-...
# Cancel every pending job at once
gseai queue cancel --all
Only pending jobs can be cancelled. Exits non-zero with an error message if a
specific job is running, already finished, or not found.
Flag |
Description |
|---|---|
|
Cancel all pending jobs; prints a line per job and a total count |
wait
Block until a job finishes and print the result:
gseai queue wait a3f1c7d2-...
gseai queue wait a3f1c7d2-... --interval 30 --timeout 3600
# Save a binary result (speech or image) to a file
gseai queue wait a3f1c7d2-... -o output.mp3
Progress lines are written to stderr; text results go to stdout. Binary results (speech,
images) are saved to the path given by -o, or to {job_id[:8]}.mp3 / .png by
default, and the saved path is printed to stdout.
[14:00:32] pending (0 tokens) ...
[14:01:32] running (142 tokens) ...
[14:18:44] done
Transformers are a type of neural network architecture ...
Exits non-zero if the job finishes with status error or cancelled.
Flag |
Description |
|---|---|
|
Seconds between polls (default: |
|
Maximum seconds to wait before giving up (default: no limit) |
|
Output file path for binary results; defaults to |
|
Print full JSON record instead of result text |
fetch
Download the binary result of an already-done job without polling:
gseai queue fetch a3f1c7d2-... -o speech.mp3
Exits non-zero if the job is not done, has no binary result (text-output job types), or belongs to a different user.
Flag |
Description |
|---|---|
|
Output file path (default: |
run
Submit a text-in job and wait for the result in one command (combines submit + wait):
gseai queue run qwen2.5-coder "Explain quantum entanglement." -n my-job
# Generate speech and save immediately
gseai queue run kokoros "Hello, world." --job-type speech -o hello.mp3
The submitted job ID is printed to stderr so it can be recorded even if you interrupt the
wait. For file-in jobs, use queue upload then queue wait instead.
Flag |
Description |
|---|---|
|
Read the prompt from a file |
|
Human-readable job name (default: |
|
|
|
System prompt ( |
|
Sampling temperature ( |
|
Maximum tokens to generate ( |
|
Seconds between polls (default: |
|
Maximum seconds to wait (default: no limit) |
|
Output file path for binary results; defaults to |
|
Print full JSON record instead of result text |