# ai& API Documentation > OpenAI- and Anthropic-compatible inference platform serving open-weight LLMs from our own infrastructure. The full corpus is at /llms-full.txt. ## Analytics - [Request Logs](https://aiand-docs-staging.pages.dev/analytics/logs/): Per-request log rows for your organization — cursor-paginated. - [Metrics](https://aiand-docs-staging.pages.dev/analytics/metrics/): Time-series usage data for your organization — requests, tokens, latency, cost. - [Summary](https://aiand-docs-staging.pages.dev/analytics/summary/): Aggregated totals for your organization over a time range. ## API - [Chat Completions](https://aiand-docs-staging.pages.dev/api/chat-completions/): Generate model responses for conversations. - [Completions (retired)](https://aiand-docs-staging.pages.dev/api/completions/): The legacy /v1/completions endpoint has been removed. Use Chat Completions instead. - [Lifecycle & Expiry](https://aiand-docs-staging.pages.dev/api/file-lifecycle/): How long uploaded files live, when they're cleaned up, and how to delete them yourself. - [File Purposes](https://aiand-docs-staging.pages.dev/api/file-purposes/): How ai& categorizes uploaded files and gates which models can consume them. - [OpenAI vs Anthropic shape](https://aiand-docs-staging.pages.dev/api/file-shapes/): The Files endpoints dual-emit OpenAI- and Anthropic-shaped responses on the same path, selected by request header. - [Files](https://aiand-docs-staging.pages.dev/api/files/): Upload and reference assets (images, video, and audio) for use in inference requests. - [Messages (Anthropic)](https://aiand-docs-staging.pages.dev/api/messages/): Anthropic Messages API compatibility layer. - [Models](https://aiand-docs-staging.pages.dev/api/models/): List available models and pricing. - [Responses](https://aiand-docs-staging.pages.dev/api/responses/): Generate model responses with the OpenAI Responses API format. - [Uploads](https://aiand-docs-staging.pages.dev/api/uploads/): Chunked upload API for files larger than the single-shot /v1/files cap. Drop-in compatible with the OpenAI Uploads API. - [Videos](https://aiand-docs-staging.pages.dev/api/videos/): Generate video clips from a text prompt with an asynchronous job API. ## Overview - [Authentication](https://aiand-docs-staging.pages.dev/authentication/): API key and JWT authentication for the ai& API. - [ai& CLI](https://aiand-docs-staging.pages.dev/cli/): Sign in, open coding agents on ai&, run prompts, and check models, logs, and usage from your terminal. - [Error Codes](https://aiand-docs-staging.pages.dev/errors/): Error response format and status codes. - [Quick Start](https://aiand-docs-staging.pages.dev/getting-started/): From zero to your first ai& API call in five minutes. - [ai& API Documentation](https://aiand-docs-staging.pages.dev/): OpenAI-compatible inference API with built-in billing. - [Migrating from Anthropic](https://aiand-docs-staging.pages.dev/migrating-anthropic/): Point your existing Anthropic SDK code at the ai& API by changing two lines. - [Migrating from OpenAI](https://aiand-docs-staging.pages.dev/migrating-openai/): Point your existing OpenAI SDK code at the ai& API by changing two lines. ## Billing - [Balance API](https://aiand-docs-staging.pages.dev/billing/balance/): Query your organization's remaining prepaid credit with an API key. - [Coupons](https://aiand-docs-staging.pages.dev/billing/coupons/): Apply a promotion code at checkout to get discounted credits. - [Credits & Top-Up](https://aiand-docs-staging.pages.dev/billing/credits/): How to add credit to your ai& organization and how it's consumed. - [Invoices & Receipts](https://aiand-docs-staging.pages.dev/billing/invoices/): Download invoices and receipts for credit purchases. - [Payment Methods](https://aiand-docs-staging.pages.dev/billing/payment-methods/): Manage credit cards and other payment methods on your ai& account. - [Redemption Codes](https://aiand-docs-staging.pages.dev/billing/redemption-codes/): Redeem an event code to add credits without a card or a Stripe checkout. - [Refund Policy](https://aiand-docs-staging.pages.dev/billing/refunds/): When credits can be refunded and how unused balance is handled. - [Usage Tracking](https://aiand-docs-staging.pages.dev/billing/usage/): See how your credits are being spent, by model and over time. ## Capabilities - [Reasoning](https://aiand-docs-staging.pages.dev/capabilities/reasoning/): Where a reasoning model's reasoning comes back on each endpoint, and how to set its effort. - [Streaming](https://aiand-docs-staging.pages.dev/capabilities/streaming/): Receive model output incrementally over Server-Sent Events. - [Structured Outputs](https://aiand-docs-staging.pages.dev/capabilities/structured-outputs/): Constrain model output to a JSON Schema for reliable parsing. - [Tool Calling](https://aiand-docs-staging.pages.dev/capabilities/tool-calling/): Let models invoke functions you define to fetch data or take actions. - [Video Understanding](https://aiand-docs-staging.pages.dev/capabilities/video/): Send video clips to video-capable models via uploaded file_id or an inline URL. - [Vision](https://aiand-docs-staging.pages.dev/capabilities/vision/): Send images to vision-capable models — by URL, base64, or uploaded file_id. ## Cookbook - [Structured Extraction](https://aiand-docs-staging.pages.dev/cookbook/extraction/): Pull typed entities out of unstructured text using a JSON Schema. - [Chat over Documents (RAG)](https://aiand-docs-staging.pages.dev/cookbook/rag/): Ground model answers in your own documents — either by stuffing the corpus into context, or with retrieval when it doesn't fit. - [Streaming Chat UI](https://aiand-docs-staging.pages.dev/cookbook/streaming-ui/): A Next.js route that proxies an ai& streaming chat completion to the browser. - [Tool-Calling Agent](https://aiand-docs-staging.pages.dev/cookbook/tool-agent/): A minimal agent loop that lets the model call your Python functions until the task is done. - [Vision Extraction](https://aiand-docs-staging.pages.dev/cookbook/vision-extraction/): Upload a receipt, get back structured line items — combines Files, Vision, and Structured Outputs. ## Integrations - [Claude Code](https://aiand-docs-staging.pages.dev/integrations/claude-code/): Use ai& as the model backend for Claude Code, Anthropic's agentic coding CLI. - [Cline](https://aiand-docs-staging.pages.dev/integrations/cline/): Use ai& with Cline's built-in provider. - [Cloudflare AI Gateway](https://aiand-docs-staging.pages.dev/integrations/cloudflare-ai-gateway/): Put Cloudflare AI Gateway in front of ai& with a custom provider. - [Codex](https://aiand-docs-staging.pages.dev/integrations/codex/): Use ai& as the model backend for OpenAI Codex, the agentic coding CLI. - [CrewAI](https://aiand-docs-staging.pages.dev/integrations/crewai/): Run CrewAI multi-agent workflows on ai&. - [Cursor](https://aiand-docs-staging.pages.dev/integrations/cursor/): Use ai& as the model backend for Cursor's Agent mode via BYOK (Bring Your Own Key). - [Kilo Code](https://aiand-docs-staging.pages.dev/integrations/kilo-code/): Use ai& as an OpenAI-compatible provider in Kilo Code for VS Code, JetBrains, and the CLI. - [LangChain](https://aiand-docs-staging.pages.dev/integrations/langchain/): Use ai& as the LLM provider in LangChain / LangGraph apps. - [LlamaIndex](https://aiand-docs-staging.pages.dev/integrations/llamaindex/): Use ai& as the LLM in LlamaIndex pipelines and agents. - [OMP](https://aiand-docs-staging.pages.dev/integrations/omp/): Use ai& with OMP's built-in provider. - [OpenAI Agents SDK](https://aiand-docs-staging.pages.dev/integrations/openai-agents/): Run the OpenAI Agents SDK against ai& by swapping the base URL. - [OpenCode](https://aiand-docs-staging.pages.dev/integrations/opencode/): Use ai& in OpenCode's terminal, CLI, and desktop app. ai& is a built-in OpenCode provider, so setup is as easy as pasting an API key. - [PydanticAI](https://aiand-docs-staging.pages.dev/integrations/pydantic-ai/): Use ai& with PydanticAI for type-safe agents and structured outputs. - [Vercel AI SDK](https://aiand-docs-staging.pages.dev/integrations/vercel-ai/): Use ai& with the Vercel AI SDK for Next.js streaming UIs and React Server Components. ## Models - [Automatic Model Selection](https://aiand-docs-staging.pages.dev/models/auto/): Send `auto` as the model and ai& resolves it per request to one of the models your organization can call. - [Model Catalog](https://aiand-docs-staging.pages.dev/models/catalog/): The models available on ai&, with capabilities, context windows, and per-million-token prices. - [Pricing](https://aiand-docs-staging.pages.dev/models/pricing/): How per-token pricing works, where to find rates, and how billing is computed per request. ## Organizations - [Organization API Keys](https://aiand-docs-staging.pages.dev/organizations/api-keys/): Create and manage API keys scoped to an organization. - [Organizations](https://aiand-docs-staging.pages.dev/organizations/concepts/): How ai& models users, organizations, memberships, and billing scope. - [Members & Roles](https://aiand-docs-staging.pages.dev/organizations/members/): Invite collaborators to your organization and control what they can do. - [Switching Orgs](https://aiand-docs-staging.pages.dev/organizations/switching/): How to pick the active organization when calling the ai& API. - [Zero Data Retention](https://aiand-docs-staging.pages.dev/organizations/zero-data-retention/): An organization setting under which ai& stores none of your prompts, responses or uploads once a request finishes. ## Reference - [Rate Limits](https://aiand-docs-staging.pages.dev/reference/rate-limits/): Per-organization request and token rate limits, by tier. - [Response Headers](https://aiand-docs-staging.pages.dev/reference/response-headers/): The custom headers ai& adds to responses, and how to opt in to per-request cost metrics. - [Streaming Events](https://aiand-docs-staging.pages.dev/reference/streaming-events/): The SSE events ai& emits, including the trailing metrics event. ## SDKs - [ai& SDK](https://aiand-docs-staging.pages.dev/sdks/aiand/): Official first-party ai& SDKs for Python and TypeScript. - [Anthropic SDK](https://aiand-docs-staging.pages.dev/sdks/anthropic/): Use the official anthropic Python and Node SDKs against ai&. - [curl](https://aiand-docs-staging.pages.dev/sdks/curl/): Call the ai& API directly with curl — useful for testing and shell scripts. - [OpenAI SDK](https://aiand-docs-staging.pages.dev/sdks/openai/): Use the official openai Python and Node SDKs against ai&.