Skip to main content
Direct Flint API access is limited to select partners. These examples also apply to a compatible local server. Flint endpoints use an OpenAI-compatible chat-completions interface. Configure the base URL, key, and model ID using the partner API quickstart. The code below reads the hosted key from NEBIUS_API_KEY. To adapt it for a local server, set the local base URL and model, then replace the key lookup with os.environ["LOCAL_API_KEY"]. Use local for the unauthenticated llama.cpp examples, or the token returned by rec auth token for rec.

Stream a response

This example displays answer text. Some endpoints expose reasoning in a separate field, so a delay before answer text does not necessarily mean the connection has stalled. Reasoning-field names and streaming behavior depend on the serving stack.

Request configuration

Do not assume every parameter accepted by another compatible API is supported here. In particular, reasoning-effort controls and schema-constrained output are not established hosted features.

Handle errors

After an interrupted agent request, inspect tool execution state before retrying so a write or external action is not accidentally repeated.

Hosted data handling

Hosted requests leave your device. Use your provider’s applicable terms for retention, logging, and training use; local execution does not establish the policy of a hosted endpoint. Pricing, rate limits, and regions are also provider-specific.