Documentation
¶
Overview ¶
Package openai is a native OpenAI-direct ai://chat backend.
It speaks the OpenAI chat-completions API directly (https://api.openai.com/v1/chat/completions) using the same OPENAI_KEY secret the ai://embed openai backend uses — so a tenant that embeds with OpenAI can also chat with OpenAI under one key/account, instead of routing chat through a second provider. Mirror of chassis/chat/openrouter (the API is the same OpenAI-compatible shape); the only differences are the endpoint, the secret name, the default model, and the absence of OpenRouter's accounting headers.
The backend self-registers in init() under the name "openai"; the chassis activates it with a blank import in the main package.
**Leak posture** is identical to the openrouter backend: the cleartext key is read from the SecretBag once per Run, set only on the outbound Authorization header, never stored / logged / traced, and any auth-error body is discarded.