openai

package
v0.2.57 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MPL-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, the absence of OpenRouter's accounting headers, and JSON mode for a schema call (see jsonMode).

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