Copy the regional Base URL and model ID. This example requires a Responses-compatible model. JavaScript examples run on the Node.js server, not in a browser.
Stream output
Reuse the configured client above with automatic retries disabled and listen for text deltas. Streaming requires a compatible route.
Chat Completions
For a chat-completions model, use client.chat.completions.create. See Chat Completions for the request and streaming format.
Default SDK retries can duplicate generation and charges. Set max_retries=0 in Python or maxRetries: 0 in JavaScript, as shown. After an interruption, check request logs and any stored response before submitting another call.
The SDK is a client. Actual features and limits depend on the Codeflare model and channel configuration.