Skip to main content
gumloop chat completions create is the terminal counterpart of the Python SDK call client.chat.completions.create(...). Every flag maps 1:1 to the matching SDK kwarg.

Create a completion

By default, output streams to your terminal when stdout is a TTY. When it isn’t, for example when piped to a file or another command, the CLI buffers the output into a single response. Pass --stream or --no-stream to be explicit. A structured request can also set stream; explicit flags take precedence.

Pipe from stdin

Structured output

capital.schema.json:

Image generation

The response carries one or more image attachments on choices[0].message.images. Each entry is a data URL the caller can decode or render directly. Human output prints text. Use --json to retain images, including choices[0].delta.images in streamed chunks. Image generation options belong in image_config in a structured request.

Structured requests and vision

--args-file accepts the SDK’s full request shape: conversation history, multimodal message content, tool definitions and tool results, reasoning options, and provider-supported generation settings. Explicit command flags override corresponding request fields. Check the selected model’s supported inputs and outputs.
Replace the placeholders with a vision-capable model ID and an encoded image. Vision analyzes an input image. Text-to-image generation uses an image-capable model and the image output modalities described above. Reference-image editing additionally requires the backend image-input adapter and a supported image-generation model. Supply inline base64 image_url content with image output modalities. Remote image URLs and storage paths are refused by that adapter; MIME, decoded size, and model limits apply. This capability depends on backend deployment rather than the CLI installation alone.

Streaming with machine output

--stream --json emits ndjson, one full chat.completion.chunk per line, so consumers can stitch deltas without re-parsing the full SSE wire format.
Without an explicit streaming setting, the CLI streams to TTYs and uses unary output for redirects and pipes.