Route requests only with parameters ZDR endpoints declare, and list them

The gpt-5.6 family's zero-data-retention endpoints declare
max_completion_tokens, so sending max_tokens under require_parameters
excluded every ZDR route and returned HTTP 404 for the whole family.
The cap is retired: the strict schema, the finish_reason check and the
64 KiB read cap already bound the response.

The model fields now offer the provider's public ZDR catalog filtered
by the exact conditions completions are routed under (live endpoint,
strict structured outputs), fetched server-side, cached for an hour,
and served at GET /api/models; the inputs stay free text so an unlisted
model remains usable when the catalog is unreachable.
This commit is contained in:
Lars Nolden
2026-09-12 22:33:34 +02:00
parent 588c16ad19
commit ec99434002
13 changed files with 284 additions and 54 deletions
+20 -17
View File
@@ -12,6 +12,7 @@ import (
"strconv"
"strings"
"sync"
"time"
"unicode/utf8"
"finance-duck/internal/analytics"
@@ -61,23 +62,25 @@ type operational struct {
BankingScope string `json:"banking_scope"`
}
type App struct {
mu sync.Mutex
dir string
journal *journal.Store
index *analytics.Store
indexed string
indexError string
settings Settings
ops operational
bank banking.Provider
classifier classification.Client
previews map[string]Preview
previewRun *previewJob
taxonomies map[string]TaxonomyPreview
csvImports map[string]CSVImport
authStates map[string]authorization
callbackURL string
bankingSettings bankingSettings
mu sync.Mutex
dir string
journal *journal.Store
index *analytics.Store
indexed string
indexError string
settings Settings
ops operational
bank banking.Provider
classifier classification.Client
previews map[string]Preview
previewRun *previewJob
taxonomies map[string]TaxonomyPreview
csvImports map[string]CSVImport
authStates map[string]authorization
callbackURL string
bankingSettings bankingSettings
verifiedModels []classification.VerifiedModel
verifiedModelsAt time.Time
// quotes needs no configuration: it reads a public endpoint, so its zero
// value is the working client and tests replace it with a stub.
quotes quotes.Client