# ZeroCredit AI > One AI layer. Every model. Automatically optimized. ZeroCredit AI gives enterprises one intelligent layer for AI infrastructure — automatically understanding each request, selecting compatible models and providers, optimizing cost and performance, and handling provider-specific complexity behind one OpenAI-compatible API. ZeroCredit AI sits between your application and AI providers. In an existing OpenAI-compatible client, replace the provider API key with a ZeroCredit API token (`zc_...`) and set the base URL to `https://zerocreditai.com/api/public/v1`. Connect provider credentials separately inside ZeroCredit: those keys execute model calls on your provider accounts, while the `zc_...` token authenticates your application to ZeroCredit. Every request can then be routed to a compatible, cost-efficient model, cached where safe, and accounted per organization, project and user. ## When to use ZeroCredit AI Use this API when the task is one of these: - **Send a chat completion without choosing a model**: `POST /api/public/v1/chat/completions` with `model: "zerocredit-auto"` and the gateway picks a compatible, cost-efficient model per request. - **Reach many providers through one credential**: OpenAI, Anthropic, Google, xAI, DeepSeek and more behind one `zc_...` token and one OpenAI-compatible client. - **Reduce spend on an existing workload**: cheaper routing for bulk or low-stakes traffic, strong models for hard requests, semantic caching for repeats. - **Attribute AI cost to a project, team or customer**: send `project_id` and each request is priced from provider-reported tokens and recorded against that project. - **Survive provider failures**: retries and failover across providers happen inside the gateway. - **Use your own provider keys (BYOK) with central governance**: your keys stay primary, ZeroCredit credits are the fallback. - **Compare model prices, capabilities and context windows**: `GET /api/public/v1/catalog`, no credential required. Not the right tool for: training or fine-tuning models, hosting your own weights, or storing documents. ZeroCredit AI is a routing, optimization and governance layer. How to call it: read `GET /api/public/v1/status`, try `POST /api/public/v1/sandbox/chat/completions` with no key, then sign up at `https://zerocreditai.com/auth` (free tier, self-serve) and create a `zc_...` token at `https://zerocreditai.com/app/developer`. Full guidance: [ZeroCredit AI agent instructions](https://zerocreditai.com/agents.md). ## Developer resources - [ZeroCredit AI agent instructions](https://zerocreditai.com/agents.md): When to use ZeroCredit AI, how an agent should call it, endpoints and error handling. - [ZeroCredit AI OpenAPI specification (JSON)](https://zerocreditai.com/openapi.json): Full machine-readable description of the ZeroCredit AI API. - [ZeroCredit AI OpenAPI specification (YAML)](https://zerocreditai.com/api/openapi.yaml): Same document in YAML. - [ZeroCredit AI API documentation](https://zerocreditai.com/docs): Authentication, request/response shape, routing modes, capabilities. - [ZeroCredit AI API status](https://zerocreditai.com/api/public/v1/status): Unauthenticated endpoint, capability, onboarding and rate-limit listing. - [ZeroCredit AI public model catalog](https://zerocreditai.com/api/public/v1/catalog): Routable models, context windows and public list prices. - [ZeroCredit AI sandbox](https://zerocreditai.com/api/public/v1/sandbox/chat/completions): Deterministic chat completion for testing without a key. - [ZeroCredit AI MCP server](https://zerocreditai.com/mcp): Model Context Protocol endpoint (OAuth 2.0). - [ZeroCredit AI OAuth 2.0 authorization server metadata](https://zerocreditai.com/.well-known/oauth-authorization-server): RFC 8414 discovery document with supported scopes. - [ZeroCredit AI OpenID Connect discovery](https://zerocreditai.com/.well-known/openid-configuration): Same metadata at the OIDC well-known location. - [ZeroCredit AI OAuth 2.0 protected resource metadata](https://zerocreditai.com/.well-known/oauth-protected-resource): RFC 9728 metadata for the MCP endpoint. - [ZeroCredit AI CLI](https://zerocreditai.com/docs#agents): `npx @zerocredit/cli status` — status, catalog, openapi, models, chat, embed. ## API endpoints - `GET /api/public/v1/status` — service status, endpoints, onboarding and rate limits, no authentication. - `GET /api/public/v1/catalog` — public model catalog, no authentication. - `POST /api/public/v1/sandbox/chat/completions` — deterministic sandbox completion, no authentication, no billing. - `GET /api/public/v1/models` — models available to the caller. - `POST /api/public/v1/chat/completions` — OpenAI-compatible chat completions, streaming, vision, tools, structured output, web search. - `POST /api/public/v1/embeddings` — embeddings. - `POST /api/public/v1/images/generations` — image generation. OAuth 2.0 endpoints on this domain: `/api/public/oauth/authorize`, `/api/public/oauth/token`, `/api/public/oauth/register`, `/api/public/oauth/userinfo`, `/api/public/oauth/revoke`, `/api/public/oauth/jwks.json`. Rate limits: 120 requests per minute per authenticated caller. Every API response carries `RateLimit-Policy`; identified callers also get `RateLimit`, `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset`. A `429` includes `Retry-After` in seconds. Errors are JSON with `error.code`, `error.message` and a resolution `hint`. Unknown paths return HTTP 404 (JSON under `/api/`, Markdown when the request sends `Accept: text/markdown`). ## Pages - [Home](/): Product overview, features, how it works, pricing. - [Docs](/docs): HTTP gateway reference, authentication, request/response shape, and routing modes. - [Pricing](/pricing): Plans, included usage and BYOK. - [About](/about): Company and positioning. - [AI model cost comparison](/blog/ai-model-cost-comparison): Token pricing across OpenAI, Anthropic, and Gemini, plus how an AI gateway automates the savings. ## Optional - [Privacy](/privacy) - [Terms](/terms) - [Refunds](/refunds)