# AI Cost Optimizer Gateway (ACOG) documentation > An OpenAI- and Anthropic-compatible gateway in front of the AI providers you already use. It routes each request to the cheapest model that can do the job, caches what can be reused, and enforces your budgets, model access and data loss prevention rules. Each page below is plain Markdown. The whole ACOG documentation in one file: https://tessarac.com/docs/acog/llms-full.txt. Web version: https://tessarac.com/docs/acog. ## Get started What ACOG is, how it saves money, and your first request in a few minutes. - [What is ACOG?](https://tessarac.com/docs/acog/get-started/overview.md): ACOG is a gateway in front of the AI providers you already use. It lowers what you pay for every request without changing the model or the answer. - [How ACOG saves money](https://tessarac.com/docs/acog/get-started/how-acog-saves-money.md): Every way ACOG lowers the cost of a request, which ones are on by default, and which leave the answer byte-for-byte identical. - [Quickstart](https://tessarac.com/docs/acog/get-started/quickstart.md): Sign in, connect a provider, create a gateway key and send your first request through ACOG in about ten minutes. - [Key concepts](https://tessarac.com/docs/acog/get-started/key-concepts.md): Organizations, provider connections, declared models, the default connection, gateway keys, applications and teams: the vocabulary used in all ACOG docs. - [Use ACOG with coding tools](https://tessarac.com/docs/acog/get-started/coding-tools.md): Point Claude Code, Cursor, VS Code (Continue and Cline) and Zed at ACOG, and avoid the leftover settings that silently bypass it. ## Connect providers Connect Anthropic, OpenAI, Google Vertex AI, AWS Bedrock, Azure OpenAI and custom endpoints, with keys or keyless. - [Connecting providers](https://tessarac.com/docs/acog/providers/overview.md): How provider connections work: platforms and model families, declared models, the default connection, and how ACOG stores your credentials. - [Keyless connections](https://tessarac.com/docs/acog/providers/keyless-connections.md): Connect Google Vertex AI and Anthropic without storing any key: ACOG signs a short-lived identity token that your cloud account trusts. - [Anthropic](https://tessarac.com/docs/acog/providers/anthropic.md): Connect the Anthropic API to ACOG with an API key, or keyless with Anthropic workload identity federation so no key is stored anywhere. - [Google Vertex AI](https://tessarac.com/docs/acog/providers/google-vertex-ai.md): Connect Claude and Gemini on Vertex AI with a service account key or keyless with workload identity federation, and control where requests run. - [AWS Bedrock](https://tessarac.com/docs/acog/providers/aws-bedrock.md): Connect AWS Bedrock to ACOG with access keys or a role ACOG assumes, including GovCloud, batch processing and native boto3 access. - [OpenAI](https://tessarac.com/docs/acog/providers/openai.md): Connect the OpenAI API to ACOG with your own API key and call GPT models through either the OpenAI or the Anthropic API shape. - [Azure OpenAI](https://tessarac.com/docs/acog/providers/azure-openai.md): Connect an Azure OpenAI resource to ACOG, including Azure Government, and name deployments so ACOG can route to them by model. - [Custom endpoints](https://tessarac.com/docs/acog/providers/custom-endpoints.md): Connect any OpenAI-compatible server to ACOG: Ollama, vLLM, llama.cpp, DeepSeek, or a gateway of your own. - [Routing and failover](https://tessarac.com/docs/acog/providers/routing-and-failover.md): How ACOG chooses the connection that serves a request, when it spreads load and fails over, and how to pin a request to one platform. ## Call the API Base URLs, authentication, the compatible APIs, native provider routes, streaming, batches and errors. - [Base URLs and authentication](https://tessarac.com/docs/acog/api/base-urls-and-authentication.md): The gateway's base URLs for each SDK, the headers ACOG reads your gateway key from, request limits and request IDs. - [Chat Completions (OpenAI-compatible)](https://tessarac.com/docs/acog/api/chat-completions.md): POST /v1/chat/completions: the OpenAI Chat Completions API, served by any model you have connected, with tools, images and streaming. - [Messages (Anthropic-compatible)](https://tessarac.com/docs/acog/api/messages.md): POST /v1/messages: the Anthropic Messages API, served by any model you have connected, with tools, images, extended thinking and streaming. - [Responses](https://tessarac.com/docs/acog/api/responses.md): POST /responses: a minimal OpenAI Responses API bridge for simple prompts on any model. Use the native OpenAI route for the full Responses API. - [Embeddings](https://tessarac.com/docs/acog/api/embeddings.md): POST /v1/embeddings: the OpenAI Embeddings API through ACOG, for embedding models on OpenAI, Azure OpenAI and OpenAI-compatible connections. - [Models](https://tessarac.com/docs/acog/api/models.md): GET /v1/models: list the models your gateway key can use. It makes no provider call and costs nothing, so it is also the quickest way to test a key. - [Native provider routes](https://tessarac.com/docs/acog/api/native-routes.md): Use each provider's own API and SDK through ACOG, byte for byte: Anthropic, OpenAI, Vertex AI, Bedrock, Azure OpenAI and custom endpoints. - [Streaming](https://tessarac.com/docs/acog/api/streaming.md): Stream responses through ACOG with server-sent events, on every route and across API shapes, and what to expect from timeouts and keep-alives. - [Batches](https://tessarac.com/docs/acog/api/batches.md): Run requests on your provider's batch tier at about half price with one header or a model suffix, and collect the result inline or by polling a job. - [Management API](https://tessarac.com/docs/acog/api/management-api.md): Automate ACOG administration with the REST API behind the console: connections, keys, budgets, webhooks, usage and savings. ## Optimize cost Auto mode, prompt caching, the semantic cache, batch routing and how savings are measured. - [Auto mode](https://tessarac.com/docs/acog/optimize/auto-mode.md): Send model: auto and ACOG grades each request and routes it to the cheapest model strong enough to answer it, across every provider you have connected. - [Caching](https://tessarac.com/docs/acog/optimize/caching.md): The response cache, in-flight de-duplication and your provider's prompt caching: what each one saves, when it applies and how to control it. - [Semantic cache](https://tessarac.com/docs/acog/optimize/semantic-cache.md): Answer a prompt that means the same as an earlier one from the earlier answer, above a similarity threshold, and never from a weaker model. - [Batch routing](https://tessarac.com/docs/acog/optimize/batch-routing.md): ACOG can send requests nobody is waiting for to your provider's half-price batch tier automatically, and only when it is safe and actually cheaper. - [Cost arbitrage](https://tessarac.com/docs/acog/optimize/cost-arbitrage.md): Send a model that runs on several platforms to the cheapest one for you, counting your committed-use discounts and credits. The model never changes. - [Prompt cleanup](https://tessarac.com/docs/acog/optimize/request-cleanup.md): Two lossless reductions ACOG makes to requests: whitespace and invisible-character cleanup, and removal of duplicated retrieval chunks. - [How savings are measured](https://tessarac.com/docs/acog/optimize/savings-measurement.md): How ACOG computes what each request cost, what it would have cost sent directly, and the saving you can check against your provider invoices. ## Govern and secure Model access, budgets, rate limits, data loss prevention and prompt injection protection. - [Model access](https://tessarac.com/docs/acog/govern/model-access.md): Decide which models your organization, each team, each person and each service key may use, with allow and deny lists that only ever narrow. - [Budgets](https://tessarac.com/docs/acog/govern/budgets.md): Set daily, weekly or monthly spending limits for the organization, a team or a person, with warnings in responses before anything is blocked. - [Rate limits](https://tessarac.com/docs/acog/govern/rate-limits.md): Cap requests and tokens per minute for the organization, an application, a team, a person or a service key. - [Data loss prevention](https://tessarac.com/docs/acog/govern/data-loss-prevention.md): Detect card numbers, secrets, personal data and your own code in prompts before they reach a model, and record, mask, re-route or block them. - [Prompt injection protection](https://tessarac.com/docs/acog/govern/prompt-injection.md): Screen prompts for injection and jailbreak attempts, log them or block them, and review every attempt caught. - [Activity and audit log](https://tessarac.com/docs/acog/govern/activity-and-audit-log.md): See every request made through the gateway and who made it, read stored conversations, and review every administrative change. ## Administer Users, teams, single sign-on, keys, webhooks, observability, notifications and billing. - [Users and invitations](https://tessarac.com/docs/acog/administer/users-and-invitations.md): Invite people to your organization, give them roles, change or remove them, and view the console as another member. - [Teams](https://tessarac.com/docs/acog/administer/teams.md): Group members below the organization so you can give each team its own budget, rate limits and model access. - [Single sign-on](https://tessarac.com/docs/acog/administer/single-sign-on.md): Let your team sign in to ACOG through your identity provider over OIDC or SAML, with roles mapped from groups and sign-in routed by email domain. - [API keys](https://tessarac.com/docs/acog/administer/api-keys.md): Create gateway keys for people and services, limit their permissions and source networks, attribute their traffic, and revoke them. - [Applications](https://tessarac.com/docs/acog/administer/applications.md): Name the applications that use the gateway, attribute their traffic through their keys, and control what they send to Langfuse. - [Webhooks](https://tessarac.com/docs/acog/administer/webhooks.md): Receive signed HTTPS notifications when a budget is crossed, an invoice is issued, a request is refused by policy or a key is revoked. - [Observability](https://tessarac.com/docs/acog/administer/observability.md): Send a trace for every request to Langfuse or any OpenTelemetry collector, with tags, filtering and control over whether prompt text leaves the gateway. - [Billing](https://tessarac.com/docs/acog/administer/billing.md): How the hosted service bills a share of measured savings, monthly invoices, payment methods, account credit and pass-through mode. - [Organization and gateway settings](https://tessarac.com/docs/acog/administer/organization-and-gateway-settings.md): Your organization's profile and ID, and the gateway settings that decide what ACOG may cache, trim or batch for your traffic. - [Notifications and the assistant](https://tessarac.com/docs/acog/administer/notifications-and-assistant.md): What the notification bell tells you, and how the built-in assistant answers questions about your usage, spend and reports. - [Your account](https://tessarac.com/docs/acog/administer/your-account.md): Your profile and sign-in security: password, two-factor authentication, recovery codes and passkeys. ## Self-hosted Run ACOG in your own environment: requirements, installation, configuration, licensing and upgrades. - [Self-hosted overview](https://tessarac.com/docs/acog/self-hosted/overview.md): What a self-hosted ACOG installation runs, what it needs from your environment, what it connects to, and how it is licensed. - [Install on Kubernetes](https://tessarac.com/docs/acog/self-hosted/kubernetes.md): Install ACOG with its Helm chart: write your overlay, render and check it, install, sign in as the first administrator and load your licence. - [Configuration](https://tessarac.com/docs/acog/self-hosted/configuration.md): The settings every self-hosted ACOG installation needs: secrets, production mode, public address, email, trusted proxies, the semantic cache and DLP models. - [Licensing](https://tessarac.com/docs/acog/self-hosted/licensing.md): What the licence switches on, the three offline ways to load it, how to check it, and how renewal works without your installation contacting anyone. - [Self-hosted keyless connections](https://tessarac.com/docs/acog/self-hosted/install-identity.md): Offer keyless Vertex AI and Anthropic connections from your own installation: its issuer address, uploaded key sets, and the installation's own identity. - [Upgrades](https://tessarac.com/docs/acog/self-hosted/upgrades.md): Upgrade a self-hosted ACOG installation safely: back up, read the new overlay, render, upgrade with every values file, and know what a rollback can undo. - [Without Kubernetes](https://tessarac.com/docs/acog/self-hosted/without-kubernetes.md): Running ACOG on virtual machines: what is and is not supported, the processes to run, the start order and the constraints that matter. ## Reference Roles and permissions, error codes, response headers and a glossary. - [Errors](https://tessarac.com/docs/acog/reference/errors.md): Every error ACOG itself returns, with its HTTP status, type, extra fields, cause and what to do. Errors from your provider are passed through unchanged. - [Request headers](https://tessarac.com/docs/acog/reference/request-headers.md): Every request header ACOG reads: authentication, routing, batching, caching, labels, tracing, sessions and fallback control. - [Response headers](https://tessarac.com/docs/acog/reference/response-headers.md): The headers ACOG adds to responses: the model that answered, cache hits, budget warnings, fallbacks and features removed for compatibility. - [Roles and permissions](https://tessarac.com/docs/acog/reference/roles-and-permissions.md): The twelve permissions, the built-in admin, auditor and member roles, custom roles, and how permissions apply to API keys. - [Glossary](https://tessarac.com/docs/acog/reference/glossary.md): The terms used across the ACOG documentation and console, from active and auto mode to wire shape and workload identity.