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
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.