# Kaer API documentation > Generated from https://api.kaer.ai/docs. Base URL: https://api.kaer.ai/v1 Send `Authorization: Bearer kaer_live_...` (or `x-api-key`). New accounts start with no credit: add some with a top-up (welcome bonus: +$5 on your first top-up of $25 or more). Card bonus: 1,000 free web searches when you add a card, valid 90 days. Search, images and maps open with a first top-up of $5; adding a card opens single searches. Every billed response reports its cost in `kaer.cost_usd`. ## Prices at a glance - Models: per token at each model's rate, live at https://api.kaer.ai/v1/models - Search: web $0.0005, fast $0.001, deep $0.003 per query; auto bills the lane that served it - Images: $0.002 per call - Maps: $0.00005 per request ($0.05 per 1,000; site images $0.005 per 1,000), only when answered - Mail: $0.001 per message + $0.0005 per recipient, paid credit only ## Quickstart {#quickstart} In this guide you create an account, make an API key and send your first chat completion. Every endpoint lives under `https://api.kaer.ai/v1`. > Note: Regional base URLs `https://api-eu.kaer.ai/v1`, `https://api-us.kaer.ai/v1` and `https://api-apac.kaer.ai/v1` serve the same API with the same keys. Each request is recorded under the region of the URL it was sent to, and replies carry `x-kaer-region`. The base URL does not change where a request is processed. ### Before you begin - `curl`, or Python with `pip install openai`, or Node.js with `npm install openai`. ### 1. Create an account Sign up at [api.kaer.ai](https://api.kaer.ai/login?mode=signup). A new account starts with no credit: top up from $5 in Billing before your first call. Adding a card in Billing gives you 1,000 free web searches. Your first top-up of $25 or more adds a $5 welcome bonus. See [Billing](https://api.kaer.ai/docs/billing). > Note: Search, images and maps are locked on the Free tier (403 `tier_required`), and Free tier spend is capped at $10 a month. Adding a card opens single searches (`POST /v1/search`) for its free searches; batch search, images and maps still wait for a top-up. Your first top-up of $5 or more moves you to Starter at once: those services open and the cap rises to $100. See [Rate limits and tiers](https://api.kaer.ai/docs/limits). ### 2. Create a key 1. In the dashboard, open **Keys** and create a key. 2. Keep the `models` scope every new key starts with, and tick `search`, `maps` or `mail` if you need them. 3. Copy the key right away. It starts with `kaer_live_`. > Warning: The key is shown only once. If you lose it, create a new one. ### 3. Make your first call Export your key as `KAER_API_KEY`, then send a chat completion. Every sample in these docs reads the key from that variable. ```bash export KAER_API_KEY="kaer_live_..." curl https://api.kaer.ai/v1/chat/completions \ -H "Authorization: Bearer $KAER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "orin-next-1", "messages": [{"role": "user", "content": "Hello"}] }' ``` ```python # pip install openai import os from openai import OpenAI client = OpenAI(api_key=os.environ["KAER_API_KEY"], base_url="https://api.kaer.ai/v1") response = client.chat.completions.create( model="orin-next-1", messages=[{"role": "user", "content": "Hello"}], ) print(response.choices[0].message.content) print("Cost (USD):", response.kaer["cost_usd"]) ``` ```javascript // npm install openai (save as hello.mjs) import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.KAER_API_KEY, baseURL: "https://api.kaer.ai/v1" }); const response = await client.chat.completions.create({ model: "orin-next-1", messages: [{ role: "user", content: "Hello" }], }); console.log(response.choices[0].message.content); console.log("Cost (USD):", response.kaer.cost_usd); ``` The response tells you what the call cost: `kaer.cost_usd` in the body and, for chat that is not streamed, an `x-kaer-cost-usd` header. > Tip: Pick curl, Python or Node above any sample. Your choice applies to every sample on every page. ### Next steps - [Authentication](https://api.kaer.ai/docs/authentication): Send your key and give it the scopes it needs. - [Chat completions](https://api.kaer.ai/docs/chat): Every parameter, the response and how a call is priced. - [Models](https://api.kaer.ai/docs/models): Compare models and their live prices. - [OpenAI SDKs](https://api.kaer.ai/docs/openai): Use the OpenAI libraries you already have. ## Authentication {#authentication} Every call except `GET /v1/models` needs a key. This page shows you how to send it, which scopes it needs and the order in which a request is checked. ### Before you begin - A key from the dashboard. If you do not have one, follow the [Quickstart](https://api.kaer.ai/docs/quickstart). - A list of the endpoints you plan to call, so you can give the key only the scopes they need. ### Send your key Send the key as a bearer token: ```http Authorization: Bearer kaer_live_... ``` Or send it in an `x-api-key` header. When `Authorization` holds a bearer token, it wins. ### Choose scopes Each scope covers the endpoints listed, and works once your tier reaches the one in **Opens at**. | Scope | Endpoints | Opens at | | --- | --- | --- | | `models` | `POST /v1/chat/completions` | Free | | `search` | `POST /v1/search`, `POST /v1/search/batch`, `POST /v1/images` | Starter | | `maps` | `GET /v1/maps` | Starter | | `mail` | `POST /v1/mail/send`, `GET /v1/mail/messages/{id}` | Build | ### Find out why a request was refused The gateway runs these checks in order and stops at the first one that fails. The error code tells you which check it was. 1. The key exists and is not revoked or expired: else 401 `invalid_api_key` (no key at all: `missing_api_key`). 2. The account is active: else 403 `account_inactive`. 3. The caller's IP is on the key's allow-list, when it has one: else 403 `ip_not_allowed`. 4. The key has the endpoint's scope: else 403 `insufficient_scope` (`GET /v1/me` takes any key). 5. Your account can call the service: else 403 `tier_required`. 6. Rate limits: else 429 `rate_limit_exceeded`. 7. A hold for the call's maximum cost: else 402 (`insufficient_credits`, `monthly_limit_reached` or `key_budget_exceeded`). To limit a key further with allow-lists, budgets, expiry and rotation, see [Key security](https://api.kaer.ai/docs/keys). ### Next steps - [Key security](https://api.kaer.ai/docs/keys): Allow-lists, budgets, expiry and rotation. - [Errors](https://api.kaer.ai/docs/errors): Every error code, with its fix. - [Rate limits and tiers](https://api.kaer.ai/docs/limits): What each tier opens and how fast you can call. ## Key security {#keys} Treat your keys as secrets. We store only a hash of each key, plus its prefix and last four characters so you can tell keys apart. ### Limit what a key can do | Control | Effect | Limits | | --- | --- | --- | | Scopes | Only the listed services answer to the key. | `models`, `search`, `maps`, `mail` | | IP allow-list | Calls from other addresses get 403 `ip_not_allowed`. | Up to 32 IPs or CIDR ranges. IPv4 /8 or narrower, IPv6 /16 or narrower. An IPv6 caller also matches by its /64. | | Monthly budget | A call that would take the key past its budget this month (UTC) gets 402 `key_budget_exceeded`. Open holds count. | $1 to $1,000,000 | | Expiry | The key stops working after the set number of days. | 1 to 730 days, set when you create it | | Active keys | Revoke a key to make room for another. | Free 3, Starter 10, Build 25, Scale 50, Pro 100 | You can change a key's name, scopes, allow-list and budget later. Expiry is fixed at creation. ### Rotate a key To replace a key while your app keeps running: 1. Create a new key with the same scopes and limits. 2. Deploy it, and check in the key list that the old key's last use stops moving. 3. Revoke the old key. Revocation takes effect within seconds. ### Keep keys on your server Call the API from your backend. `/v1` answers cross-origin requests, but a key that ships to a browser is public. A Free tier key used from many networks within an hour is refused with 429 `key_shared`. > Warning: If a key leaks, revoke it in the dashboard and rotate. ### Know the per-key ceiling Every key is held to 12,000 requests a minute (bursts up to 2000) whatever its tier. An address that keeps sending invalid keys is refused with 429 `rate_limit_exceeded` for a while. ### Next steps - [Authentication](https://api.kaer.ai/docs/authentication): Scopes and the order of checks. - [Rate limits and tiers](https://api.kaer.ai/docs/limits): Per-key and per-account limits by tier. ## OpenAI SDKs {#openai} Chat completions and the model list speak the OpenAI wire format, so you can keep the OpenAI SDK you already use. Point it at `https://api.kaer.ai/v1` and give it your Kaer key. ```bash # Tools built on the OpenAI SDKs read these variables. export OPENAI_BASE_URL="https://api.kaer.ai/v1" export OPENAI_API_KEY="$KAER_API_KEY" ``` ```python import os from openai import OpenAI client = OpenAI( api_key=os.environ["KAER_API_KEY"], base_url="https://api.kaer.ai/v1", ) ``` ```javascript import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.KAER_API_KEY, baseURL: "https://api.kaer.ai/v1", }); ``` ### Check what is supported | SDK call | Status | | --- | --- | | `chat.completions.create` | Supported, including `stream` and function `tools` | | `models.list` | Supported. No key needed, but the SDKs want one set. | | `models.retrieve` | Supported: `GET /v1/models/{id}`, no key needed. `kaer/orin-next-1` resolves like `orin-next-1`. | | Embeddings, image generation, audio, files, responses, assistants | Not available (404 `unknown_endpoint`) | ### Know which parameters are forwarded The gateway forwards `model`, `messages`, `max_tokens` (or `max_completion_tokens`), `temperature`, `top_p`, `tools`, `stop`, `tool_choice`, `stream`, `reasoning_effort` and `speed`. `stop` takes a string or up to four; the answer is cut before the first one and ends with `finish_reason: "stop"`. `tool_choice: "none"` keeps the model from calling a tool; any other value is answered as `"auto"`. Other fields, such as `response_format`, `n`, `seed`, `logprobs`, `presence_penalty`, `frequency_penalty`, `user` and `stream_options`, are accepted and ignored. Usage is always reported, streamed or not, so `stream_options` is not needed. Message content must be text: a string, or an array of `text` parts. Image, audio and file parts are refused with 400. Orin Next 1.0, Kaer's default model, answers to `orin-next-1` and to the same id with Kaer's prefix (`kaer/orin-next-1`). The deprecated ids `janus-1-flash` and `janus-1-pro`, with or without the prefix, still work: Orin Next 1.0 serves them. ### Read the cost and handle errors The cost comes back in a `kaer` object. In Python it is a plain dict (`response.kaer["cost_usd"]`); in Node, `response.kaer.cost_usd`. Errors are OpenAI-shaped, so the SDKs raise their usual exceptions: `AuthenticationError` (401), `PermissionDeniedError` (403), `NotFoundError` (404) and `RateLimitError` (429); a 402 is a generic status error (`APIStatusError` in Python, `APIError` in Node). > Warning: The SDKs retry 429 and 5xx answers twice by default; a retried chat completion runs and is billed again. ### Next steps - [Chat completions](https://api.kaer.ai/docs/chat): The request body, the response and the price. - [Streaming](https://api.kaer.ai/docs/streaming): Read the answer as it is written. - [Idempotency](https://api.kaer.ai/docs/idempotency): Which retries are safe and which bill again. ## Models {#models} `GET /v1/models` - Auth: None, public - Price: Free - Shape: OpenAI model list with a `kaer` block List the models you can call, with prices per 1M tokens. A price is the model's highest band; a call is billed at the band that applies, so it can cost less. Free models are not offered: every model call is paid. ### Compare prices | Model | Input per 1M | Output per 1M | Cached input per 1M | Status | | --- | --- | --- | --- | --- | | Orin Next 1.0 `orin-next-1` | $0.10 | $0.40 | $0.03 | Serving | | Qwen 3.7 Flash `qwen3.7-flash` | $0.06 | $0.26 | $0.02 | Paused | | X1-Kaer `x1-kaer` | $0.10 | $0.40 | $0.02 | Paused | | Step 3.5 Flash `step-3.5-flash` | $0.13 | $0.39 | $0.03 | Paused | | Step 3.5 Flash 2603 `step-3.5-flash-2603` | $0.13 | $0.39 | $0.03 | Paused | | Qwen3 VL Flash `qwen3-vl-flash` | $0.10 | $0.80 | $0.02 | Paused | | Qwen MT Lite `qwen-mt-lite` | $0.24 | $0.72 | $0.06 | Paused | | Kaer-X2 `kaer-x2` | $0.25 | $0.80 | $0.04 | Paused | | Qwen 3.8 Flash `qwen3.8-flash` | $0.30 | $0.94 | $0.06 | Paused | | Qwen MT Flash `qwen-mt-flash` | $0.32 | $0.98 | $0.08 | Paused | | Step 3.7 Flash `step-3.7-flash` | $0.26 | $1.50 | $0.06 | Paused | | DeepSeek V4 Flash `deepseek-v4-flash` | $0.40 | $1.60 | $0.08 | Paused | | DeepSeek V4 Flash (0731 GA) `deepseek-v4-flash-0731` | $0.40 | $1.60 | $0.08 | Paused | | DeepSeek V4 Pro `deepseek-v4-pro` | $0.40 | $1.60 | $0.08 | Paused | | DeepSeek V4.1 Flash `deepseek-v4.1-flash` | $0.40 | $1.60 | $0.01 | Paused | | Hunyuan MT2 Lite `hy-mt2-lite` | $0.40 | $1.60 | $0.08 | Paused | | Hunyuan MT2 Plus `hy-mt2-plus` | $0.40 | $1.60 | $0.08 | Paused | | Hunyuan MT2 Pro `hy-mt2-pro` | $0.40 | $1.60 | $0.08 | Paused | | Hunyuan 3 `hy3` | $0.40 | $1.60 | $0.08 | Paused | | Hunyuan 4 Preview `hy4-preview` | $0.40 | $1.60 | $0.08 | Paused | | Kimi K2.6 `kimi-k2.6` | $0.40 | $1.60 | $0.08 | Paused | | Kimi K2.7 Code `kimi-k2.7-code` | $0.40 | $1.60 | $0.08 | Paused | | Kimi K3 `kimi-k3` | $0.40 | $1.60 | $0.08 | Paused | | LongCat 2.0 `longcat-2.0` | $0.60 | $2.40 | $0.02 | Paused | | MiniMax M3 `minimax-m3` | $0.60 | $2.40 | $0.12 | Paused | | Laguna S 2.1 `laguna-s-2.1` | $0.50 | $3.00 | $0.01 | Paused | | Laguna XS 2.1 `laguna-xs-2.1` | $0.50 | $3.00 | $0.01 | Paused | | Qwen3 VL Plus `qwen3-vl-plus` | $0.40 | $3.20 | $0.08 | Paused | | Qwen 3.7 Plus `qwen3.7-plus` | $0.80 | $3.20 | $0.16 | Paused | | Step 5 Preview `step-5-preview` | $1.30 | $3.51 | $0.13 | Paused | | GLM 5 Turbo `glm-5-turbo` | $2.40 | $8.00 | $0.48 | Paused | | GLM 5.2 `glm-5.2` | $2.80 | $8.80 | $0.52 | Paused | | GLM 5.3 `glm-5.3` | $2.80 | $8.80 | $0.52 | Paused | | GLM 5.3 Flash `glm-5.3-flash` | $2.80 | $8.80 | $0.52 | Paused | | Kimi K3.1 Pro `kimi-k3.1-pro` | $2.50 | $12.50 | $0.25 | Paused | | Qwen 3.8 Max `qwen3.8-max` | $4.00 | $12.00 | $0.80 | Paused | | Qwen MT Plus `qwen-mt-plus` | $4.92 | $14.74 | $1.00 | Paused | > Tip: Send `"model": "auto"` to chat and Kaer picks a serving model for you. The response's `model` field names the one that answered, and the call is billed at its price. ### Filter and retrieve - `GET /v1/models?owned_by=kaer` lists Kaer's own models only. - `GET /v1/models?owned_by=kaer&format=openrouter` answers in OpenRouter's list-models schema (2.x). - `GET /v1/models/{id}` returns one model; `kaer/orin-next-1` resolves like `orin-next-1`, and a deprecated Janus id returns Orin Next 1.0, the model that serves it. - `GET /v1/zdr/models` is the same list priced at the zero-data-retention rate, which Enterprise accounts pay. ### Response | Field | Type | Notes | | --- | --- | --- | | `data[].id` | string | Pass it as `model`. | | `data[].owned_by` | string | The model's family. | | `data[].kaer.label` | string | Display name. | | `data[].kaer.family` | string | Model family. | | `data[].kaer.available` | boolean | `false` while a model is paused; calls then get 503 `model_unavailable`. | | `data[].kaer.pricing.input_usd_per_m` | number | USD per 1M prompt tokens. | | `data[].kaer.pricing.output_usd_per_m` | number | USD per 1M completion tokens. | | `data[].kaer.pricing.cached_input_usd_per_m` | number or null | USD per 1M cached prompt tokens, or `null`. | | `data[].kaer.free_credit_eligible` | boolean | Always `true`: free credit pays for models. | | `data[].name` | string | Display name. | | `data[].pricing` | object | USD per token as decimal strings: `prompt`, `completion` and, where cached input is billed, `input_cache_read`. | | `data[].context_length` | integer | Kaer's models: the context window in tokens. | | `data[].max_completion_tokens` | integer | Kaer's models: the most completion tokens one call can return (also `max_output_length`). | | `data[].supported_parameters` | string[] | Kaer's models: the request fields the API honours. | | `data[].supported_features` | string[] | Kaer's models: `tools`, `reasoning`. | | `data[].input_modalities, output_modalities` | string[] | Kaer's models: `text`. | | `data[].datacenters` | array | Kaer's models: empty. Hosting locations are not published (`kaer.datacenter_locations` is `"N/A"`). | | `data[].kaer.pricing.zdr` | object | The same rates in zero-data-retention mode. | | `data[].kaer.features` | object | Kaer's models: streaming, tools, `tool_choice` values, `stop`, prompt caching (`automatic`), reasoning, usage, and what is not offered (JSON mode, structured outputs, vision, logprobs). | | `data[].kaer.aliases` | string[] | Kaer's models: other ids that call the same model. | | `data[].kaer.data_modes` | object | What each data mode keeps, and how to choose zero data retention. See [Privacy](https://api.kaer.ai/docs/privacy). | ```json { "object": "list", "data": [ { "id": "orin-next-1", "object": "model", "created": 1767225600, "owned_by": "kaer", "kaer": { "label": "Orin Next 1.0", "family": "kaer", "available": true, "pricing": { "input_usd_per_m": 0.1, "output_usd_per_m": 0.4, "cached_input_usd_per_m": 0.03 }, "free_credit_eligible": true } } ] } ``` ```bash curl https://api.kaer.ai/v1/models ``` ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["KAER_API_KEY"], base_url="https://api.kaer.ai/v1") for m in client.models.list(): price = m.kaer["pricing"] print(m.id, price["input_usd_per_m"], price["output_usd_per_m"]) ``` ```javascript const res = await fetch("https://api.kaer.ai/v1/models"); const { data } = await res.json(); for (const m of data) { console.log(m.id, m.kaer.pricing.input_usd_per_m, m.kaer.pricing.output_usd_per_m); } ``` ### Next steps - [Chat completions](https://api.kaer.ai/docs/chat): Call a model and see what it cost. - [Billing](https://api.kaer.ai/docs/billing): Holds, top-ups and bonuses. ## Chat completions {#chat} `POST /v1/chat/completions` - Scope: `models` - Tier: All tiers - Price: Per token, see [Models](https://api.kaer.ai/docs/models) Send a list of messages and get the model's reply. The format is OpenAI's, so the OpenAI SDKs work as they are; see [OpenAI SDKs](https://api.kaer.ai/docs/openai) for which fields are forwarded. ### Before you begin - A key with the `models` scope. See [Authentication](https://api.kaer.ai/docs/authentication). - A model id from [Models](https://api.kaer.ai/docs/models), or `auto`. - Enough balance for the call's hold. See [Price](https://api.kaer.ai/docs/chat#chat-price). ### Request body | Parameter | Type | Required | Default | Notes | | --- | --- | --- | --- | --- | | `model` | string | yes | | A model id from `GET /v1/models`, or `auto`. Unknown ids get 404 `model_not_found`; a paused model gets 503 `model_unavailable`. | | `messages` | array | yes | | 1 to 2,048 messages, up to 1,000,000 characters of text in all. Roles: `system`, `developer` (read as system), `user`, `assistant` (may carry `tool_calls`) and `tool` (needs `tool_call_id`). `content` is a string or an array of `text` parts. | | `max_tokens` | integer | no | 4,096 | Output cap, 1 to 32,768; larger values are lowered to 32,768. `max_completion_tokens` is also read and wins. When the model reasons, a cap under 8,192 can be raised by up to 4,096 tokens (to at most 8,192) to leave room for reasoning. It sizes the hold, so a lower value needs less balance. | | `temperature` | number | no | 0.7 | 0 to 2. Values outside are clamped. | | `top_p` | number | no | 1 | 0 to 1. Values outside are clamped. | | `tools` | array | no | | Function tools in OpenAI format, up to 64. Names are 1 to 64 characters. | | `stream` | boolean | no | false | Stream the answer as server-sent events. See [Streaming](https://api.kaer.ai/docs/streaming). | | `reasoning_effort` | string | no | | How much the model reasons before it answers: `none`, `low`, `medium` or `high` (`minimal` reads as `low`). Left out, Orin Next 1.0 runs at `none`, its lightest setting. Reasoning tokens are billed as completion tokens and count toward `max_tokens`. Send `none` for the least reasoning and to keep the hold at `max_tokens`. Other values get 400 `invalid_reasoning_effort`. | | `speed` | string | no | fast | `fast` or `superfast`, kept for calls written for Janus 1.0 (deprecated). Orin Next 1.0 serves every call at one speed and one price, and other models ignore the field too. Other values get 400 `invalid_speed`. | Other OpenAI fields are ignored. The body is limited to 1 MB. ### Response | Field | Type | Notes | | --- | --- | --- | | `id` | string | `chatcmpl-…` | | `model` | string | The model that answered. | | `choices[0].message.content` | string | The answer. | | `choices[0].message.tool_calls` | array | Present when the model calls a tool. | | `choices[0].finish_reason` | string | Why it stopped, such as `stop`, `length` or `tool_calls`. | | `usage.prompt_tokens` | integer | Prompt tokens billed. | | `usage.completion_tokens` | integer | Completion tokens billed. | | `usage.prompt_tokens_details.cached_tokens` | integer | Prompt tokens served from cache, billed at the cached price. | | `kaer.request_id` | string | Same as the `x-request-id` header. | | `kaer.cost_usd` | number | What the call cost. | | `kaer.free_credit_usd` | number | The part of the cost paid from free credit. | ```json { "id": "chatcmpl-…", "object": "chat.completion", "created": 1767225600, "model": "orin-next-1", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello. How can I help?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21, "prompt_tokens_details": { "cached_tokens": 0 } }, "kaer": { "request_id": "req_…", "cost_usd": 0.0000048, "free_credit_usd": 0.0000048 } } ``` The response also carries these headers: `x-request-id`, the `x-ratelimit-*` headers and `x-kaer-cost-usd`. ### Price Prompt tokens × the input price + completion tokens × the output price, with cached prompt tokens at the cached price when the model has one. Prices are per 1M tokens and come from the live [model list](https://api.kaer.ai/docs/models). Worked example (at the listed price, the most a call can cost): - 1,000 prompt and 500 completion tokens on `orin-next-1`: 1,000 × $0.10/1M + 500 × $0.40/1M = **$0.0003** - The same call 10,000 times: 10,000 × $0.0003 = **$3.00** - Hold for a 4,000 character prompt with the default `max_tokens` (4,096) and reasoning allowed: prompt estimate + 8,192 completion tokens, at the dearest band, + 25% = **$0.00435625** Before the model runs, the gateway holds an upper bound: the prompt estimated generously plus `max_tokens` of output at the dearest band, plus 25%. Unless `reasoning_effort` is `none`, a `max_tokens` under 8,192 is held as up to 4,096 tokens more (at most 8,192). The call settles at its actual cost, never more than the hold, and the rest is released at once. **Why this matters:** your balance has to cover the hold, not just the final cost. A lower `max_tokens` shrinks the hold. ### Errors | Status | Code | Meaning | | --- | --- | --- | | 400 | `invalid_json` | The body is not valid JSON. Images also needs a JSON object. | | 400 | `model_required` | `model` is missing. | | 400 | `invalid_reasoning_effort` | `reasoning_effort` is not `none`, `minimal`, `low`, `medium` or `high`. | | 400 | `invalid_speed` | `speed` is not `fast` or `superfast`. | | 400 | `messages_required` | `messages` is missing or empty. | | 400 | `too_many_messages` | More than 2,048 messages. | | 400 | `invalid_request_error` | The model service refused the body: an unsupported role or content part, a `tool` message without `tool_call_id`, more than 64 tools, or over 1,000,000 characters of text. | | 404 | `model_not_found` | No such model on the platform. | | 413 | `body_too_large` | The body is over the endpoint's limit: chat 1 MB, search 16 KB, batch 64 KB, images 8 KB, mail 10 MB. | | 429 | `too_many_streams` | Your account already has its tier's maximum of open streams. | | 502 | `upstream_unreachable` | The model service did not answer. Nothing was charged. | | 502 | `upstream_error` | The model call failed, or the connection to the API dropped. | | 502 | `upstream_bad_response` | The model service sent a reply that could not be read. Nothing was charged. | | 503 | `model_unavailable` | The model is paused for now. | You are not charged for failed calls. For auth, balance and rate errors, see [Errors](https://api.kaer.ai/docs/errors). ### Send a request This request sets a system message and caps the answer at 200 tokens. ```bash curl https://api.kaer.ai/v1/chat/completions \ -H "Authorization: Bearer $KAER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "orin-next-1", "messages": [ {"role": "system", "content": "Answer in one paragraph."}, {"role": "user", "content": "Explain quantum computing."} ], "max_tokens": 200 }' ``` ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["KAER_API_KEY"], base_url="https://api.kaer.ai/v1") response = client.chat.completions.create( model="orin-next-1", messages=[ {"role": "system", "content": "Answer in one paragraph."}, {"role": "user", "content": "Explain quantum computing."}, ], max_tokens=200, ) print(response.choices[0].message.content) print("Cost (USD):", response.kaer["cost_usd"]) ``` ```javascript import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.KAER_API_KEY, baseURL: "https://api.kaer.ai/v1" }); const response = await client.chat.completions.create({ model: "orin-next-1", messages: [ { role: "system", content: "Answer in one paragraph." }, { role: "user", content: "Explain quantum computing." }, ], max_tokens: 200, }); console.log(response.choices[0].message.content); console.log("Cost (USD):", response.kaer.cost_usd); ``` ### Next steps - [Streaming](https://api.kaer.ai/docs/streaming): Get the answer as server-sent events. - [Models](https://api.kaer.ai/docs/models): Pick a model by price. - [Errors](https://api.kaer.ai/docs/errors): Every error code, with its fix. ## Streaming {#streaming} Set `stream: true` on a chat request to get the answer as server-sent events (`text/event-stream`). Each event is a `chat.completion.chunk`, and the stream ends with `data: [DONE]`. ### Read the events in order 1. A first chunk with `delta.role` set to `assistant`. 2. Content chunks (`delta.content`) or tool-call chunks (`delta.tool_calls`). 3. A chunk with `finish_reason`. 4. A usage chunk: `choices` is empty, with `usage` and `kaer` (`request_id`, `cost_usd`, `free_credit_usd`). 5. `data: [DONE]` ```text data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1767225600,"model":"orin-next-1","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]} data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1767225600,"model":"orin-next-1","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]} data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1767225600,"model":"orin-next-1","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]} data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1767225600,"model":"orin-next-1","choices":[],"usage":{"prompt_tokens":12,"completion_tokens":9,"total_tokens":21,"prompt_tokens_details":{"cached_tokens":0}},"kaer":{"request_id":"req_…","cost_usd":0.0000048,"free_credit_usd":0.0000048}} data: [DONE] ``` > Warning: The usage chunk has an empty `choices` array. Check `choices` before you read `choices[0]`. ### Understand how a stream is billed A stream settles at the cost the model service reports in its usage chunk. If the stream ends before that chunk (you disconnect, or it times out), the gateway charges an estimate from the text sent, about 4 characters per token for prompt and answer, and never more than the hold. Open streams count toward your tier's concurrent stream limit until they end. ### Handle timeouts and errors If the model sends nothing for 90 seconds, or a stream runs past 15 minutes, the gateway sends an error event and closes the stream: `data: {"error": {"type": "server_error", "code": "upstream_idle", ...}}` (or `max_duration`), then `[DONE]`. If the model fails partway, you get an `error` event, a chunk with `finish_reason: "error"`, then the usage chunk. The OpenAI SDKs raise an exception when they read an `error` event. While a model reasons before it answers, the stream sends a chunk with an empty `delta` about every 15 seconds, so a long think is not cut off as idle. Read `delta.content` only when it is there, as you do for the finish chunk. Streaming responses carry `x-request-id` and the rate-limit headers, but not `x-kaer-cost-usd`: the cost arrives in the usage chunk. ### Stream a response ```bash curl -N https://api.kaer.ai/v1/chat/completions \ -H "Authorization: Bearer $KAER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "orin-next-1", "messages": [{"role": "user", "content": "Count to 10."}], "stream": true }' ``` ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["KAER_API_KEY"], base_url="https://api.kaer.ai/v1") stream = client.chat.completions.create( model="orin-next-1", messages=[{"role": "user", "content": "Count to 10."}], stream=True, ) for chunk in stream: if chunk.choices: print(chunk.choices[0].delta.content or "", end="", flush=True) elif chunk.usage: print("\nCost (USD):", chunk.kaer["cost_usd"]) ``` ```javascript import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.KAER_API_KEY, baseURL: "https://api.kaer.ai/v1" }); const stream = await client.chat.completions.create({ model: "orin-next-1", messages: [{ role: "user", content: "Count to 10." }], stream: true, }); for await (const chunk of stream) { if (chunk.choices.length) process.stdout.write(chunk.choices[0].delta.content ?? ""); else if (chunk.usage) console.log("\nCost (USD):", chunk.kaer.cost_usd); } ``` ### Next steps - [Chat completions](https://api.kaer.ai/docs/chat): Every request parameter and response field. - [Errors](https://api.kaer.ai/docs/errors): Codes you can meet inside a stream. ## Search {#search} `POST /v1/search` - Scope: `search` - Tier: Starter and up - Price: $0.0005 to $0.003 per query, see [Search pricing](https://api.kaer.ai/docs/search-pricing) Search Kaer's own index, alone or racing the live web, and get ranked results. ### Before you begin - A key with the `search` scope. See [Authentication](https://api.kaer.ai/docs/authentication). - An account on the Starter tier or above. Search is locked on the Free tier until your first top-up. - A lane for your query. See [Choose a lane](https://api.kaer.ai/docs/search#search-choose-a-lane). ### Request body | Parameter | Type | Required | Default | Notes | | --- | --- | --- | --- | --- | | `query` | string | yes | | 1 to 512 characters after trimming. | | `lane` | string | no | auto | `web`, `fast`, `deep` or `auto`, case-insensitive. Anything else is a 400. | | `num_results` | integer | no | 5 | Results per query, 1 to 25. Numbers outside are clamped; anything that is not a number is a 400. Also read as `numResults`. | | `include_domains` | string[] | no | | Only results from these hosts or their subdomains, up to 20. The `web` lane applies it before ranking; the others filter after retrieval. Also `includeDomains`. | | `exclude_domains` | string[] | no | | Never return results from these hosts or their subdomains, up to 20. Also `excludeDomains`. | | `offset` | integer | no | 0 | Results to skip before this page, on the `web` and `fast` lanes: `offset: 10` with `num_results: 10` is the second page of ten. A lane ranks at most 50 results, so a page ends there; `warnings` says when the page started earlier than you asked. | | `page` | integer | no | 1 | The page of `num_results` results, counting from 1, on `web` and `fast`. `offset` wins when you send both. The other lanes return their first page and say so in `warnings`. Anything that is not a whole number of 0 or more is a 400. | | `fields` | string[] | no | | Result keys to keep, 1 to 20 of `title`, `url`, `snippet`, `source`, `published_date`, `text`, `text_truncated`, `text_source`. Leave it out for all of them. Any other name is a 400 `invalid_fields`. | Any other field is not applied, and the response lists it in `kaer.ignored_params`, so a filter you expected never fails silently. The body is limited to 16 KB. ### Choose a lane | Lane | What it does | Per query | Timeout | | --- | --- | --- | --- | | `web` | Kaer's index alone. Fastest and cheapest. | $0.0005 | 6 s | | `fast` | The index racing the live web. | $0.001 | 12 s | | `deep` | Every lane, re-ranked. Results carry the page's text, up to 4,000 characters, when it could be read. | $0.003 | 40 s | | `auto` | Kaer picks a lane per query. Billed at the lane that served it. | As served | 40 s | A query that runs past its lane's timeout fails with 504 `search_timeout` and is not charged. > Tip: Not sure which lane to use? Send `auto`: Kaer picks one per query, and you pay for the lane that served it. ### Response | Field | Type | Notes | | --- | --- | --- | | `object` | string | `search.result` | | `query` | string | The query, trimmed. | | `lane` | string | The lane you asked for. | | `served_lane` | string | The lane that ran, and the one billed. | | `results[].title` | string | Page title. | | `results[].url` | string | Page address. | | `results[].snippet` | string | Text from the page that matches the query. | | `results[].source` | string[] | Which engines returned the page. | | `results[].published_date` | string | Publication time (RFC 3339), when known. | | `results[].text` | string | Deep only: the page's main text, up to 4,000 characters. | | `results[].text_truncated` | boolean | Deep only: the text was cut. | | `results[].text_source` | string | Deep only: `page`, or `snippet` when the site would not serve us the page. | | `answer` | object | An instant answer, when the query asks for one the `web` or `fast` lane can work out: a sum, a unit or currency conversion, the time, the weather or a word's meaning. Left out otherwise. | | `answer.type` | string | `calculation`, `conversion`, `currency`, `time`, `weather` or `definition`. | | `answer.text` | string | The answer in a sentence. | | `answer.data` | object | Its figures, shaped by `type`. | | `answer.source` | object | Where a looked-up answer came from: `name`, `url` and, when it has one, `license`. | | `answer_confidence` | number | `web` lane, first page: the probability, from 0 to 1, that the first result answers the query. Use it to decide whether to stop, rephrase or search deeper: at 0.8 and above the first result was right about four times in five on our test queries, under 0.2 about three times in ten. Left out when the lane cannot say. | | `warnings` | string[] | Request fields the lane did not apply as sent, such as `offset` on a lane that does not page or a page past the ranked results. Left out when there are none. | | `kaer.request_id` | string | Same as `x-request-id`. | | `kaer.cost_usd` | number | What the query cost. `0` when a search plan paid for it. | | `kaer.plan_units` | object | Plan-paid queries only: the search units this query `used` and the units `remaining` this month. See [Search plans](https://api.kaer.ai/docs/search-plans). | | `kaer.ignored_params` | string[] | Fields that were not applied, when there are any. | ```json { "object": "search.result", "query": "latest ai research", "lane": "fast", "served_lane": "fast", "results": [ { "title": "…", "url": "https://…", "snippet": "…", "source": ["kaer_web"] } ], "kaer": { "request_id": "req_…", "cost_usd": 0.001 } } ``` Headers: `x-request-id` and the `x-ratelimit-*` headers. Search sends no `x-kaer-cost-usd` header: the cost is `kaer.cost_usd` in the body. ### Errors | Status | Code | Meaning | | --- | --- | --- | | 400 | `invalid_json` | The body is not valid JSON. Images also needs a JSON object. | | 400 | `query_required` | `query` is missing or blank. | | 400 | `query_too_long` | `query` is over 512 characters (search) or 300 (images). | | 400 | `invalid_lane` | `lane` is not `web`, `fast`, `deep` or `auto`. | | 400 | `invalid_num_results` | `num_results` is not a number. | | 400 | `invalid_paging` | `offset` or `page` is not a whole number of 0 or more. | | 400 | `invalid_domains` | `include_domains` or `exclude_domains` is not an array of up to 20 host names. | | 400 | `invalid_fields` | `fields` is empty, has more than 20 names, or names a key that results do not have. | | 403 | `tier_required` | Your tier does not include this service yet. | | 429 | `too_many_concurrent_searches` | Your account already has its maximum of searches in flight: your tier's figure, or your search plan's when that is higher. | | 413 | `body_too_large` | The body is over the endpoint's limit: chat 1 MB, search 16 KB, batch 64 KB, images 8 KB, mail 10 MB. | | 502 | `search_failed` | The search service failed. Nothing was charged. | | 503 | `search_busy` | Search is at capacity. Nothing was charged. | | 504 | `search_timeout` | Search ran out of time. Nothing was charged. | | 502 or 503 | `search_unavailable` | Search is unreachable or paused. Nothing was charged. | ### Run a search ```bash curl https://api.kaer.ai/v1/search \ -H "Authorization: Bearer $KAER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": "latest ai research", "lane": "fast", "num_results": 5 }' ``` ```python import os, requests r = requests.post( "https://api.kaer.ai/v1/search", headers={"Authorization": f"Bearer {os.environ['KAER_API_KEY']}"}, json={"query": "latest ai research", "lane": "fast", "num_results": 5}, timeout=60, ) r.raise_for_status() data = r.json() for hit in data["results"]: print(hit["title"], hit["url"]) print("Lane:", data["served_lane"], "Cost (USD):", data["kaer"]["cost_usd"]) ``` ```javascript const res = await fetch("https://api.kaer.ai/v1/search", { method: "POST", headers: { Authorization: `Bearer ${process.env.KAER_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ query: "latest ai research", lane: "fast", num_results: 5 }), }); const data = await res.json(); for (const hit of data.results) console.log(hit.title, hit.url); console.log("Lane:", data.served_lane, "Cost (USD):", data.kaer.cost_usd); ``` ### Next steps - [Batch search](https://api.kaer.ai/docs/batch): Run many queries in one call. - [Search pricing](https://api.kaer.ai/docs/search-pricing): Prices per lane, with worked examples. - [Images](https://api.kaer.ai/docs/images): Find licensed pictures for a subject. ## Batch search {#batch} `POST /v1/search/batch` - Scope: `search` - Tier: Starter and up - Price: Per served row, at [search prices](https://api.kaer.ai/docs/search-pricing) Send many queries in one round trip. Every row shares the lane, the result count and the domain filters. ### Request body | Parameter | Type | Required | Default | Notes | | --- | --- | --- | --- | --- | | `queries` | string[] | yes | | 1 to your tier's batch size. Each query is 1 to 512 characters after trimming. | | `lane` | string | no | auto | `web`, `fast`, `deep` or `auto`, case-insensitive. Anything else is a 400. | | `num_results` | integer | no | 5 | Results per query, 1 to 25. Numbers outside are clamped; anything that is not a number is a 400. Also read as `numResults`. | | `include_domains` | string[] | no | | Only results from these hosts or their subdomains, up to 20. The `web` lane applies it before ranking; the others filter after retrieval. Also `includeDomains`. | | `exclude_domains` | string[] | no | | Never return results from these hosts or their subdomains, up to 20. Also `excludeDomains`. | | `fields` | string[] | no | | Result keys to keep, 1 to 20 of `title`, `url`, `snippet`, `source`, `published_date`, `text`, `text_truncated`, `text_source`. Leave it out for all of them. Any other name is a 400 `invalid_fields`. | Unread fields come back in `kaer.ignored_params`; a batch does not page, so `offset` and `page` are among them. The body is limited to 64 KB, and the whole batch to 35 seconds. | Tier | Queries per batch | | --- | --- | | Starter | 10 | | Build | 50 | | Scale | 100 | | Pro | 100 | ### Understand how a batch is billed - Each row that comes back with `ok: true` is billed like a single search, at the lane that served it. - Queries that match after trimming, lowercasing and collapsing spaces run once and are billed once; the repeats come back with `charged: false` and `duplicate_of`. - Rows that fail carry `charged: false` and cost nothing. - While the batch runs, the gateway holds the dearest possible price for every row (`auto` holds the deep price). - If the whole batch fails, nothing is charged. - With a [search plan](https://api.kaer.ai/docs/search-plans), the batch is paid in units when the allowance left covers every distinct query; otherwise it is paid from your balance as above. ### Response | Field | Type | Notes | | --- | --- | --- | | `object` | string | `search.batch` | | `lane` | string | The lane you asked for. | | `count` | integer | Rows requested. | | `served` | integer | Rows served, repeats included. See `billed_queries` for what was billed. | | `billed_queries` | integer | Distinct queries served and billed. | | `deduplicated` | integer | Rows that repeated an earlier query and were not billed. | | `duration_ms` | integer | Time the batch took, in milliseconds. | | `results[].index` | integer | Position in `queries`. | | `results[].query` | string | The query. | | `results[].ok` | boolean | Whether the row was served. | | `results[].served_lane` | string | Served rows: the lane billed. | | `results[].results` | array | Served rows: the hits, shaped like [Search](https://api.kaer.ai/docs/search) results; deep rows carry `text`, `text_truncated` and `text_source`. | | `results[].charged` | boolean | `false` on rows that failed and on repeats. | | `results[].duplicate_of` | integer | Repeats: the `index` of the row that ran the query. | | `results[].deep` | boolean | Deep rows: `true` when pages were read, `false` when the row fell back to snippets. | | `results[].degraded_reason` | string | Deep rows with `deep: false`: `timeout`, `engines_failed` or `pages_unreadable`. | | `results[].quality` | object | `partial` (boolean), `coverage` (0 to 1) and `result_count`, when the lane reports them. | | `results[].answer` | object | Served rows: an instant answer, shaped like [Search](https://api.kaer.ai/docs/search)'s `answer`, when the query asks for one. | | `results[].code` | string | Failed rows: `timeout`, `backpressure`, `upstream_unavailable`, `invalid_query`, `no_results` or `internal`. | | `results[].error` | string | Failed rows: a fixed message for `code`. | | `warnings` | string[] | Request fields the batch did not apply as sent, when there are any. | | `kaer.cost_usd` | number | What the batch cost. `0` when a search plan paid for it. | | `kaer.plan_units` | object | Plan-paid batches only: the search units the batch `used` and the units `remaining` this month. | Rows carry only the fields above. Retry `timeout`, `backpressure` and `upstream_unavailable` rows; fix `invalid_query` rows; `internal` is ours to fix. Headers: `x-request-id` and the `x-ratelimit-*` headers. The cost is `kaer.cost_usd` in the body; there is no `x-kaer-cost-usd` header. ### Errors | Status | Code | Meaning | | --- | --- | --- | | 400 | `invalid_json` | The body is not valid JSON. Images also needs a JSON object. | | 400 | `queries_required` | `queries` is missing or empty. | | 400 | `batch_too_large` | More queries than your tier's batch size. | | 400 | `invalid_query` | A batch query is blank or over 512 characters. | | 400 | `invalid_lane` | `lane` is not `web`, `fast`, `deep` or `auto`. | | 400 | `invalid_num_results` | `num_results` is not a number. | | 400 | `invalid_domains` | `include_domains` or `exclude_domains` is not an array of up to 20 host names. | | 400 | `invalid_fields` | `fields` is empty, has more than 20 names, or names a key that results do not have. | | 403 | `tier_required` | Your tier does not include this service yet. | | 429 | `too_many_concurrent_searches` | Your account already has its maximum of searches in flight: your tier's figure, or your search plan's when that is higher. | | 413 | `body_too_large` | The body is over the endpoint's limit: chat 1 MB, search 16 KB, batch 64 KB, images 8 KB, mail 10 MB. | | 502 | `search_failed` | The search service failed. Nothing was charged. | | 503 | `search_busy` | Search is at capacity. Nothing was charged. | | 504 | `search_timeout` | Search ran out of time. Nothing was charged. | | 502 or 503 | `search_unavailable` | Search is unreachable or paused. Nothing was charged. | ```bash curl https://api.kaer.ai/v1/search/batch \ -H "Authorization: Bearer $KAER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "queries": ["solar panel efficiency 2026", "heat pump grants uk"], "lane": "web", "num_results": 3 }' ``` ```python import os, requests r = requests.post( "https://api.kaer.ai/v1/search/batch", headers={"Authorization": f"Bearer {os.environ['KAER_API_KEY']}"}, json={ "queries": ["solar panel efficiency 2026", "heat pump grants uk"], "lane": "web", "num_results": 3, }, timeout=90, ) data = r.json() for row in data["results"]: if row["ok"]: print(row["query"], "->", len(row["results"]), "results") else: print(row["query"], "failed:", row.get("error")) print("Served", data["served"], "of", data["count"], "for", data["kaer"]["cost_usd"], "USD") ``` ```javascript const res = await fetch("https://api.kaer.ai/v1/search/batch", { method: "POST", headers: { Authorization: `Bearer ${process.env.KAER_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ queries: ["solar panel efficiency 2026", "heat pump grants uk"], lane: "web", num_results: 3, }), }); const data = await res.json(); for (const row of data.results) { console.log(row.query, row.ok ? `${row.results.length} results` : `failed: ${row.error}`); } ``` ### Next steps - [Search](https://api.kaer.ai/docs/search): Lanes, filters and the result fields. - [Search pricing](https://api.kaer.ai/docs/search-pricing): What a batch costs, row by row. ## Images {#images} `POST /v1/images` - Scope: `search` - Tier: Starter and up - Price: $0.002 per call Find real photos, diagrams and illustrations for a subject, from Kaer's picture index and, when the index is thin, live results from openly licensed sources. Every picture comes with its licence, a ready-made credit line and whether a business website may reuse it. ### Request body | Parameter | Type | Required | Default | Notes | | --- | --- | --- | --- | --- | | `query` | string | yes | | What to picture, 1 to 300 characters ("sourdough bread", "water cycle diagram"). | | `count` | integer | no | 12 | 1 to 30 pictures. Anything else, a numeric string included, is a 400. | | `reusable` | boolean | no | false | Only pictures a business website may use with the returned credit. | Other fields come back in `kaer.ignored_params`. The body is limited to 8 KB; a call times out after 15 seconds. ### Price One call costs $0.002 whatever `count` is, even when it finds no pictures. A call that fails is not charged. ### Response | Field | Type | Notes | | --- | --- | --- | | `object` | string | `images.result` | | `query` | string | The query, trimmed. | | `subject` | string | The subject the index searched for. | | `count` | integer | Pictures returned. | | `reusable_only` | boolean | Echoes `reusable`. | | `withheld` | object | Present when some pictures were held back. | | `results[].id` | string | Stable picture id. | | `results[].kind` | string | `photo`, `diagram` or `illustration`. | | `results[].title` | string | Picture title. | | `results[].image_url` | string | Full-size image (https). | | `results[].thumb_url` | string | Thumbnail (https). | | `results[].page_url` | string | The page the picture comes from. | | `results[].host` | string | That page's host. | | `results[].width, height` | integer | Pixel size, when known. | | `results[].source` | string | `wikimedia_commons`, `pexels` or `web`. | | `results[].license` | object | `name`, `code`, `label` and `url`. | | `results[].credit` | string | Author or owner. | | `results[].attribution` | string | Attribution text from the source. | | `results[].credit_line` | string | A ready-made credit to publish with the picture. | | `results[].attribution_required` | boolean | Publish `credit_line` next to the picture when `true`. | | `results[].share_alike` | boolean | Derivatives must keep the same licence. | | `results[].commercial_ok` | boolean | A business website may use it. | ```json { "object": "images.result", "query": "sourdough bread", "subject": "sourdough bread", "count": 12, "reusable_only": true, "results": [ { "id": "commons:sourdough.jpg", "kind": "photo", "title": "Sourdough loaf", "image_url": "https://upload.wikimedia.org/…", "thumb_url": "https://upload.wikimedia.org/…/500px-…", "page_url": "https://commons.wikimedia.org/wiki/File:…", "host": "commons.wikimedia.org", "width": 4000, "height": 3000, "source": "wikimedia_commons", "license": { "name": "…", "code": "cc-by-sa", "label": "CC BY-SA 4.0", "url": "https://creativecommons.org/licenses/by-sa/4.0/" }, "credit": "Ann K", "attribution": "…", "credit_line": "…", "attribution_required": true, "share_alike": true, "commercial_ok": true } ], "kaer": { "request_id": "req_…", "cost_usd": 0.002 } } ``` Headers: `x-request-id` and the `x-ratelimit-*` headers. The cost is `kaer.cost_usd` in the body; there is no `x-kaer-cost-usd` header. ### Errors | Status | Code | Meaning | | --- | --- | --- | | 400 | `invalid_json` | The body is not valid JSON. Images also needs a JSON object. | | 400 | `query_required` | `query` is missing or blank. | | 400 | `query_too_long` | `query` is over 512 characters (search) or 300 (images). | | 400 | `invalid_count` | `count` is not an integer from 1 to 30. | | 400 | `invalid_reusable` | `reusable` is not `true` or `false`. | | 403 | `tier_required` | Your tier does not include this service yet. | | 413 | `body_too_large` | The body is over the endpoint's limit: chat 1 MB, search 16 KB, batch 64 KB, images 8 KB, mail 10 MB. | | 502 | `images_failed` | The picture search failed. Nothing was charged. | | 503 | `images_busy` | Images are at capacity. Nothing was charged. | | 502 or 503 | `images_unavailable` | Images are unreachable, timed out or paused. Nothing was charged. | ```bash curl https://api.kaer.ai/v1/images \ -H "Authorization: Bearer $KAER_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "sourdough bread", "count": 20, "reusable": true}' ``` ```python import os, requests r = requests.post( "https://api.kaer.ai/v1/images", headers={"Authorization": f"Bearer {os.environ['KAER_API_KEY']}"}, json={"query": "sourdough bread", "count": 20, "reusable": True}, timeout=30, ) for picture in r.json()["results"]: print(picture["image_url"]) if picture["attribution_required"]: print(" credit:", picture["credit_line"]) ``` ```javascript const res = await fetch("https://api.kaer.ai/v1/images", { method: "POST", headers: { Authorization: `Bearer ${process.env.KAER_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ query: "sourdough bread", count: 20, reusable: true }), }); for (const picture of (await res.json()).results) { console.log(picture.image_url, picture.attribution_required ? picture.credit_line : ""); } ``` ### Next steps - [Search pricing](https://api.kaer.ai/docs/search-pricing): Image prices next to search prices. - [Search](https://api.kaer.ai/docs/search): Search the web for pages instead of pictures. ## Search pricing {#search-pricing} Search is billed per query, not per result: a query costs the same with 1 result or 25. The price is set by the lane that served it. | Lane | Per query | Per 1,000 | Per 100,000 | | --- | --- | --- | --- | | `web` | $0.0005 | $0.50 | $50.00 | | `fast` | $0.001 | $1.00 | $100.00 | | `deep` | $0.003 | $3.00 | $300.00 | | `auto` | $0.0005 to $0.003 | As served | As served | | Images (`POST /v1/images`) | $0.002 per call | $2.00 | $200.00 | ### Know what is billed - A served query is billed whatever `num_results` is and however many results come back, an empty list included. - `auto` holds the deep price ($0.003) while it runs, then settles at the lane that served it; `served_lane` names it. If the lane cannot be read, the query is billed as `deep`. - In a batch, each distinct query that is served is billed like a single search. Repeats of a query in the same batch (`duplicate_of`) and failed rows are free. The hold is the dearest lane price times the number of distinct queries. - Queries that fail or time out are not charged. - On the Free tier, search opens with the card bonus (single searches only) or a [search plan](https://api.kaer.ai/docs/search-plans). - With a search plan, queries use its monthly units first and are paid from your balance at these prices once the units run out. ### Estimate your cost At today's prices: - 10,000 `web` searches: 10,000 × $0.0005 = **$5.00** - 10,000 `fast` searches: 10,000 × $0.001 = **$10.00** - 10,000 `deep` searches: 10,000 × $0.003 = **$30.00** - 100 `auto` searches: 60 served by `web`, 30 by `fast`, 10 by `deep`: 60 × $0.0005 + 30 × $0.001 + 10 × $0.003 = **$0.09** - A batch of 50 `fast` queries, 2 rows failed: 48 × $0.001 (hold while running: 50 × $0.001) = **$0.048** - 1,000 image calls: 1,000 × $0.002 = **$2.00** ### Next steps - [Search plans](https://api.kaer.ai/docs/search-plans): A monthly allowance of search units. - [Billing](https://api.kaer.ai/docs/billing): Holds, top-ups and bonuses. ## Search plans {#search-plans} A search plan gives a workspace a monthly allowance of search units, paid by card at the start of each billing month. While the plan is active, `POST /v1/search` and `POST /v1/search/batch` take units from the allowance first. Nothing is billed after use: past the allowance, searches are paid from your prepaid balance at [search prices](https://api.kaer.ai/docs/search-pricing), exactly as without a plan. | Plan | Per month | Search units | Per 1K units | Searches in flight | | --- | --- | --- | --- | --- | | Developer | $25 | 30,000 | $0.83 | 20 | | Production | $50 | 75,000 | $0.67 | 50 | | Growth | $90 | 150,000 | $0.60 | 100 | | Volume | $240 | 500,000 | $0.48 | 250 | | Fleet | $490 | 1,200,000 | $0.41 | 500 | Subscribe, change or cancel a plan in Billing in the dashboard. Compare plans on [kaer.ai](https://kaer.ai/search/pricing). ### Count units - A served `web` or `fast` query uses 1 unit, a `deep` query 3. `auto` uses the units of the lane that served it. - While a call runs it holds the lane's units for every distinct query (`auto` holds 3), then gives back what the served lanes did not use. Failed queries and repeated rows in a batch use nothing. - If the units left cannot cover the whole hold, the call is paid from your balance instead. A call is never split between the two. - A plan-paid call answers `kaer.cost_usd: 0` and `kaer.plan_units`, with the units it `used` and the units `remaining` this month. - Images are paid from your balance, not from units. ```json { "kaer": { "request_id": "req_…", "cost_usd": 0, "plan_units": { "used": 1, "remaining": 29999 } } } ``` ### Renewal, changes and limits - The allowance resets on each renewal date. Unused units do not carry over. - Each renewal is charged to the card on the plan. Until it is paid, searches are paid from your balance. - Upgrade at any time: you pay the price difference for the rest of the month, and this month's allowance rises by the same share of the extra units. The upgrade applies once that payment succeeds. - A downgrade takes effect at renewal. Until then you keep the current plan and its units. - Cancel at any time: the plan runs to the end of the month already paid and nothing more is charged. You can resume it until then. - A refunded or disputed plan payment takes back the units it bought that are still unused; units already used never become a balance owed. A dispute also pauses the account, as for a top-up. - A plan opens search and batch search on any tier. On the Free tier a batch takes up to 10 queries. - Searches in flight per account rise to the plan's figure when your tier's is lower. Over the limit, 429 `too_many_concurrent_searches`. - Plan payments do not count toward your tier, which is earned by credit you have paid in. ### Next steps - [Search pricing](https://api.kaer.ai/docs/search-pricing): What searches past the allowance cost. - [Rate limits and tiers](https://api.kaer.ai/docs/limits): Searches in flight per tier. ## Maps {#maps} `GET /v1/maps?action=…` - Scope: `maps` - Tier: Starter and up - Price: $0.05 per 1,000 requests, $0.005 per 1,000 site images Pass `action` and its parameters in the query string. You are charged only for answered requests (HTTP 2xx). ### Pick an action | Action | Does | Parameters | Per 1,000 | | --- | --- | --- | --- | | `closures` | Road closures near a place or box. | Same as `incidents` | $0.05 | | `departures` | Next departures at stops. | `stop_ids` (up to 4, required); `n` 1 to 20, default 8 | $0.05 | | `fuel_prices` | Fuel prices nearby. | `near` (required); `radius_m` default 6,000, max 30,000 | $0.05 | | `geocode` | Find places by name or address. | `query` (or `q`, required); `limit` 1 to 20, default 5 | $0.05 | | `incidents` | Road incidents near a place or box. | `near` (a place or a 4-number bbox); `radius_m` default 5,000, max 80,000; `limit` default 25, max 100; `kinds`; `pts` | $0.05 | | `journey` | A door-to-door trip plan. | `from`, `to`; `depart_at` | $0.05 | | `place_at` | The place under a point, with its website. | `lat`, `lon` (required); `name` hint | $0.05 | | `poi` | Places near a point. | `near` (required); `category`; `radius_m` default 1,500, max 50,000; `limit` default 24, max 50 | $0.05 | | `rail` | Train connections. | `from`, `to`; `time`; `arrive_by=true` | $0.05 | | `reverse` | The place at a point. | `lat`, `lon`; `fine=1` for address level | $0.05 | | `road_classes` | Road-type breakdown of a route. | Same as `route` | $0.05 | | `route` | Directions. | `from`, `to` (required); `mode` `drive`, `truck`, `walk` or `bike`; `via` (up to 5, `\|`-separated); `avoid`; `depart_at`; `units` | $0.05 | | `route_traffic` | Traffic along a route. | `pts` as `lat,lon\|lat,lon…` (up to 16, required); `depart_at` | $0.05 | | `site_image` | A website's preview image. | `url` (required) | $0.005 | | `site_images` | Preview images for up to 12 websites. | `urls`, `\|`-separated (required) | $0.005 | | `speed_cameras` | Speed cameras nearby. | `near` or `bbox`; `radius_m` 500 to 40,000, default 8,000 | $0.05 | | `stops` | Stops near a point. | `near` (required); `radius_m` 100 to 3,000, default 600 | $0.05 | | `traffic_status` | Which traffic sources are live. | None | $0.05 | | `transit` | Public transport itineraries. | `from`, `to`; `limit` default 3, max 6; `time`; `arrive_by=true` | $0.05 | | `weather` | Forecast. | `place` (or `near`, required); `days` default 3, max 14 | $0.05 | Any action ranks nearby results first when you pass `near_lat` and `near_lon` (and optionally `near_country`). Live flight search and IP geolocation are not offered on the API. ### Read responses and errors Answers are JSON from the maps service, shaped per action: `geocode` returns `results`, `route` returns `distance_m`, `duration_s`, `steps` and `geometry`, `weather` returns `current` and `daily`. Headers: `x-request-id`, the `x-ratelimit-*` headers and `x-kaer-cost-usd` on every answer from the maps service (`0` when it was not charged). > Note: Each answer carries `attribution`. Show it where you display map data. Errors from the maps service keep their own shape, `{"error": "bad arguments: …", "code": "MAPS_…"}`: 400 for bad arguments (`MAPS_MODE_UNSUPPORTED`, `MAPS_BBOX_INVALID`, `MAPS_BBOX_TOO_LARGE`), 404 when nothing matches, 429, 502 or 503 when the maps service is busy or down. None of them is charged. Gateway errors (auth, balance, `unsupported_action`, `maps_unavailable`) are OpenAI-shaped. ### Price Worked examples: - 10,000 geocodes: 10,000 × $0.00005 = **$0.50** - 10,000 routes and 10,000 site images: 10,000 × $0.00005 + 10,000 × $0.000005 = **$0.55** ### Geocode an address ```bash curl "https://api.kaer.ai/v1/maps?action=geocode&query=1600+Pennsylvania+Ave&limit=3" \ -H "Authorization: Bearer $KAER_API_KEY" ``` ```python import os, requests r = requests.get( "https://api.kaer.ai/v1/maps", headers={"Authorization": f"Bearer {os.environ['KAER_API_KEY']}"}, params={"action": "geocode", "query": "1600 Pennsylvania Ave", "limit": 3}, timeout=30, ) print(r.json()["results"][0]) print("Cost (USD):", r.headers["x-kaer-cost-usd"]) ``` ```javascript const params = new URLSearchParams({ action: "geocode", query: "1600 Pennsylvania Ave", limit: "3" }); const res = await fetch(`https://api.kaer.ai/v1/maps?${params}`, { headers: { Authorization: `Bearer ${process.env.KAER_API_KEY}` }, }); console.log((await res.json()).results[0]); console.log("Cost (USD):", res.headers.get("x-kaer-cost-usd")); ``` ### Next steps - [Response headers](https://api.kaer.ai/docs/headers): Read the cost and rate-limit headers. - [Rate limits and tiers](https://api.kaer.ai/docs/limits): When maps opens and how fast you can call it. ## Mail {#mail} `POST /v1/mail/send` - Scope: `mail` - Tier: Build and up - Price: $0.001 per message + $0.0005 per recipient Send transactional email from Kaer's own sending domain. Messages leave from `api-@kaer.dev` with the display name ` via Kaer` (your account's email domain when `from_name` is empty, or `Kaer API` when that domain is a mail brand such as gmail.com), and a short footer naming that domain and the message id for abuse reports. Replies go to `reply_to`. ### Request body | Parameter | Type | Required | Default | Notes | | --- | --- | --- | --- | --- | | `to` | string or string[] | yes | | Plain addresses. `to`, `cc` and `bcc` together count toward your tier's recipients per message. Duplicates are removed; Kaer's own domains are refused. | | `cc` | string or string[] | no | | Plain addresses, shown to every recipient. | | `bcc` | string or string[] | no | | Plain addresses, hidden from the other recipients. | | `subject` | string | yes | | Up to 200 characters. Line breaks become spaces. | | `text` | string | no | | Plain-text body, up to 128 KB. Send `text`, `html` or both. | | `html` | string | no | | HTML body, up to 256 KB. | | `from_name` | string | no | | Display name, up to 64 characters. Quotes, `<`, `>`, `@` and `\` are removed. Third-party brand names are refused (`from_name_brand`). | | `reply_to` | string | no | | One plain address. Cannot be a Kaer address. | | `attachments` | object[] | no | | Up to 10 files of `{filename, content, content_type?}`, `content` in base64, 7 MB together once decoded. Every file is scanned for malware; types that run code or macros (`.exe`, `.js`, `.docm`, `.iso` and the like) are refused. | | `Idempotency-Key` | header | no | | Optional, up to 200 characters. See [Idempotency](https://api.kaer.ai/docs/idempotency). | `from` and `headers` are refused with 400 `unsupported_field`. The body is limited to 10 MB. ### Response | Field | Type | Notes | | --- | --- | --- | | `id` | string | `msg_` and 24 hex characters. | | `object` | string | `mail.message` | | `status` | string | `sent` when the mail server accepted it. | | `from` | string | The sending address. | | `recipients` | integer | Recipients in `to`, `cc` and `bcc` after removing duplicates. | | `idempotent_replay` | boolean | `true` when an `Idempotency-Key` repeat returned the first result. | | `kaer.cost_usd` | number | What the message cost. Also in `x-kaer-cost-usd`. | ```json { "id": "msg_63bd80dded23e6452659ed84", "object": "mail.message", "status": "sent", "from": "api-…@kaer.dev", "recipients": 1, "kaer": { "request_id": "req_…", "cost_usd": 0.0015 } } ``` Headers: `x-request-id`, the `x-ratelimit-*` headers and `x-kaer-cost-usd` on a sent message. An idempotent replay has no `x-kaer-cost-usd` and no `from`. ### Check a message's status `GET /v1/mail/messages/{id}` Returns `id`, `object`, `status` (`sending`, `sent` or `failed`), `recipients`, `delivery`, `error` (a code, or `null`), `created_at` and `kaer.cost_usd`. An unknown id is 404 `message_not_found`. We keep recipient counts and domains, never addresses, subjects or bodies. `delivery` counts recipients by what their mail server did: `pending` (not answered yet), `delivered`, `deferred` (temporarily refused; we retry for up to 5 days) and `bounced` (refused, or still undelivered after 5 days). `delivered` and `bounced` are final. The counts update as receiving servers answer. `delivery` is `null` when per-recipient status is not tracked for the message, and then it stays `null`. ```json { "id": "msg_63bd80dded23e6452659ed84", "object": "mail.message", "status": "sent", "recipients": 3, "delivery": { "pending": 0, "delivered": 2, "deferred": 0, "bounced": 1 }, "error": null, "created_at": "2026-10-27 15:04:11.52+00", "kaer": { "cost_usd": 0.0025 } } ``` ### Price Worked examples: - One message to 3 recipients: $0.001 + 3 × $0.0005 = **$0.0025** - 1,000 messages, one recipient each: 1,000 × ($0.001 + $0.0005) = **$1.50** A message the mail server does not accept is not charged. > Note: Free credit never pays for mail. Mail is paid from paid credit only. ### Stay within your tier's limits | Tier | Recipients per day (UTC) | Messages per minute | Recipients per message | | --- | --- | --- | --- | | Build | 100 | 5 | 10 | | Scale | 1,000 | 30 | 50 | | Pro | 10,000 | 120 | 100 | The minute cap counts messages sent in the last 60 seconds; the daily cap counts recipients since 00:00 UTC. Failed messages do not count. Over a cap you get 429 `mail_rate_limit` (`Retry-After: 60`) or `mail_daily_limit` (`Retry-After` until midnight UTC). ### Errors | Status | Code | Meaning | | --- | --- | --- | | 400 | `invalid_json` | The body is not valid JSON. Images also needs a JSON object. | | 400 | `invalid_body` | The mail body is not a JSON object. | | 400 | `unsupported_field` | Mail got `from` or `headers`. | | 400 | `to_required` | `to` is missing or empty. | | 400 | `invalid_recipient` | A recipient is not a plain email address. | | 400 | `reserved_recipient` | A recipient is on a Kaer sending domain. | | 400 | `too_many_recipients` | More recipients than your tier allows in one message, counting `to`, `cc` and `bcc` together. | | 400 | `subject_required` | `subject` is missing or blank. | | 400 | `subject_too_long` | `subject` is over 200 characters. | | 400 | `body_required` | Neither `text` nor `html` was sent. | | 400 | `text_too_large` | `text` is over 128 KB. | | 400 | `html_too_large` | `html` is over 256 KB. | | 400 | `invalid_from_name` | `from_name` is not a string. | | 400 | `from_name_brand` | `from_name` names a third-party brand (PayPal, Microsoft, a bank, a carrier). | | 400 | `invalid_reply_to` | `reply_to` is not a plain email address. | | 400 | `reserved_reply_to` | `reply_to` is a Kaer address. | | 400 | `invalid_attachment` | An attachment has no `filename`, its `content` is not base64, or its `content_type` is not a media type. | | 400 | `attachment_blocked` | An attachment's file type can run code or macros (for example `.exe`, `.js`, `.docm`, `.iso`). | | 400 | `too_many_attachments` | More than 10 attachments. | | 400 | `attachments_too_large` | Attachments are over 7 MB together, decoded. | | 413 | `body_too_large` | The body is over the endpoint's limit: chat 1 MB, search 16 KB, batch 64 KB, images 8 KB, mail 10 MB. | | 403 | `tier_required` | Your tier does not include this service yet. | | 402 | `insufficient_credits` | Your balance cannot cover the call's hold. Free credit never pays for mail. | | 429 | `mail_rate_limit` | Messages in the last minute reached your tier's cap. | | 429 | `mail_daily_limit` | Recipients today (UTC) would pass your tier's cap. | | 502 | `mail_rejected` | The mail server refused the message. Nothing was charged. | | 502 | `mail_transport_failed` | The message could not be handed to the mail server. Nothing was charged. | | 503 | `mail_unavailable` | Mail sending is not available. Nothing was charged. | | 404 | `message_not_found` | No message with that id on this account. | ### Send a message This request sends a receipt with an `Idempotency-Key`, so a retry cannot send it twice. ```bash curl https://api.kaer.ai/v1/mail/send \ -H "Authorization: Bearer $KAER_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-4812-receipt" \ -d '{ "to": ["ana@example.com"], "subject": "Your receipt", "text": "Thanks for your order.", "from_name": "Acme", "reply_to": "help@acme.com" }' ``` ```python import os, requests r = requests.post( "https://api.kaer.ai/v1/mail/send", headers={ "Authorization": f"Bearer {os.environ['KAER_API_KEY']}", "Idempotency-Key": "order-4812-receipt", }, json={ "to": ["ana@example.com"], "subject": "Your receipt", "text": "Thanks for your order.", "from_name": "Acme", "reply_to": "help@acme.com", }, timeout=30, ) print(r.json()) ``` ```javascript const res = await fetch("https://api.kaer.ai/v1/mail/send", { method: "POST", headers: { Authorization: `Bearer ${process.env.KAER_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "order-4812-receipt", }, body: JSON.stringify({ to: ["ana@example.com"], subject: "Your receipt", text: "Thanks for your order.", from_name: "Acme", reply_to: "help@acme.com", }), }); console.log(await res.json()); ``` ### Next steps - [Idempotency](https://api.kaer.ai/docs/idempotency): Retry a send without sending twice. - [Billing](https://api.kaer.ai/docs/billing): Top up the paid credit mail needs. ## Account {#account} `GET /v1/me` - Scope: Any key - Tier: All tiers - Price: Free; counts toward your rate limit Look up the calling key, its scopes, your tier and your balances. | Field | Type | Notes | | --- | --- | --- | | `account` | string | Your account's public id. | | `key.id, key.name, key.scopes` | | The calling key. | | `key.monthly_budget_usd` | number or null | The key's budget, if set. | | `tier.id, tier.name` | | Your tier. | | `tier.rpm_per_key` | integer | Requests per minute for one key. | | `tier.services` | string[] | Services this account can call now: your tier's, plus `search` when the card bonus or a search plan opens it. | | `balance.paid_usd` | number | Paid credit available now (open holds excluded). | | `balance.free_credit_usd` | number | Free credit available now (the card bonus, or sign-up credit given before 2026-10-31); 0 once it expires. | | `balance.free_credit_expires_at` | string or null | When free credit expires. | | `balance.month_spend_usd` | number | Spend this calendar month (UTC). | ```json { "object": "account", "account": "acct_…", "key": { "id": "key_…", "name": "Production", "scopes": ["models", "search"], "monthly_budget_usd": null }, "tier": { "id": 1, "name": "Starter", "rpm_per_key": 60, "services": ["models","search","maps"] }, "balance": { "paid_usd": 12.5, "free_credit_usd": 7.25, "free_credit_expires_at": "2026-12-28T10:00:00+00:00", "month_spend_usd": 4.1 } } ``` Headers: `x-request-id` and the `x-ratelimit-*` headers. ```bash curl https://api.kaer.ai/v1/me \ -H "Authorization: Bearer $KAER_API_KEY" ``` ```python import os, requests r = requests.get( "https://api.kaer.ai/v1/me", headers={"Authorization": f"Bearer {os.environ['KAER_API_KEY']}"}, timeout=30, ) print(r.json()["balance"]) ``` ```javascript const res = await fetch("https://api.kaer.ai/v1/me", { headers: { Authorization: `Bearer ${process.env.KAER_API_KEY}` }, }); console.log((await res.json()).balance); ``` ### Next steps - [Billing](https://api.kaer.ai/docs/billing): How balances, holds and top-ups work. - [Rate limits and tiers](https://api.kaer.ai/docs/limits): What your tier opens. ## LangChain {#langchain} `langchain-kaer` connects LangChain agents and chains to [Kaer Search](https://api.kaer.ai/docs/search). It provides `KaerSearch`, a tool a model can call to search the web, and `KaerSearchRetriever`, which returns search results as LangChain documents. Both send one `POST /v1/search` request per query and work in sync and async code. - Package: [`langchain-kaer`](https://pypi.org/project/langchain-kaer/) on PyPI - Source: [Kaer-AI/langchain-kaer](https://github.com/Kaer-AI/langchain-kaer) - Scope: `search` - Price: Each query is billed like `POST /v1/search`, see [Search pricing](https://api.kaer.ai/docs/search-pricing) ### Before you begin - A key with the `search` scope. See [Authentication](https://api.kaer.ai/docs/authentication). - Search open on your account: add a card in Billing, which comes with 1,000 free web searches, or make a first top-up of $5 or more. Until then a search returns 403 `tier_required`. - Python 3.10 or later. ### Install the package ```bash pip install -U langchain-kaer export KAER_API_KEY="kaer_live_..." ``` The package reads your key from `KAER_API_KEY`. You can also pass it in code: `KaerSearch(kaer_api_key="...")`. ### Search with the tool ```python from langchain_kaer import KaerSearch tool = KaerSearch(max_results=5) tool.invoke({"query": "latest results on perovskite solar cells"}) ``` The tool returns the query, the lane that served it and a list of results. Each result has a `title`, `url` and `snippet`, plus `published_date` when it is known and, on the `deep` lane, the page's main `text` and `text_truncated`. An instant `answer` and any `warnings` come with them when the API sends them. ### Give the tool to an agent The agent and chain examples also need LangChain and a model package, installed in their first line. Any chat model that supports tool calling works. ```python # pip install -U langchain langchain-anthropic from langchain.agents import create_agent from langchain_kaer import KaerSearch agent = create_agent( model="anthropic:claude-sonnet-5-5", tools=[KaerSearch(max_results=5)], ) result = agent.invoke( { "messages": [ {"role": "user", "content": "What changed in the EU AI Act this month?"} ] } ) print(result["messages"][-1].content) ``` When a model calls the tool, the `ToolMessage` content holds compact results for the model to read. Its `artifact` holds the full API response, including `kaer.request_id` and `kaer.cost_usd`, so your code can log what each search cost. ### Set what the model can choose The model sets these arguments on each call. Values it sets override the defaults you gave the tool. | Parameter | Type | Required | Default | Notes | | --- | --- | --- | --- | --- | | `query` | string | yes | | What to search for, 1 to 512 characters. | | `lane` | string | no | | `web`, `fast`, `deep` or `auto`. | | `include_domains` | string[] | no | | Only return results from these host names or their subdomains. | | `exclude_domains` | string[] | no | | Never return results from these host names. | You fix these settings when you create the tool: | Parameter | Type | Required | Default | Notes | | --- | --- | --- | --- | --- | | `max_results` | integer | no | 5 | Results per query, 1 to 25. | | `lane` | string | no | auto | The lane used when the model does not choose one. | | `allow_model_lane` | boolean | no | True | Set `False` to always use `lane`, which keeps the price per query fixed. | | `include_domains` | string[] | no | | Default host names to search within. | | `exclude_domains` | string[] | no | | Default host names to leave out. | | `kaer_api_key` | string | no | KAER_API_KEY | Your key. Read from the environment variable when you leave it out. | | `timeout` | number | no | 60 | Seconds to wait for a response. | ### Choose a lane | Lane | What it does | Per query | Timeout | | --- | --- | --- | --- | | `web` | Kaer's own index alone. Fastest and cheapest. | $0.0005 | 6 s | | `fast` | Kaer's index racing the live web. | $0.001 | 12 s | | `deep` | Every lane, re-ranked. Results carry the page's main text, up to 4,000 characters, when the page could be read. | $0.003 | 40 s | | `auto` | Kaer picks a lane for each query and bills the lane that served it. | As served | 40 s | A search that fails or times out is not charged. ### Retrieve documents `KaerSearchRetriever` returns a list of `Document` objects. On the `deep` lane, `page_content` is the page's main text; on the other lanes it is the result snippet. `metadata` holds `served_lane` and, when the result has them, `title`, `url`, `snippet`, `source`, `published_date`, `text_truncated` and `text_source`. ```python from langchain_kaer import KaerSearchRetriever retriever = KaerSearchRetriever(k=5, lane="deep") docs = retriever.invoke("How do heat pumps work in cold climates?") for doc in docs: print(doc.metadata["title"], doc.metadata["url"]) ``` Pass `k` at call time to change how many documents come back: `retriever.invoke(query, k=3)`. To answer from the documents, pipe the retriever into a prompt and a model: Python: answer from search results: ```python # pip install -U langchain langchain-anthropic from langchain_core.output_parsers import StrOutputParser from langchain_core.prompts import ChatPromptTemplate from langchain_core.runnables import RunnablePassthrough from langchain.chat_models import init_chat_model from langchain_kaer import KaerSearchRetriever retriever = KaerSearchRetriever(k=5, lane="deep") llm = init_chat_model("anthropic:claude-sonnet-5-5") prompt = ChatPromptTemplate.from_template( "Answer from the sources and cite their URLs.\n\n" "Sources:\n{context}\n\nQuestion: {question}" ) def format_docs(docs): return "\n\n".join(f"{d.metadata['url']}\n{d.page_content}" for d in docs) chain = ( {"context": retriever | format_docs, "question": RunnablePassthrough()} | prompt | llm | StrOutputParser() ) print(chain.invoke("How do heat pumps work in cold climates?")) ``` ### Call the API directly `KaerSearchAPIWrapper` sends the request and returns the API's JSON response. It accepts every request field of [Search](https://api.kaer.ai/docs/search), including `offset` and `page` for paging on the `web` and `fast` lanes, and `fields` to choose which result keys come back. ```python from langchain_kaer import KaerSearchAPIWrapper search = KaerSearchAPIWrapper() data = search.search( "solar panel efficiency records", lane="fast", num_results=10, offset=10 ) print(data["served_lane"], data["kaer"]["cost_usd"]) ``` Use `await search.asearch(...)` in async code. To send requests through your own `httpx` client, for a proxy or retries, pass `client=` or `async_client=` to the wrapper, then hand the wrapper to the tool or retriever: `KaerSearch(api_wrapper=KaerSearchAPIWrapper(client=my_client))`. ### Handle errors `KaerSearchAPIWrapper` checks the query, lane, domain lists and paging before it sends anything, and raises `ValueError` when one is out of range. An error from the API raises `KaerAPIError`, with the HTTP `status_code`, the API's error `code`, its `message`, the `request_id` and `retry_after` when the API sent one. When no response arrives, `status_code` is `None`, and `code` is `timeout` if the request timed out. The tool catches both errors and returns them to the model as an error `ToolMessage`, so an agent can recover. The retriever raises them. | Status | Code | Meaning | | --- | --- | --- | | 401 | `invalid_api_key` | The key is malformed, unknown, revoked or expired. | | 402 | `insufficient_credits` | Your balance cannot cover the call's hold. Free credit never pays for mail. | | 403 | `tier_required` | Your tier does not include this service yet. | | 403 | `insufficient_scope` | The key does not have the endpoint's scope. | | 429 | `rate_limit_exceeded` | Too many requests this minute for the key or the account, or too many invalid keys from your address. | | 429 | `too_many_concurrent_searches` | Your account already has its maximum of searches in flight: your tier's figure, or your search plan's when that is higher. | | 502 | `search_failed` | The search service failed. Nothing was charged. | | 504 | `search_timeout` | Search ran out of time. Nothing was charged. | Every code, with its fix, is in [Errors](https://api.kaer.ai/docs/errors). ### Next steps - [Search](https://api.kaer.ai/docs/search): Every request field and response field the package sends and reads. - [Search pricing](https://api.kaer.ai/docs/search-pricing): The price per query on each lane. - [Key security](https://api.kaer.ai/docs/keys): Give the agent's key a budget and an allow-list. ## n8n {#n8n} `n8n-nodes-kaer` is an n8n community node for [Kaer Search](https://api.kaer.ai/docs/search). It searches the web from a workflow, or from an AI Agent node as a tool, and returns ranked results with titles, URLs and snippets. On the Deep lane, results also carry the page's main text. - Package: [`n8n-nodes-kaer`](https://www.npmjs.com/package/n8n-nodes-kaer) on npm - Source: [Kaer-AI/n8n-nodes-kaer](https://github.com/Kaer-AI/n8n-nodes-kaer) - Operation: Search: **Search the web** (`POST /v1/search`) - Price: Each search is billed like `POST /v1/search`, see [Search pricing](https://api.kaer.ai/docs/search-pricing) ### Before you begin - A key with the `search` scope. See [Authentication](https://api.kaer.ai/docs/authentication). - Search open on your account: add a card in Billing, which comes with 1,000 free web searches, or make a first top-up of $5 or more. Until then a search returns 403 `tier_required`. - A self-hosted n8n instance where you can install community nodes. n8n Cloud lists a community node only after n8n has verified it. ### Install the node 1. In n8n, open **Settings > Community nodes**. 2. Select **Install**. 3. Enter `n8n-nodes-kaer` and confirm. To install it by hand on self-hosted n8n, install the package in the folder n8n loads community nodes from, then restart n8n: ```bash cd ~/.n8n/nodes npm install --omit=peer n8n-nodes-kaer ``` `--omit=peer` stops npm installing `n8n-workflow`, which n8n already provides; n8n's own installer leaves it out too. Without the flag, npm also tries to build a native module that the official n8n Docker image can't compile, and the install fails. For Docker and queue mode, follow [manual installation](https://docs.n8n.io/integrations/community-nodes/installation-and-management/manual-installation) in the n8n docs, keeping `--omit=peer` on the install command. ### Add your key 1. In the Kaer dashboard, open **Keys**, create a key and tick the `search` scope. The node needs no other scope. 2. Copy the key straight away: it starts with `kaer_live_` and is shown only once. 3. In n8n, create a **Kaer API** credential and paste the key into **API Key**. 4. Leave **Base URL** as `https://api.kaer.ai/v1`. When you save the credential, n8n tests it with [`GET /v1/me`](https://api.kaer.ai/docs/account). That call is free and only reads the calling key, so the test never runs or bills a search. Any valid key passes, whatever its scopes. ### Set the parameters | Parameter | Description | | --- | --- | | Query | What to search for, 1 to 512 characters. | | Lane | How Kaer runs the search. Default: Auto. See [Choose a lane](https://api.kaer.ai/docs/n8n#n8n-choose-a-lane). | | Number of Results | 1 to 25. Default: 5. The Deep lane may return fewer. | | Simplify | On (default): one item per result. Off: the full API response as one item. | | Options | Domain filters, paging and the result fields to keep. See the next table. | Each input item runs its own search, so you can feed the node a list of queries. | Option | Description | | --- | --- | | Include Domains | Only return results from these hosts or their subdomains, up to 20. Separate hosts with commas, for example `gov.uk, bbc.co.uk`, or use an expression that returns an array. A pasted address such as `https://www.gov.uk/guidance` is reduced to its host, `www.gov.uk`. | | Exclude Domains | Never return results from these hosts or their subdomains, up to 20. Same format as Include Domains. | | Offset | Results to skip before this page. Only the Web and Fast lanes page; the others return their first page and say so in `warnings`. Wins over Page when it is above 0. | | Page | The page of results to return, counting from 1, in pages of Number of Results. Web and Fast lanes only. | | Fields | Result fields to keep: Title, URL, Snippet, Source, Published Date, Text, Text Truncated, Text Source. Left empty, Simplify keeps Title, URL, Snippet, Published Date and Text; with Simplify off, every field comes back. | ### Choose a lane | Lane | What it does | Per query | Timeout | | --- | --- | --- | --- | | Web | Kaer's own index alone. Fastest and cheapest. | $0.0005 | 6 s | | Fast | Kaer's index racing the live web. | $0.001 | 12 s | | Deep | Every lane, re-ranked. Results carry the page's main text, up to 4,000 characters, when the page could be read. | $0.003 | 40 s | | Auto | Kaer picks a lane for each query and bills the lane that served it. | As served | 40 s | Failed searches, including ones that run past their timeout, are not charged. ### Read the output With **Simplify** on, the node returns one item per result: ```json { "title": "Energy price cap explained", "url": "https://example.org/price-cap", "snippet": "What the cap is and how it is set.", "published_date": null } ``` `published_date` is `null` when the page has no known date. On the Deep lane each item also has `text`, the page's main text. If you pick **Fields**, each item has exactly those fields. When Kaer returns an instant answer (a sum, a conversion, the time), `warnings` or both, every item from that search carries them too. With **Simplify** on, a search with no results returns no items, so an instant answer that came without results is dropped; turn **Simplify** off to keep it, or turn on **Always Output Data** in the node settings if the next node should still run. With **Simplify** off, the node returns the [Search](https://api.kaer.ai/docs/search) response as one item, including `served_lane`, `answer`, `warnings`, `kaer.request_id` and `kaer.cost_usd`. ### Use it as an AI Agent tool In an **AI Agent** node, add a tool, search for **Kaer** and pick **Search the web**. To let the model write the query, select the sparkle button next to **Query**, or set it to `{{ $fromAI('query', 'What to search for') }}`. Leave **Simplify** on so the agent gets short, flat results. > Tip: If the AI Agent does not list Kaer as a tool on an older self-hosted instance, set `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true` and restart n8n. ### Handle errors The node reports the API's own message, with the error code, the HTTP status, the request ID and a suggested fix. Before sending, it checks the query length and the number of hosts in each domain list. Quote the request ID (`req_…`) to support@kaer.ai if you need help. | Status | Code | Meaning | | --- | --- | --- | | 401 | `invalid_api_key` | The key is malformed, unknown, revoked or expired. | | 402 | `insufficient_credits` | Your balance cannot cover the call's hold. Free credit never pays for mail. | | 403 | `tier_required` | Your tier does not include this service yet. | | 403 | `insufficient_scope` | The key does not have the endpoint's scope. | | 429 | `rate_limit_exceeded` | Too many requests this minute for the key or the account, or too many invalid keys from your address. | | 429 | `too_many_concurrent_searches` | Your account already has its maximum of searches in flight: your tier's figure, or your search plan's when that is higher. | | 502 | `search_failed` | The search service failed. Nothing was charged. | | 504 | `search_timeout` | Search ran out of time. Nothing was charged. | With **Continue On Fail** on, a failed item becomes an output item with `error` and `description`, and the other items still run. An error from the API adds `code`, `httpCode`, `requestId` and, when the API sent a `Retry-After` header, `retryAfterSeconds`. A timeout or a network failure adds only `code`: `request_timeout` or `network_unreachable`. For 429 you can also turn on **Retry On Fail** in the node settings. An [example workflow](https://github.com/Kaer-AI/n8n-nodes-kaer/blob/main/examples/kaer-search.json) runs two queries on the Fast lane, limited to UK government sites. Import it with **Import from File**, then pick your Kaer API credential on the Kaer node. ### Next steps - [Search](https://api.kaer.ai/docs/search): Every field in the full response. - [Search pricing](https://api.kaer.ai/docs/search-pricing): The price per query on each lane. - [Errors](https://api.kaer.ai/docs/errors): Every error code, with its fix. ## Dify {#dify} The Kaer plugin lets Dify agents, chatflows and workflows search the web through [Kaer Search](https://api.kaer.ai/docs/search). It adds one tool, **Kaer Search**, which takes a query and returns ranked results with titles, links and snippets. On the `deep` lane each result also carries the page's main text. - Plugin: [`kaer-ai/kaer`](https://marketplace.dify.ai/plugin/kaer-ai/kaer) in the Dify Marketplace - Source: [Kaer-AI/dify-plugin-kaer](https://github.com/Kaer-AI/dify-plugin-kaer) - Requires: Dify 1.10.0 or later - Price: Each search is billed like `POST /v1/search`, see [Search pricing](https://api.kaer.ai/docs/search-pricing) ### Before you begin - A key with the `search` scope. See [Authentication](https://api.kaer.ai/docs/authentication). - Search open on your account: add a card in Billing, which comes with 1,000 free web searches, or make a first top-up of $5 or more. Until then a search returns 403 `tier_required`. - Dify 1.10.0 or later. The dark-theme icon shows from Dify 1.11.0. - Outbound HTTPS from your Dify instance to `api.kaer.ai` on port 443. The plugin connects to no other host. ### Install the plugin 1. In Dify, open **Plugins**, find **Kaer** in the Marketplace and install it. 2. Open the installed plugin and add your API key in its authorisation settings. 3. Save. Dify checks the key by running one search on the `web` lane for one result. That check is billed like any other web search; a check that fails is not billed. Dify stores the key with your other tool credentials. The plugin sends it only to `api.kaer.ai`, in the `Authorization: Bearer` header. ### Set the parameters Add **Kaer Search** to an agent, a chatflow or a workflow tool node. | Parameter | Set by | Default | What it does | | --- | --- | --- | --- | | `query` | The model or you | Required | What to search for, 1 to 512 characters. | | `lane` | You, in the node settings | `auto` | How Kaer runs the search. See [Choose a lane](https://api.kaer.ai/docs/dify#dify-choose-a-lane). | | `num_results` | You, in the node settings | `5` | Results to return, from 1 to 25. | | `include_domains` | The model or you | Empty | Comma-separated hosts that results must come from, such as `bbc.co.uk, reuters.com`. Subdomains count. Up to 20. | | `exclude_domains` | The model or you | Empty | Comma-separated hosts to leave out. Up to 20. | Hosts can be typed as `example.com`, `https://example.com/page` or `*.example.com`; the plugin keeps the host name only. ### Choose a lane | Lane | What it does | Per query | Timeout | | --- | --- | --- | --- | | `web` | Kaer's own index alone. Fastest and cheapest. | $0.0005 | 6 s | | `fast` | Kaer's index racing the live web. | $0.001 | 12 s | | `deep` | Every lane, re-ranked. Results carry the page's main text, up to 4,000 characters, when the page could be read. | $0.003 | 40 s | | `auto` | Kaer picks a lane for each query and bills the lane that served it. | As served | 40 s | A search that fails or runs out of time is not billed. ### Read the output The tool node gives you two outputs: - `text`: a short summary for people and models. A line naming the query and the lane that served it comes first, then Kaer's instant answer when there is one. Each result follows with its title, link, publication date when known and snippet (up to 400 characters); deep results add up to 800 characters of the page text, and drop the snippet when the page text begins with it. Notes from Kaer come last. - `json`: the full [Search](https://api.kaer.ai/docs/search) response, so later nodes can read any field, such as `served_lane`, `results[].url`, `results[].text` (deep only), `answer`, `warnings` and `kaer.request_id`. Example text output: ```text Kaer search for "uk bank holidays 2027" (auto lane, served by fast, 1 result) 1. Bank holidays - GOV.UK https://www.gov.uk/bank-holidays The next bank holiday in England and Wales is ... ``` ### Handle errors An error stops the tool with a message that says what to do, with the HTTP status, Kaer's error code and the request ID; a timeout or a connection failure says so instead. In an agent, the model sees the message and can try again. Input problems, such as an empty query or a value in `include_domains` that is not a host name, are reported before any request is sent. | Status | Code | Meaning | | --- | --- | --- | | 401 | `invalid_api_key` | The key is malformed, unknown, revoked or expired. | | 402 | `insufficient_credits` | Your balance cannot cover the call's hold. Free credit never pays for mail. | | 403 | `tier_required` | Your tier does not include this service yet. | | 403 | `insufficient_scope` | The key does not have the endpoint's scope. | | 403 | `ip_not_allowed` | The caller's IP is not on the key's allow-list. | | 429 | `rate_limit_exceeded` | Too many requests this minute for the key or the account, or too many invalid keys from your address. | | 429 | `too_many_concurrent_searches` | Your account already has its maximum of searches in flight: your tier's figure, or your search plan's when that is higher. | | 502 | `search_failed` | The search service failed. Nothing was charged. | | 503 | `search_busy` | Search is at capacity. Nothing was charged. | | 502 or 503 | `search_unavailable` | Search is unreachable or paused. Nothing was charged. | | 504 | `search_timeout` | Search ran out of time. Nothing was charged. | Every code, with its fix, is in [Errors](https://api.kaer.ai/docs/errors). ### Next steps - [Search](https://api.kaer.ai/docs/search): Every field in the `json` output. - [Search pricing](https://api.kaer.ai/docs/search-pricing): The price per query on each lane. - [Key security](https://api.kaer.ai/docs/keys): Limit the key Dify holds with a budget and an allow-list. ## Vercel AI SDK {#ai-sdk} The [AI SDK](https://ai-sdk.dev) reaches Kaer through its OpenAI-compatible provider, `@ai-sdk/openai-compatible`. There is no Kaer package to install: point `createOpenAICompatible` at `https://api.kaer.ai/v1` and call `orin-next-1` with `generateText`, `streamText` and tools. - Package: [`@ai-sdk/openai-compatible`](https://www.npmjs.com/package/@ai-sdk/openai-compatible) on npm - Base URL: `https://api.kaer.ai/v1` - Scope: `models` - Price: Each call is billed like `POST /v1/chat/completions`, see [Models](https://api.kaer.ai/docs/models) ### Before you begin - A key with the `models` scope. See [Authentication](https://api.kaer.ai/docs/authentication). - Credit on your account. See [Billing](https://api.kaer.ai/docs/billing). - Node.js 18 or later, and AI SDK 5 or later. ### Install the packages ```bash npm install ai @ai-sdk/openai-compatible zod export KAER_API_KEY="kaer_live_..." ``` ### Create the provider ```typescript import { createOpenAICompatible } from "@ai-sdk/openai-compatible"; const kaer = createOpenAICompatible({ name: "kaer", baseURL: "https://api.kaer.ai/v1", apiKey: process.env.KAER_API_KEY, includeUsage: true, }); ``` `includeUsage` asks for token counts on streamed answers. To record requests under a region, use `https://api-eu.kaer.ai/v1`, `https://api-us.kaer.ai/v1` or `https://api-apac.kaer.ai/v1` as `baseURL`; the same key works on all of them. ### Generate text ```typescript import { generateText } from "ai"; const { text, usage } = await generateText({ model: kaer("orin-next-1"), prompt: "Explain quantum computing in one paragraph.", }); console.log(text, usage.inputTokens, usage.outputTokens); ``` ### Stream text ```typescript import { streamText } from "ai"; const result = streamText({ model: kaer("orin-next-1"), prompt: "Write a short poem about the sea.", }); for await (const textPart of result.textStream) { process.stdout.write(textPart); } ``` `result.toUIMessageStreamResponse()` returns the stream from a Next.js route handler, so `useChat` works as it does with any other provider. ### Call tools ```typescript import { generateText, stepCountIs, tool } from "ai"; import { z } from "zod"; const { text } = await generateText({ model: kaer("orin-next-1"), tools: { getWeather: tool({ description: "Current weather for a city", inputSchema: z.object({ city: z.string() }), execute: async ({ city }) => ({ city, tempC: 14, sky: "cloudy" }), }), }, stopWhen: stepCountIs(3), prompt: "What is the weather in London?", }); ``` A request takes up to 64 tools. `toolChoice: "none"` keeps the model from calling a tool; any other value is answered as `"auto"`. ### Know what is not supported - Structured output: `Output.object` and `generateObject` send `response_format`, which Kaer ignores, so the answer is not held to your schema. Ask for the data as a tool call instead. - Image, audio and file parts in messages are refused with 400. - Embedding and image models: `kaer.embeddingModel()` and `kaer.imageModel()` get 404 `unknown_endpoint`. ### Read the cost A call that is not streamed carries its cost in the `x-kaer-cost-usd` header: ```typescript const result = await generateText({ model: kaer("orin-next-1"), prompt: "Say hi" }); console.log(result.response.headers?.["x-kaer-cost-usd"]); ``` A streamed answer sends its cost in the last chunk. Pass `includeRawChunks: true` and read it from the raw parts: ```typescript const result = streamText({ model: kaer("orin-next-1"), prompt: "Say hi", includeRawChunks: true }); let costUsd: number | undefined; for await (const part of result.fullStream) { if (part.type !== "raw") continue; const raw = part.rawValue as { kaer?: { cost_usd: number } }; if (raw.kaer) costUsd = raw.kaer.cost_usd; } ``` ### Handle errors A failed call throws `APICallError`, with the HTTP `statusCode` and the API's message, such as `Invalid or revoked API key.` for a bad key. | Status | Code | Meaning | | --- | --- | --- | | 401 | `invalid_api_key` | The key is malformed, unknown, revoked or expired. | | 403 | `insufficient_scope` | The key does not have the endpoint's scope. | | 402 | `insufficient_credits` | Your balance cannot cover the call's hold. Free credit never pays for mail. | | 402 | `key_budget_exceeded` | The key's monthly budget is used up. Open holds count. | | 429 | `rate_limit_exceeded` | Too many requests this minute for the key or the account, or too many invalid keys from your address. | | 429 | `too_many_streams` | Your account already has its tier's maximum of open streams. | | 404 | `model_not_found` | No such model on the platform. | | 502 | `upstream_error` | The model call failed, or the connection to the API dropped. | > Warning: The AI SDK retries a failed call twice by default; a retried chat completion runs and is billed again. Set `maxRetries: 0` to handle retries yourself. Every code, with its fix, is in [Errors](https://api.kaer.ai/docs/errors). ### Next steps - [Chat completions](https://api.kaer.ai/docs/chat): Which fields the gateway forwards and what a call costs. - [Models](https://api.kaer.ai/docs/models): Compare models and their live prices. - [Key security](https://api.kaer.ai/docs/keys): Give your app's key a budget and an allow-list. ## Response headers {#headers} | Header | Sent on | Meaning | | --- | --- | --- | | `x-request-id` | Every authenticated `/v1` response, errors included | `req_` and 24 hex characters, the same as `kaer.request_id`. Quote it to support. | | `x-kaer-cost-usd` | Chat (not streamed), maps (every answer from the maps service, `0` when not charged), mail send (not on an idempotent replay) | The amount charged, in USD. Not sent on search, batch, images, streams or `/v1/me`: there the cost is only in the body (`kaer.cost_usd`, or the usage chunk of a stream). | | `x-ratelimit-limit-requests` | Authenticated responses | Your tier's requests per minute for one key. | | `x-ratelimit-remaining-requests` | Authenticated responses | Requests left in this window: the lower of the key's and the account's. | | `x-ratelimit-reset-requests` | Authenticated responses | Seconds until the window resets, such as `42s`. | | `retry-after` | 429, and 503 when a service is briefly unavailable | Seconds to wait before retrying. | | `access-control-allow-origin` | Every `/v1` response | `*`. Preflights allow `authorization`, `content-type` and `x-api-key`. | | `cache-control` | Every `/v1` response | `private, no-store`: answers are per key and never cached. | Errors raised before the rate check (401 and 403) carry only `x-request-id`. `GET /v1/models` needs no key and carries no request id. Streams are `text/event-stream`. ### Know how long to wait | Code | Retry-After | | --- | --- | | 429 `rate_limit_exceeded` (tier limit) | Until your 60-second window resets | | 429 `rate_limit_exceeded` (per-key ceiling or invalid keys) | Until the key may call again, or until the address may try again | | 429 `mail_rate_limit` | 60 | | 429 `mail_daily_limit` | Until 00:00 UTC | | 503 `upstream_unavailable` | 5 | ```http HTTP/2 200 content-type: application/json x-request-id: req_5f0c9a1e2b3d4c5f6a7b8c9d x-ratelimit-limit-requests: 60 x-ratelimit-remaining-requests: 58 x-ratelimit-reset-requests: 41s x-kaer-cost-usd: 0.0000048 cache-control: no-store ``` ### Next steps - [Rate limits and tiers](https://api.kaer.ai/docs/limits): The limits behind the `x-ratelimit-*` headers. - [Errors](https://api.kaer.ai/docs/errors): Every error code, with its fix. ## Errors {#errors} When a call fails, the response tells you why. To handle an error: 1. Read `error.code` in the body. It is the precise reason. 2. Find the code in the tables below, grouped by cause. 3. Apply the fix in the **What to do** column. Errors are OpenAI-shaped, so any OpenAI client shows them sensibly: ```json { "error": { "message": "The model 'gpt-9' does not exist on api.kaer.ai.", "type": "invalid_request_error", "param": null, "code": "model_not_found" } } ``` `type` is the OpenAI class; `code` is the precise reason, so branch on `code`. A call that fails with an error status is not charged; a stream that breaks after it started is charged for what it sent. The maps service's own errors keep their shape, see [Maps](https://api.kaer.ai/docs/maps). > Tip: When you write to support, quote the `x-request-id` header. It names the exact call. ### Keys and access | Code | Status | Meaning | What to do | | --- | --- | --- | --- | | `missing_api_key` | 401 | No key in `Authorization: Bearer` or `x-api-key`. | Send your key. | | `invalid_api_key` | 401 | The key is malformed, unknown, revoked or expired. | Check the key, or create a new one. | | `account_inactive` | 403 | The account is suspended or closed, or owes a reversed payment. | If the message mentions a balance owed, add credit. Otherwise write to support@kaer.ai. | | `ip_not_allowed` | 403 | The caller's IP is not on the key's allow-list. | Add the address or range to the key, or call from an allowed host. | | `insufficient_scope` | 403 | The key does not have the endpoint's scope. | Add the scope to the key in the dashboard. | | `tier_required` | 403 | Your tier does not include this service yet. | Search, images and maps open at Starter ($5 paid). Adding a card opens `POST /v1/search` on any tier, and a search plan opens search and batch search on any tier. Mail opens at Build. | | `unknown_endpoint` | 404 | No such endpoint under `/v1`. | Check the path against this page. | | `not_found` | 404 | The path is not part of the API. | Call `https://api.kaer.ai/v1/...`. | ### Balance and spend | Code | Status | Meaning | What to do | | --- | --- | --- | --- | | `insufficient_credits` | 402 | Your balance cannot cover the call's hold. Free credit never pays for mail. | Top up, turn on automatic top-up, or lower `max_tokens` to shrink the hold. | | `monthly_limit_reached` | 402 | This month's spend plus open holds would pass your monthly cap (your budget or your tier's). | Raise your budget in Settings, move up a tier, or wait for the new month (UTC). | | `key_budget_exceeded` | 402 | The key's monthly budget is used up. Open holds count. | Raise or clear the key's budget. | | `payment_required` | 402 | A refunded or disputed payment left a balance owed. | Add credit to clear it. | ### Rate limits | Code | Status | Meaning | What to do | | --- | --- | --- | --- | | `rate_limit_exceeded` | 429 | Too many requests this minute for the key or the account, or too many invalid keys from your address. | Wait for `Retry-After`, then back off. See [Rate limits and tiers](https://api.kaer.ai/docs/limits). | | `too_many_streams` | 429 | Your account already has its tier's maximum of open streams. | Wait for a stream to finish. | | `too_many_concurrent_searches` | 429 | Your account already has its maximum of searches in flight: your tier's figure, or your search plan's when that is higher. | Wait for a search to finish (`Retry-After: 1`), run fewer at once, or move to a larger tier or search plan. | | `key_shared` | 429 | A Free tier key was used from too many networks within an hour. | Keep keys on your server. A top-up moves you off the Free tier. | | `mail_rate_limit` | 429 | Messages in the last minute reached your tier's cap. | Wait 60 seconds (`Retry-After`). | | `mail_daily_limit` | 429 | Recipients today (UTC) would pass your tier's cap. | Wait until 00:00 UTC (`Retry-After`) or move up a tier. | ### Request | Code | Status | Meaning | What to do | | --- | --- | --- | --- | | `invalid_json` | 400 | The body is not valid JSON. Images also needs a JSON object. | Send a JSON object with `Content-Type: application/json`. | | `body_too_large` | 413 | The body is over the endpoint's limit: chat 1 MB, search 16 KB, batch 64 KB, images 8 KB, mail 10 MB. | Send less. | | `model_required` | 400 | `model` is missing. | Pass a model id from `GET /v1/models`, or `auto`. | | `invalid_reasoning_effort` | 400 | `reasoning_effort` is not `none`, `minimal`, `low`, `medium` or `high`. | Send one of those values, or leave the field out. | | `invalid_speed` | 400 | `speed` is not `fast` or `superfast`. | Send one of those values, or leave the field out. | | `model_not_found` | 404 | No such model on the platform. | Pick one from `GET /v1/models`. | | `messages_required` | 400 | `messages` is missing or empty. | Send at least one message. | | `too_many_messages` | 400 | More than 2,048 messages. | Trim the history. | | `invalid_request_error` | 400 | The model service refused the body: an unsupported role or content part, a `tool` message without `tool_call_id`, more than 64 tools, or over 1,000,000 characters of text. | Read `message`: it names the field. | | `query_required` | 400 | `query` is missing or blank. | Send a query. | | `query_too_long` | 400 | `query` is over 512 characters (search) or 300 (images). | Shorten it. | | `invalid_lane` | 400 | `lane` is not `web`, `fast`, `deep` or `auto`. | Use one of the four lanes. | | `invalid_num_results` | 400 | `num_results` is not a number. | Send an integer from 1 to 25. | | `invalid_paging` | 400 | `offset` or `page` is not a whole number of 0 or more. | Send whole numbers, or leave the fields out. | | `invalid_fields` | 400 | `fields` is empty, has more than 20 names, or names a key that results do not have. | Send 1 to 20 result keys from the [Search](https://api.kaer.ai/docs/search) response table. | | `invalid_domains` | 400 | `include_domains` or `exclude_domains` is not an array of up to 20 host names. | Send arrays of host names. | | `queries_required` | 400 | `queries` is missing or empty. | Send an array of query strings. | | `batch_too_large` | 400 | More queries than your tier's batch size. | Split the batch, or move up a tier. | | `invalid_query` | 400 | A batch query is blank or over 512 characters. | Fix or drop that query. | | `invalid_count` | 400 | `count` is not an integer from 1 to 30. | Send an integer from 1 to 30. | | `invalid_reusable` | 400 | `reusable` is not `true` or `false`. | Send a boolean. | | `unsupported_action` | 400 | The maps `action` is missing or not offered on the API. | Use an action from the [Maps](https://api.kaer.ai/docs/maps) table. | | `invalid_body` | 400 | The mail body is not a JSON object. | Send a JSON object. | | `unsupported_field` | 400 | Mail got `from` or `headers`. | Remove the field. The From address is the platform's. | | `to_required` | 400 | `to` is missing or empty. | Send an address or a list of them. | | `invalid_recipient` | 400 | A recipient is not a plain email address. | Send addresses like `ana@example.com`, without display names. | | `reserved_recipient` | 400 | A recipient is on a Kaer sending domain. | Remove it. | | `too_many_recipients` | 400 | More recipients than your tier allows in one message, counting `to`, `cc` and `bcc` together. | Split the message, or move up a tier. | | `subject_required` | 400 | `subject` is missing or blank. | Send a subject. | | `subject_too_long` | 400 | `subject` is over 200 characters. | Shorten it. | | `body_required` | 400 | Neither `text` nor `html` was sent. | Send one or both. | | `text_too_large` | 400 | `text` is over 128 KB. | Shorten it. | | `html_too_large` | 400 | `html` is over 256 KB. | Shorten it. | | `invalid_from_name` | 400 | `from_name` is not a string. | Send a string. | | `from_name_brand` | 400 | `from_name` names a third-party brand (PayPal, Microsoft, a bank, a carrier). | Use your own name or company. | | `invalid_reply_to` | 400 | `reply_to` is not a plain email address. | Send one address. | | `reserved_reply_to` | 400 | `reply_to` is a Kaer address. | Use your own address. | | `invalid_attachment` | 400 | An attachment has no `filename`, its `content` is not base64, or its `content_type` is not a media type. | Send `{filename, content, content_type?}` with base64 `content`. | | `attachment_blocked` | 400 | An attachment's file type can run code or macros (for example `.exe`, `.js`, `.docm`, `.iso`). | Send a PDF, image, document or archive of documents instead. | | `too_many_attachments` | 400 | More than 10 attachments. | Send fewer, or link to the files. | | `attachments_too_large` | 400 | Attachments are over 7 MB together, decoded. | Send smaller files, or link to them. | | `message_not_found` | 404 | No message with that id on this account. | Check the id returned by `POST /v1/mail/send`. | ### Service | Code | Status | Meaning | What to do | | --- | --- | --- | --- | | `upstream_unreachable` | 502 | The model service did not answer. Nothing was charged. | Retry with backoff. | | `upstream_error` | 502 | The model call failed, or the connection to the API dropped. | Retry. If the connection dropped, the call may already have run. | | `upstream_bad_response` | 502 | The model service sent a reply that could not be read. Nothing was charged. | Retry. | | `model_unavailable` | 503 | The model is paused for now. | Use another model, or `auto`. | | `search_failed` | 502 | The search service failed. Nothing was charged. | Retry. | | `search_busy` | 503 | Search is at capacity. Nothing was charged. | Retry in a few seconds. | | `search_timeout` | 504 | Search ran out of time. Nothing was charged. | Retry, or use a faster lane. | | `search_unavailable` | 502 or 503 | Search is unreachable or paused. Nothing was charged. | Retry later. | | `images_failed` | 502 | The picture search failed. Nothing was charged. | Retry. | | `images_busy` | 503 | Images are at capacity. Nothing was charged. | Retry in a few seconds. | | `images_unavailable` | 502 or 503 | Images are unreachable, timed out or paused. Nothing was charged. | Retry later. | | `maps_unavailable` | 502 | The maps service failed. Nothing was charged. | Retry. | | `mail_unavailable` | 503 | Mail sending is not available. Nothing was charged. | Retry later. | | `mail_rejected` | 502 | The mail server refused the message. Nothing was charged. | Check the recipients and content. | | `mail_transport_failed` | 502 | The message could not be handed to the mail server. Nothing was charged. | Retry with a new `Idempotency-Key`. | | `upstream_unavailable` | 503 | The API is briefly unreachable. Sent with `Retry-After: 5`. | Retry after 5 seconds. | | `upstream_timeout` | 504 | The API took too long to answer. The call may still have run. | Check your usage before you retry. | ### Inside a stream | Code | Status | Meaning | What to do | | --- | --- | --- | --- | | `upstream_idle` | stream | The model sent nothing for 90 seconds; the stream ends. | Retry, or lower the task's size. | | `max_duration` | stream | The stream passed 15 minutes; it ends. | Ask for shorter answers, or split the task. | | `stream_error` | stream | The stream broke on our side. | Retry. | ### Next steps - [Response headers](https://api.kaer.ai/docs/headers): `Retry-After` and `x-request-id`. - [Idempotency](https://api.kaer.ai/docs/idempotency): Which retries are safe. - [Rate limits and tiers](https://api.kaer.ai/docs/limits): What a 429 means for your tier. ## Rate limits and tiers {#limits} Your tier is earned by money paid in (net of refunds) and time since your first payment, never by spend. | Tier | Req/min per key | Req/min per account | Open streams | Searches in flight | Monthly cap | | --- | --- | --- | --- | --- | --- | | Free | 20 | 30 | 2 | 2 | $10 | | Starter | 60 | 120 | 5 | 10 | $100 | | Build | 300 | 600 | 20 | 50 | $1,000 | | Scale | 1,000 | 2,000 | 50 | 200 | $5,000 | | Pro | 3,000 | 6,000 | 100 | 500 | $25,000 | | Enterprise | Custom | Custom | Custom | Custom | Custom | ### Move up a tier | Tier | Requirement | Services | Batch size | Active keys | | --- | --- | --- | --- | --- | | Free | Sign up | Models | None | 3 | | Starter | $5 paid | Models, Search, Maps | 10 | 10 | | Build | $50 paid and 7 days since your first payment | Models, Search, Maps, Mail | 50 | 25 | | Scale | $250 paid and 14 days since your first payment | Models, Search, Maps, Mail | 100 | 50 | | Pro | $1,000 paid and 30 days since your first payment | Models, Search, Maps, Mail | 100 | 100 | | Enterprise | Contract with Kaer | All | Custom | Custom | ### Understand how limits apply - Requests are counted in fixed 60-second windows, per key and per account; whichever runs out first answers 429 `rate_limit_exceeded` with `Retry-After`. - Every key is also capped at 12,000 requests a minute (bursts up to 2000), so the per-key limit is the lower of that and your tier's figure. - Open streams are counted per account; over the limit, 429 `too_many_streams`. - Searches in flight are counted per account, each distinct query in a batch as one: your tier's figure, or your [search plan](https://api.kaer.ai/docs/search-plans)'s when that is higher. Over the limit, 429 `too_many_concurrent_searches`. - The monthly cap counts settled spend plus open holds in the calendar month (UTC). Your own budget in Settings can only lower it. - The dashboard playground has its own limit of 20 calls a minute. - Restricted accounts run at Free tier limits. > Note: On the Free tier only models are open, plus single searches once you add a card, or search and batch search with a search plan, and spend is capped at $10 a month. A first top-up of $5 moves you to Starter at once. Mail caps are in [Mail](https://api.kaer.ai/docs/mail); top-up limits in [Billing](https://api.kaer.ai/docs/billing). ### Next steps - [Billing](https://api.kaer.ai/docs/billing): Top up to move up a tier. - [Response headers](https://api.kaer.ai/docs/headers): Read your remaining requests. ## Idempotency {#idempotency} `POST /v1/mail/send` takes an `Idempotency-Key` header, up to 200 characters, scoped to your account. A repeat with the same key returns the first result with `idempotent_replay: true`, sends nothing and charges nothing. > Warning: The key is kept even when the first attempt fails, and a replay then returns `status: "failed"`. To try again after a failure, use a new key. ```json { "id": "msg_63bd80dded23e6452659ed84", "object": "mail.message", "status": "sent", "recipients": 1, "idempotent_replay": true, "kaer": { "request_id": "req_…", "cost_usd": 0.0015 } } ``` ### Retry other endpoints safely Every other endpoint ignores `Idempotency-Key`. Search, images, maps and `/v1/me` only read, so a retry is safe but billed again. A retried chat completion runs again and is billed again. - Retry 429 after `Retry-After`, and 502 or 503 with backoff: those calls were not charged. - After 504 `upstream_timeout`, or a 502 `upstream_error` where the connection dropped, the first call may have run. Check your usage before you retry. ### Next steps - [Mail](https://api.kaer.ai/docs/mail): Send with an `Idempotency-Key`. - [Errors](https://api.kaer.ai/docs/errors): Which errors were charged and which were not. ## Billing {#billing} Accounts are strictly prepaid. Your card is only charged to add credit you chose, or in advance for a [search plan](https://api.kaer.ai/docs/search-plans) you subscribed to; usage never bills it, and a balance cannot go below zero. ### Understand how a call is paid 1. Before work starts, the gateway holds an upper bound of the call's cost. For chat: the prompt (estimated generously) plus `max_tokens` of output at the dearest band, plus 25%. For other services: the call's price (`auto` search holds the deep price). 2. The call runs. 3. The hold settles at the actual cost, never more than the hold, and the rest is released at once. 4. A call that fails is released in full. A hold that is never settled expires on its own and is not charged. If the hold cannot be covered, the call is refused with 402 `insufficient_credits` before anything runs. > Tip: Lowering `max_tokens` shrinks a chat hold. ### Top up your balance Pay by card, from $5. There is no free credit at sign-up: calls are paid from credit you added and the bonuses below. Your first payment is verified with your bank (3-D Secure). Prices are in US dollars and exclude VAT. Where VAT or sales tax applies, it is worked out from your billing address or location and shown, with the total, before you pay. ### Bonuses - Card bonus: when you add a card, with the card-only setup in Billing or with a top-up, you get $0.50 of free credit, enough for 1,000 web searches. It is valid 90 days, and given once per person across all your workspaces and once per card. It is free credit, so it also pays for models, maps and the fast and deep search lanes, never for mail. Adding a card opens `POST /v1/search` on the Free tier; batch search needs a top-up. Adding a card charges nothing; your bank may ask you to confirm it (3-D Secure). - Welcome bonus: your first manual top-up of $25 or more adds $5, once per person across all your workspaces and once per card. Top-ups under $25 never earn it (a later top-up of $25 or more still can), and automatic top-ups never do. - $50 or more adds 10% bonus credit and $100 or more adds 15%. When the welcome bonus and a percentage bonus both apply, you get the larger one, never both. Worked examples: - A $50 top-up: $50 + $5.00 bonus = **$55.00** - A $100 top-up: $100 + $15.00 bonus = **$115.00** | Tier | Largest top-up | Top-ups per day | | --- | --- | --- | | Free | $100 | $250 | | Starter | $250 | $500 | | Build | $1,000 | $2,000 | | Scale | $5,000 | $10,000 | | Pro | $10,000 | $25,000 | ### Turn on automatic top-up Off until you turn it on and record consent, and not on the Free tier. You set the amount (at least $5), the balance that triggers it (up to $5,000) and a monthly cap. It charges your saved card when your paid balance drops below the threshold after a call, or when a call needs more than is left; that call waits up to 15 seconds for the money, then tries once more. - One attempt at a time, at least 60 seconds apart, and not for an hour after a failure. - Two failed charges, or a bank asking for authentication, pause it until you turn it back on. - Charges stay within your monthly cap, your tier's caps and your tier's daily top-up limit. | Tier | Largest automatic charge | Automatic charges per month | | --- | --- | --- | | Starter | $50 | $200 | | Build | $200 | $1,000 | | Scale | $1,000 | $5,000 | | Pro | $2,500 | $20,000 | ### Refunds and disputes Credit is added to your balance as soon as the payment clears and is not refundable once added, except where the law requires it. The [Terms](https://kaer.ai/terms#refunds) set out when a refund applies, including a consumer's right to cancel. A refunded top-up removes the credit it added, bonus included. A dispute does the same and pauses the account until it is resolved; a dispute decided in your favour restores the credit. If the credit was already spent, the difference is owed (402 `payment_required`) until a top-up clears it. ### Units Balances are kept in microcents: $1 is 100,000,000. `cost_usd` fields and the `x-kaer-cost-usd` header carry up to 8 decimal places. ### Next steps - [Rate limits and tiers](https://api.kaer.ai/docs/limits): How top-ups move you up a tier. - [Account](https://api.kaer.ai/docs/account): Read your balances from the API. ## Privacy {#privacy} The request log behind your Usage page holds metadata only. It is what we bill from and what you can export as CSV. ### What the request log holds - Time, latency and, for streams, time to first token. - Endpoint, service, and the model, lane or action. - Status code and error code. - Token, query or request counts, and the cost. - The key used, the country the call came from, and a keyed hash of the client IP, cleared after 90 days. ### What it does not hold - Prompt or completion text (see Data modes below). - Search queries or results. - Map coordinates or routes. - Email addresses, subjects or bodies. Mail keeps recipient counts and domains. - Your raw IP address. ### The docs assistant "Ask the docs" on this page sends your question and the recent turns to a model to answer, and keeps no transcript. The conversation lives in your browser tab until you clear it or close the tab. To limit abuse we count messages per keyed hash of your IP for two days. ### Data modes Every model call runs in one of two data modes. Both keep the request log's billing metadata above, and neither is ever used to train a model. | Mode | What Kaer keeps | Price | | --- | --- | --- | | Standard (the default) | No prompt and no completion today. From 14 December 2026, Kaer may keep the prompt (messages and tool definitions) for up to 30 days for abuse and safety review, then deletes it. Never the completion. | Standard rate | | Zero data retention | No prompt, no completion and no client IP hash. Only billing metadata: time, model, token counts, cost, status and key. | Enterprise: standard rate + 10% | Zero data retention is available on Enterprise accounts: ask through [enterprise](https://api.kaer.ai/enterprise). An Enterprise account chooses it for one call or for all of them: - Use the ZDR base URL `https://api.kaer.ai/v1/zdr` (for example `POST /v1/zdr/chat/completions`). - Or send the header `X-Kaer-Data-Mode: zdr` on any call (`standard` is the default; any other value is a 400 `invalid_data_mode`). - Or put the whole account on zero retention. A request cannot turn it off. A ZDR request from any other account is refused with a 403 `zdr_not_available`, so a call never runs in a mode it didn't ask for. Every reply says which mode it ran in: the `x-kaer-data-mode` header, and `kaer.data_mode` in the body or the last streamed frame. A ZDR call is billed at the ZDR rate; `GET /v1/zdr/models` lists those rates. ### Training Kaer never trains a model on API prompts or completions, in either data mode. Kaer never uses your data to train third-party models and never sells personal data. In the Kaer app, "Help improve our services" is on by default for each user and can be turned off in Settings; the [Privacy Policy](https://kaer.ai/privacy) explains it. ### Where data is processed Kaer's servers are in the EU and queries are processed in Germany. AI model providers may process content elsewhere; the [Privacy Policy](https://kaer.ai/privacy#sub-processors) lists them. ### Data processing agreement If you use the API for business, Kaer's [Data Processing Addendum](https://kaer.ai/dpa) applies automatically, on every plan, with nothing to sign. ### Cookies api.kaer.ai sets the cookies it needs for sign-in and security, such as the one that keeps you signed in to the dashboard, and no advertising cookies. The Cookie Policy at https://kaer.ai/cookies lists each one. ## Changelog {#changelog} - **2026-11-27**: Orin Next 1.0 (`orin-next-1`) is Kaer's default model: $0.10 input, $0.03 cached input and $0.40 output per 1M tokens. `janus-1-flash` and `janus-1-pro` are deprecated; calls that name them keep working and are served by Orin Next 1.0. - **2026-11-21**: [Zero data retention](https://api.kaer.ai/docs/privacy) is for Enterprise accounts. A ZDR request (the `/v1/zdr` base URL or `X-Kaer-Data-Mode: zdr`) from any other account is a 403 `zdr_not_available`; `GET /v1/models` marks it with `kaer.data_modes.zdr.available_on`. - **2026-11-20**: `GET /v1/models` states each Kaer model's context window, output cap, per-token pricing, supported parameters and features, filters with `?owned_by=kaer`, answers in OpenRouter's schema with `?format=openrouter`, and `GET /v1/models/{id}` retrieves one model. `kaer/janus-1-flash` and `kaer/janus-1-pro` resolve like the bare ids. Chat completions honour `stop` and `tool_choice: "none"`. [Data modes](https://api.kaer.ai/docs/privacy): standard or zero data retention, per request (the `/v1/zdr` base URL or `X-Kaer-Data-Mode`) or per account. Regional base URLs `api-eu`, `api-us` and `api-apac.kaer.ai/v1`. Janus 1.0 on the API bills one card at every speed, Pro exactly double Flash; `GET /v1/models` lists it. - **2026-11-20**: `POST /v1/search` takes `offset` and `page` to page the `web` and `fast` lanes, and answers with an instant `answer` (a sum, a conversion, the time, the weather, a word's meaning) and `warnings` naming request fields the lane did not apply. Served batch rows carry `answer` too. A malformed `offset` or `page` is a 400 `invalid_paging`. - **2026-11-14**: adding a card gives $0.50 of free credit, enough for 1,000 web searches, valid 90 days, once per person and per card, and opens `POST /v1/search` on the Free tier. There is still no credit at sign-up. - **2026-11-19**: lower Janus 1.0 rates, and a `speed` field on chat completions: `superfast` always takes the quickest lane at its own rates. `GET /v1/models` lists each speed's rates under `pricing.speeds`. - **2026-11-14**: [search plans](https://api.kaer.ai/docs/search-plans): a monthly allowance of search units, paid in advance, with `kaer.plan_units` on plan-paid calls. Documented 429 `too_many_concurrent_searches` and searches in flight per tier. - **2026-11-14**: documented the `invalid_reasoning_effort`, `invalid_fields` and `upstream_bad_response` errors and the reasoning allowance in chat holds. The privacy section now covers training, where data is processed and the DPA. - **2026-10-31**: new accounts no longer get sign-up credit. The welcome bonus ($5) now needs a first top-up of $25 or more (was $20). Credit given earlier stays until it expires. - **2026-10-18**: batch rows carry only documented fields. Failed rows have a `code` (`timeout`, `backpressure`, `upstream_unavailable`, `invalid_query`, `no_results`, `internal`) and a fixed `error` message; deep rows have a `degraded_reason` (`timeout`, `engines_failed`, `pages_unreadable`). Repeated queries in a batch are billed once. Deep batch rows carry page text like a single deep search. Results carry only the documented fields. A deep search that runs out of time answers 504 `search_timeout`, not 502. A `fields` name outside the result keys is a 400 `invalid_fields`. - **2026-10-02**: docs rebuilt from one source, with `/llms.txt`, `/llms-full.txt`, full error and header references, search pricing examples and "Ask the docs". `auto` search bills the lane that served it. - **2026-09-29**: `POST /v1/images`, $0.002 per call. - **2026-09-29**: sign-up credit raised from $5 to $10 and widened to search and maps (once they open). Accounts created earlier keep the credit they got. - **2026-09-22**: api.kaer.ai v2: separate accounts, strictly prepaid billing, new dashboard.