# APIMODELS documentation (full text) APIMODELS (apimodels.app) is a stable, affordable multimodal API gateway: one API key and one USD balance for image, video, audio and LLM models; failed tasks are not charged. This file is every English docs page converted to Markdown, 97 pages, separated by horizontal rules; each starts with its source URL. Code examples here are the cURL versions; each page's .md twin also has the Python and Node.js versions. Index with one line per page: https://apimodels.app/llms.txt · Model list: https://api.apimodels.app/v1/models · OpenAPI: https://api.apimodels.app/openapi.json ## Official domain and brand notice APIMODELS (API Models) operates at apimodels.app. Official API base URL: https://api.apimodels.app/v1. Support: support@apimodels.app. APIMODELS brand notice: apimodel.store is an impersonation site. It is not affiliated with APIMODELS (apimodels.app), is not operated by us, and is not our official mirror, alternate domain or authorized website. Check the full domain before signing in, topping up or entering an API key. Do not use your APIMODELS password or API key there, or pay there believing you are topping up your apimodels.app balance. Source: https://apimodels.app/about#official-domain · Notice published: 2026-12-04 Generated: 2026-12-06T03:54:20.793Z --- Source: https://apimodels.app/docs (Markdown: https://apimodels.app/docs.md) · Section: Getting started # API Documentation Complete API reference for all available models. Get started with our unified API interface. ## Quick Start 1 ### Get your API Key Create an API key in your [Console](https://apimodels.app/console/api-keys) 2 ### Make API Requests Use Bearer token authentication with your API key 3 ### Pay per Use Billed only for successful requests. Your balance is denominated in US dollars (USD). ## Base URL `https://api.apimodels.app/v1` `https://apimodels.app/api/v1` Both hosts serve the same API with the same key, interchangeable at any time. We recommend the first host: every generation endpoint (image, video, audio and LLM) is served directly by our origin servers, with request bodies up to 100MB. The second host remains fully supported but caps request bodies at ~4.5MB (413 beyond) — large images and base64 payloads will hit that ceiling. ### Setting base_url in an SDK OpenAI-compatible SDKs (openai-python, openai-node, Codex, Cline, …)`https://api.apimodels.app/v1` Anthropic SDK / Claude Code (appends /v1 itself)`https://api.apimodels.app` base_url is the root only. Do not paste a full endpoint (…/v1/messages, …/v1/images/generations) into it — your SDK appends its own path on top, and the request ends up at something like /v1/messages/chat/completions, which does not exist. The ENDPOINT values in the examples on this site are full endpoints meant for curl; for an SDK use one of the two roots above. ## Authentication All API requests require a Bearer token in the Authorization header: ``` Authorization: Bearer YOUR_API_KEY ``` ## HTTP Error Codes (sync request) 200 · Success 400 · Invalid request parameters 401 · Invalid or missing API key 402 · Insufficient credits 404 · Resource not found 429 · Rate limit exceeded 500 · Internal server error ## Generation Failure Codes (async task) When an async task fails, the query returns state="failed" with a standardized failCode, a human-readable failMsg, and a boolean retryable — so your client can decide between "retry / switch model" and "fix the prompt / input / top up". CONTENT_MODERATION · Content / copyright / safety rejected · not retryable INVALID_INPUT · Bad params, unsupported value, invalid format / size / duration · not retryable INSUFFICIENT_BALANCE · Not enough credits · not retryable UPSTREAM_BUSY · Upstream busy / rate-limited / transient network or 5xx · retryable UPSTREAM_FAILED · Upstream generation failed (generic, usually transient) · retryable TIMEOUT · Task timed out · retryable INTERNAL_ERROR · Platform internal error · retryable OTHER · Unrecognized error (catch-all; treat as possibly retryable) · retryable ## API Reference - [Connect AI Clients](https://apimodels.app/docs/clients) — Use one key across Cherry Studio, Cursor, ChatBox, LobeChat and NextChat · OpenAI-compatible · Cherry Studio · Cursor · ChatBox · LobeChat · NextChat - [Image Generation](https://apimodels.app/docs/image) — Generate and edit images using AI models · from $0.006/image · GPT Image 2.5 · Nano Banana Pro · FLUX.2 Klein - [Video Generation](https://apimodels.app/docs/omni-flash) — Create videos with motion control · from $0.01/s · Seedance 2.0 · Veo 3.1 · MiniMax H3 - [Language Models](https://apimodels.app/docs/llm) — Claude, GPT, Gemini and more with pay-per-token pricing · from $0.09/1M tokens · Claude · GPT-6 · Gemini - [Audio Models](https://apimodels.app/docs/audio) — Text-to-speech with ElevenLabs and Minimax · from $0.0400/1K chars · ElevenLabs TTS · Minimax TTS · Voice Clone - [Voices & Cloning](https://apimodels.app/docs/voices) — List voices, clone or design your own · System voices free · List · Clone - [Account Balance](https://apimodels.app/docs/account) — Query your account balance via API · Free · GET /api/v1/balance --- Source: https://apimodels.app/docs/clients (Markdown: https://apimodels.app/docs/clients.md) · Section: Agent & client setup OpenAI-compatible · one key, every model # Use apimodels in any AI client We expose the standard OpenAI surface (/v1/chat/completions and /v1/models), so any client that supports a "custom OpenAI provider" — Cherry Studio, Cursor, ChatBox, LobeChat, NextChat — connects with a single API key and gets every model (GPT-6.1 Sol, Claude, Gemini, GLM, …). Usually a one-minute setup. Image, video and audio models use their own task endpoints (see the respective docs pages) with the same key. ## Three values — the same in every client | Base URL / API host | https://api.apimodels.app/v1 | | ------------------- | -------------------------------------------------------------------------------- | | API Key | your sk\_… key (create in console) | | Model id | gpt-5.6-sol · gpt-6.1-sol · claude-opus-5-5 · gemini-3-pro-preview · gpt-image-2 | No key yet? Open [Console → API Keys](https://apimodels.app/console/api-keys) and create an sk\_… string. ## Per-client setup ### Cherry Studio [Details](https://apimodels.app/docs/cherry-studio) API host `https://api.apimodels.app/v1/` Settings → Model Providers → Add, type OpenAI. The host must end with a slash. ### Cursor API host `https://api.apimodels.app/v1` Settings → Models → enable "Override OpenAI Base URL" with the host above, paste your sk\_… key, then add a custom model name (e.g. gpt-6.1-sol). ### ChatBox API host `https://api.apimodels.app/v1` Settings → pick "OpenAI API Compatible", set the API host above, paste your sk\_… key, model gpt-6.1-sol. ### LobeChat [Details](https://apimodels.app/lobehub-api-setup) API host `https://api.apimodels.app/v1` Settings → Language Model → OpenAI, fill API Key and the API proxy address above, model gpt-6.1-sol. ### NextChat API host `https://apimodels.app` Settings → Custom Endpoint, set the endpoint to https://apimodels.app (it appends /v1 itself), API Key your sk\_… key, model gpt-6.1-sol. ### Any OpenAI-compatible app / SDK API host `https://api.apimodels.app/v1` Set base_url to the host above, api_key to your sk\_… key, model to gpt-6.1-sol. OpenAI SDK example below. ## Want images inside the chat window? The setup above covers chat only. Image, video and speech models have their own task endpoints rather than /v1/chat/completions, so a base URL alone will not reach them. To use them inside a conversation, install our MCP server — one npx command, works in Claude Desktop, Cursor and Cherry Studio, same key. The assistant then writes the prompt, generates, looks at the result and regenerates until it matches. [MCP server setup guide →](https://apimodels.app/docs/mcp) ## Coding agents These tools read and write files on your machine and run commands, so pick a model that supports function calling (tools) — with one that does not, the agent stalls at the read step without erroring. Each row below states which wire protocol it uses: the three differ, and so do their base URLs, so do not copy the host from the chat-client section. ### Claude Code [Details](https://apimodels.app/docs/claude-code) Anthropic Messages · claude-opus-5-5 API host `https://api.apimodels.app` Set three env vars: ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_MODEL. Note the host is the bare domain with no path — Claude Code appends /v1/messages itself. ### Codex CLI [Details](https://apimodels.app/docs/codex) OpenAI Responses · gpt-5.4 / gpt-5.5 API host `https://api.apimodels.app/v1` Add a model_provider in ~/.codex/config.toml with wire_api = "responses" (not chat). These two models are only served on the Responses API. ### Cline / Roo Code (VS Code) [Details](https://apimodels.app/cline-api-setup) OpenAI-compatible · claude-opus-5-5 API host `https://api.apimodels.app/v1` Pick "OpenAI Compatible" as the API Provider, fill in the Base URL and API Key, type the Model ID by hand. Choose a tool-capable model — these extensions edit files through function calls, and a model without tools will stall at the read step. ### Gemini CLI [Details](https://apimodels.app/docs/gemini-cli) Gemini native (v1beta) · gemini-3-flash-preview API host `https://api.apimodels.app` Set GOOGLE_GEMINI_BASE_URL (bare domain, no path) and GEMINI_API_KEY; on first launch pick “Use Gemini API key” as the auth method, not Google account login. ### OpenClaw [Details](https://apimodels.app/docs/openclaw) OpenAI-compatible · claude-opus-5-5 API host `https://api.apimodels.app/v1` Add a custom provider under models.providers in ~/.openclaw/openclaw.json (api: "openai-completions"); every model you want must be listed in the models array or you get “model not allowed”. ### OpenCode [Details](https://apimodels.app/docs/opencode) OpenAI-compatible · gpt-6.2-sol API host `https://api.apimodels.app/v1` Add a custom provider in opencode.json: providers on 2.x (package @opencode/ai/providers/openai-compatible, address in settings.baseURL), provider on 1.x (npm @ai-sdk/openai-compatible, address in options.baseURL). Check your version with opencode --version first. ### WorkBuddy [Details](https://apimodels.app/docs/workbuddy) OpenAI-compatible · claude-fable-5-2 API host `https://api.apimodels.app/v1/chat/completions` Avatar → Settings → Models → add a model and choose Custom. The URL goes all the way to /chat/completions; the model name is the exact model id. ### Continue OpenAI-compatible · claude-opus-5-5 API host `https://api.apimodels.app/v1` Add an entry under \`models\` in config.json: provider "openai", apiBase as on the left, apiKey your sk\_… key, model the model ID. ### Aider OpenAI-compatible · claude-opus-5-5 API host `https://api.apimodels.app/v1` Set OPENAI_API_BASE and OPENAI_API_KEY, then start with \`aider --model openai/claude-opus-5-5\`. Keep the \`openai/\` prefix — that is how aider picks the protocol. ## Rather not edit configs? Import with CC Switch CC Switch is an open-source desktop app that manages provider settings for Claude Code, Codex, Gemini CLI, OpenCode, OpenClaw and more in one place. Paste your apimodels key, click the button for your tool, and the endpoint, key and default model are imported together. [CC Switch setup guide →](https://apimodels.app/docs/cc-switch) ## Code (OpenAI SDK) Any project using the OpenAI SDK only needs base_url and api_key changed to point here — no other code changes. Python ```python from openai import OpenAI client = OpenAI( base_url="https://api.apimodels.app/v1", api_key="sk_your_key_here", ) resp = client.chat.completions.create( model="gpt-6.1-sol", messages=[{"role": "user", "content": "Reply with exactly: ok"}], ) print(resp.choices[0].message.content) ``` Node.js ```javascript import OpenAI from "openai" const client = new OpenAI({ baseURL: "https://api.apimodels.app/v1", apiKey: "sk_your_key_here", }) const resp = await client.chat.completions.create({ model: "gpt-6.1-sol", messages: [{ role: "user", content: "Reply with exactly: ok" }], }) console.log(resp.choices[0].message.content) ``` ## 30-second sanity check If a client won't connect, confirm the key + endpoint with curl first — this is exactly what clients hit on "check connection": ```bash # confirm the endpoint + your key work (this is what a client hits on "check connection"): curl -s https://api.apimodels.app/v1/models \ -H "Authorization: Bearer $APIMODELS_API_KEY" | head -c 300 ``` ## Common pitfalls | Symptom | Cause / fix | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Connection check fails / no models | Host became …/api/v1/v1/…. Clients like Cherry Studio need the trailing slash (…/api/v1/); clients that append /v1 themselves (e.g. NextChat) take just https://apimodels.app. | | HTTP 401 | Wrong or disabled key. Mint a fresh sk\_… in the console and paste it again. | | Picked a model but nothing / 400 Unknown model | Model id typo — use the dash form, e.g. gpt-6.1-sol, claude-opus-5-5. Full list at /v1/models. | | Insufficient balance / 402 | You're only charged for successful requests; top up in the console. | Related: [MCP server](https://apimodels.app/docs/mcp)[Cherry Studio](https://apimodels.app/docs/cherry-studio)[Claude Code](https://apimodels.app/docs/claude-code)[/docs/llm](https://apimodels.app/docs/llm)[Console → API Keys](https://apimodels.app/console/api-keys) --- Source: https://apimodels.app/docs/mcp (Markdown: https://apimodels.app/docs/mcp.md) · Section: Agent & client setup MCP · Codex / Claude Code plugin · image / video / speech / chat # Generate images and video right inside Claude Code, Codex, Cursor or Cherry Studio apimodels-mcp is an MCP server. Install it and your AI client gains a set of tools for our image, video, chat and speech models, using the API key you already have. You describe what you want; the assistant writes the prompt, generates, looks at the result and regenerates with a better prompt — without leaving the chat window or memorising model names. ## One command: add apimodels to every AI client on this computer Run this in a terminal (needs Node.js 18 or later). It finds the MCP clients installed on this computer — Claude Code, Codex, Claude Desktop, Cursor, VS Code, Windsurf, Gemini CLI, OpenCode — lists them, and asks before adding apimodels to each one. It adds the hosted server, so there is no key to copy: the first time a client uses it, you sign in to apimodels.app and click Authorize. ```bash npx -y apimodels-mcp install ``` ### What it changes - Only the apimodels entry in each client's own config file; other servers, comments and formatting stay exactly as they were. Claude Code and Codex are set up through their own claude mcp add / codex mcp add commands, and for Codex it then runs codex mcp login apimodels so you can authorize right away. - Before changing a file it saves a timestamped copy next to it (.apimodels-backup-