# Straight answers about multi-model APIs

> Each answer starts with the short version, then adds constraints, implementation details, and next steps so an engineering team can verify the decision.

Use this library for category definitions and implementation questions. For current models and prices, the live model catalog remains the source of truth.

## [What is an AI gateway?](https://keeprouter.com/answers/what-is-an-ai-gateway.md)

An AI gateway sits between an application and one or more model APIs. It can centralize authentication, expose compatible request formats, select eligible routes, measure usage, and enforce access or spend boundaries. It does not make different models equivalent or remove the need for application-level evaluation and error handling.

## [What is an OpenAI-compatible API?](https://keeprouter.com/answers/what-is-an-openai-compatible-api.md)

An OpenAI-compatible API implements one or more HTTP routes and response shapes used by OpenAI clients, so an application can often change the base URL, API key, and model ID instead of replacing its SDK. Compatibility is operation-specific: supporting Chat Completions does not automatically imply Responses, embeddings, images, tools, or every parameter.

## [How do I use one API for multiple LLMs?](https://keeprouter.com/answers/how-to-use-one-api-for-multiple-llms.md)

Connect an OpenAI- or Anthropic-compatible client to an AI gateway, authenticate with a gateway key, and set the model to a canonical ID from its live catalog. Keep the endpoint family and model ID configurable, because specialized modalities and model-specific features may require different routes.

## [How can I switch LLM models without changing application code?](https://keeprouter.com/answers/how-to-switch-llm-models-without-changing-code.md)

Keep the SDK and gateway base URL stable, and store the canonical model ID in environment or deployment configuration. You can then promote or roll back an ID without a code release—provided both models support the same route and your evaluation has verified their required behavior.

## [How does LLM API pricing work?](https://keeprouter.com/answers/how-does-llm-api-pricing-work.md)

LLM APIs usually multiply measured usage by published rates: input tokens, output tokens, cached input tokens, or a per-request unit such as an image. Total workload cost depends on the exact model, prompt size, generated output, cache behavior, retries, and failed-request billing rules.

## [Can Claude Code use non-Claude models?](https://keeprouter.com/answers/can-claude-code-use-non-claude-models.md)

Yes, Claude Code can point at an Anthropic-compatible gateway and select a non-Claude model when that model has a configured Messages-compatible route. Set the gateway base URL and token, then test the complete coding workflow because accepting the protocol does not guarantee Claude-equivalent tools, reasoning, vision, or output behavior.

## [What is LLM routing?](https://keeprouter.com/answers/what-is-llm-routing.md)

LLM routing is the policy that chooses which approved model and serving path receives a request. A route can be fixed by model ID, selected by task rules, or chosen from several eligible providers. Good routing is bounded: it defines allowed candidates, retry conditions, cost limits, and evidence for the final choice instead of sending traffic to any available model.

## [What is the difference between an AI gateway and an API gateway?](https://keeprouter.com/answers/ai-gateway-vs-api-gateway.md)

An API gateway manages general service traffic through authentication, routing, rate limits, policy and observability. An AI gateway applies similar controls to model calls, then adds model-aware concerns such as canonical model IDs, provider selection, token usage, streaming events, tool-call continuity, multimodal payloads and AI-specific failover. Some products combine both layers; others place a focused AI gateway behind an existing API gateway.

## [Does an AI gateway add latency?](https://keeprouter.com/answers/does-ai-gateway-add-latency.md)

Yes. An AI gateway adds at least a network and processing hop, so its own overhead cannot be zero. Whether users notice it depends on geography, connection reuse, request size, gateway work, provider time to first token, output length, retries and streaming. Measure the full request path with the same payload and report gateway overhead separately from provider generation time.

## [Is an AI gateway secure?](https://keeprouter.com/answers/is-an-ai-gateway-secure.md)

An AI gateway can improve security by centralizing provider credentials, model allowlists, spend controls and request evidence. It also becomes a sensitive intermediary that may see prompts, files, tool arguments and outputs. Security depends on the deployed architecture, identity controls, logging policy, data retention, encryption, tenant isolation, upstream contracts and the customer's own prompt and tool design.

## [What is LLM API failover?](https://keeprouter.com/answers/what-is-llm-api-failover.md)

LLM API failover is a controlled attempt to complete a request through another approved serving route after the first route fails, times out or becomes unavailable. It is not the same as an unlimited retry, and it should not silently choose an unevaluated model. Safe failover defines eligible routes, retryable conditions, timeout budgets, side-effect protections and evidence for every attempt.

## [How do I choose an AI gateway?](https://keeprouter.com/answers/how-to-choose-an-ai-gateway.md)

Choose an AI gateway by deciding who should own provider accounts, credentials, deployment, routing policy, billing and incident response. Then test the exact endpoint, model, streaming, tools, errors, usage and data policy your application needs. A long feature list is less useful than a short proof that the gateway fits your operating model and production payload.

## [What is a BYOK AI gateway?](https://keeprouter.com/answers/what-is-byok-ai-gateway.md)

A BYOK AI gateway uses model-provider credentials supplied by the customer instead of, or alongside, gateway-funded access. The gateway can centralize routing, logs, limits and policy while the provider account remains yours. BYOK changes who bills inference and who owns the contract, but it does not remove gateway fees, credential risk, logging decisions or provider-specific limits unless the product explicitly says so.

## [When should you use an AI gateway?](https://keeprouter.com/answers/when-should-you-use-an-ai-gateway.md)

Use an AI gateway when several services need shared model access, when credentials and spend controls should be centralized, when teams switch or evaluate models often, or when routing and request evidence should follow one policy. A direct provider integration is often simpler for one stable workload that needs provider-native features and has no shared governance requirement.
