Directories
¶
| Path | Synopsis |
|---|---|
|
observability
Package observability is a true leaf (stdlib-only) holding cross-cutting counters that lower layers (scheduler) must record without importing handler/shared or app.
|
Package observability is a true leaf (stdlib-only) holding cross-cutting counters that lower layers (scheduler) must record without importing handler/shared or app. |
|
Package auth provides admin and downstream proxy authentication middleware with IP allowlisting and rate limiting.
|
Package auth provides admin and downstream proxy authentication middleware with IP allowlisting and rate limiting. |
|
cmd
|
|
|
migrate
command
Command metapi-migrate is a standalone tool that transfers all 18 application tables between a SQLite database and a PostgreSQL database (either direction).
|
Command metapi-migrate is a standalone tool that transfers all 18 application tables between a SQLite database and a PostgreSQL database (either direction). |
|
server
command
|
|
|
Package config loads and validates all server configuration from environment variables.
|
Package config loads and validates all server configuration from environment variables. |
|
Package e2e contains end-to-end integration tests for the proxy pipeline.
|
Package e2e contains end-to-end integration tests for the proxy pipeline. |
|
handler
|
|
|
admin
Package admin implements the REST API handlers for the admin dashboard.
|
Package admin implements the REST API handlers for the admin dashboard. |
|
proxy
Package proxyhandler implements the OpenAI-compatible proxy endpoint handlers.
|
Package proxyhandler implements the OpenAI-compatible proxy endpoint handlers. |
|
shared
Package shared provides common HTTP handler utilities used across admin and proxy handler packages.
|
Package shared provides common HTTP handler utilities used across admin and proxy handler packages. |
|
internal
|
|
|
version
Package version exposes the build-time version of the metapi binary.
|
Package version exposes the build-time version of the metapi binary. |
|
Package proxy implements the dual-loop proxy orchestration core with channel retry, session leasing, and failure classification.
|
Package proxy implements the dual-loop proxy orchestration core with channel retry, session leasing, and failure classification. |
|
types
Package types holds shared type definitions for the proxy module.
|
Package types holds shared type definitions for the proxy module. |
|
Package routing implements the token-based channel selection engine with Fibonacci backoff cooldown and weighted random distribution.
|
Package routing implements the token-based channel selection engine with Fibonacci backoff cooldown and weighted random distribution. |
|
Package scheduler manages background job schedulers for checkin, balance, cleanup, and aggregation.
|
Package scheduler manages background job schedulers for checkin, balance, cleanup, and aggregation. |
|
Package service contains the business logic layer: checkin, balance, notify, OAuth, and backup services.
|
Package service contains the business logic layer: checkin, balance, notify, OAuth, and backup services. |
|
adapter
Package adapter defines the platform adapter interface and registry.
|
Package adapter defines the platform adapter interface and registry. |
|
pricing
Package pricing provides pure, database-free functions for normalizing upstream pricing signals into a canonical product model and converting pricing multipliers (ratios) into USD per million tokens.
|
Package pricing provides pure, database-free functions for normalizing upstream pricing signals into a canonical product model and converting pricing multipliers (ratios) into USD per million tokens. |
|
Package store provides the database layer with SQLite and PostgreSQL dual-dialect support.
|
Package store provides the database layer with SQLite and PostgreSQL dual-dialect support. |
|
Package transform provides protocol conversion between OpenAI, Anthropic, Gemini, and Codex formats via a canonical intermediate representation.
|
Package transform provides protocol conversion between OpenAI, Anthropic, Gemini, and Codex formats via a canonical intermediate representation. |
|
anthropic/messages
Package messages provides Anthropic Messages API transformer.
|
Package messages provides Anthropic Messages API transformer. |
|
canonical
Package canonical defines the protocol-agnostic intermediate representation used by MetAPI to convert between downstream client formats (OpenAI, Anthropic, Gemini) and upstream provider formats.
|
Package canonical defines the protocol-agnostic intermediate representation used by MetAPI to convert between downstream client formats (OpenAI, Anthropic, Gemini) and upstream provider formats. |
|
openai/chat
Package chat provides OpenAI Chat Completions API transformer.
|
Package chat provides OpenAI Chat Completions API transformer. |
|
openai/completions
Package completions provides OpenAI Completions (legacy) transformer — pass-through.
|
Package completions provides OpenAI Completions (legacy) transformer — pass-through. |
|
openai/embeddings
Package embeddings provides OpenAI Embeddings transformer — pass-through.
|
Package embeddings provides OpenAI Embeddings transformer — pass-through. |
|
openai/images
Package images provides OpenAI Images transformer — pass-through.
|
Package images provides OpenAI Images transformer — pass-through. |
|
openai/responses
Package responses provides OpenAI Responses API transformer and compact mode.
|
Package responses provides OpenAI Responses API transformer and compact mode. |
|
shared
Package shared provides types and utilities shared across all transformer providers.
|
Package shared provides types and utilities shared across all transformer providers. |
|
Package web bundles the built React SPA frontend via go:embed.
|
Package web bundles the built React SPA frontend via go:embed. |
Click to show internal directories.
Click to hide internal directories.