openai

package
v0.2.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL