v1

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package v1 implements the OpenAI-compatible /v1/... API endpoints.

Incoming requests are:

  1. Authenticated via the Internal Token Service
  2. Validated against the token's rules (allowed models)
  3. Routed to the appropriate provider by the Router Service
  4. Translated back to OpenAI-compatible responses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler holds the dependencies for the v1 API.

func New

func New(tokens *token.Service, routerSvc *router.Service, metricsSvc *metrics.Service, providerSvc *provider.Service, modelInfoSvc *modelinfo.Service, virtualSvc *virtual.Service, logger *slog.Logger) *Handler

New constructs a v1 Handler.

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux)

Register mounts all /v1 routes onto mux. Safe endpoints (GET /v1/models) are whitelisted to allow anonymous access.

Jump to

Keyboard shortcuts

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