# azrouter troubleshooting

Every error starts with `azrouter:` on stderr and says what to do. When it ends with `(request …)`, that ID is ours:
quote it if the user contacts support.

| Message | Meaning | Do |
|---|---|---|
| `not logged in` | No saved key and no `AZROUTER_API_KEY` | Ask for a key from https://azrouter.dev/dashboard/keys, then run `printf '%s\n' "$KEY" \| azrouter login` |
| `your API key was not accepted` | The key was revoked, mistyped, or belongs to a deleted account | Same as above, with a new key |
| `not enough balance` | The account is out of credit | Tell the user to top up at https://azrouter.dev/dashboard/credits |
| `your usage tier's monthly cap is reached` | The account's tier spent its month | Tell the user; it resumes next UTC month (https://azrouter.dev/docs/rate-limits) |
| `this request alone is over your usage tier's limit` | One request is bigger than the tier allows | Send a smaller one (shorter input, fewer files) |
| `too many requests: try again in N s` | Rate limited | Wait N seconds, then retry once |
| `that model is not available` | Wrong id, or the model is off sale right now | Run `azrouter models` and pick an id from it |
| `this model takes text only` | That model's price covers text without tools, images, audio or files | Drop `-f` / `--tools`, or pick a model whose `input` has them (`azrouter models --json`) |
| `this image model accepts one image as b64_json …` | The request has an option this model cannot use, or exceeds its prompt limit | Check the model page; Nano Banana 2 accepts up to 10 reference images, Grok Imagine Image 2.0 one 1:1 reference image, and GPT Image 2 accepts size and quality. Remove unsupported options or shorten the prompt. |
| `… takes no reference image` / `a request takes at most 10 (-i)` / `… takes one (-i)` / `a reference image (-i) is a PNG, JPEG or WebP file` / `the reference images are over 6 MB together` | Checked before anything is sent or billed | Use `-m google/gemini-3.1-flash-image` (up to 10 files) or `-m x-ai/grok-imagine-image-2.0` (one 1:1 file): PNG, JPEG or WebP, about 6 MB in all |
| `this model makes one video of its one length from a text prompt only` | A model billed per second, such as Veo 3.1 Lite, Gemini Omni Flash or Kling, takes a prompt alone | Drop `--seconds`, `--size`, input images and other options |
| `this model takes a prompt with --seconds (4 to 15), --resolution …` | A Seedance video got a field it does not take | Use only `--seconds`, `--resolution`, `--ratio`, `--image` and `--no-audio`; drop `--size`, `-p` and `--body` |
| `--video needs -m …` / `--video takes the https:// URL of an MP4 file` | `--video` went to no model, or is not an `https://` URL | Name a model that takes an input video (the model's page says) and give the URL of its file |
| `The input image …` / `The input video …` / `This model takes …` | The API's own words for an input it cannot use; nothing is billed | Change the input as the words say |
| `--seconds takes whole seconds from 4 to 15` / `… makes 480p or 720p video, not 1080p` | A Seedance flag out of range (checked before anything is sent or billed) | Fix the flag; `azrouter models --type video` shows each model's resolutions |
| `--resolution, --ratio, --image and --no-audio are for models billed per video token` | Those flags went to a model that does not take them | Use `-m bytedance/seedance-2.0` or `bytedance/seedance-2.0-mini`, or drop the flags |
| `--image takes a PNG, JPEG or WebP image` | The first frame is another kind of file, or over 18 MB | Convert it, or give an `https://` URL to the image |
| `the prompt is too long for this model` | Over the model's context | Shorten it, or pick a model with a longer context (`azrouter models`) |
| `the request is too large` | The body is over the size limit | Send smaller files or less text |
| `no … model is on sale yet` | Nothing of that kind is sold now | Tell the user; `azrouter models --type …` shows when that changes |
| `the answer was cut` | The answer stopped before the model finished (exit 1); what printed is only part of it | Retry once; never use the partial answer as the whole |
| `the answer stopped at the token limit` | `--max-tokens` cut the answer (exit 0, the note is on stderr) | Raise `--max-tokens` if the rest is needed |
| `no answer: the model used the whole token limit` | A reasoning model spent all of `--max-tokens` thinking (exit 1) | Raise `--max-tokens` (or drop it) and ask once more |
| `the answer was cut before the image arrived` | The connection broke while the image came; it may be billed | Check `azrouter usage --days 1`, then try once more |
| `… is billed and still kept for a day` (the video not ready, could not be checked or downloaded, stopped, or not written) | The video is billed and kept for a day | Run the `azrouter video --resume …` line it prints (same key; CLI 1.1.12 prints it at every such exit; on Windows it is quoted for PowerShell, Windows Terminal's default, not cmd.exe); never start another for the same prompt |
| `already exists: pass --force` | `-o` names a file that is already there (it is never replaced on its own) | Pick another name; use `--force` only when the user wants that file replaced |
| `no file …` | A `@file`, `-f` or `-p key=@file` names a file that is not there | Check the path; write `@@text` to send text that starts with `@` |
| `… is set by this command: use its own flag` | `-p` or `--body` tried to set a field a flag owns (the model, the prompt) | Use the flag (`-m`, the prompt) |
| `azrouter api calls … only` | `api` was given a URL on another host | Use a path (`/v1/...`) or an azrouter URL: the key is never sent elsewhere |
| `the service is unavailable right now` | A server-side problem | Wait a minute, then retry once |
| `no key to read` (from `login`) | No terminal and no key piped in | `printf '%s\n' "$KEY" \| azrouter login` |
| `… Nothing was saved.` (from `login`) | The key could not be checked (server down, rate limit, network); any key saved before is kept | Retry `azrouter login` in a minute |
| `could not reach …` | Network problem | Check the connection and retry |
| `azrouter: command not found` | `~/.local/bin` is not on PATH | Run `~/.local/bin/azrouter`, or add `export PATH="$HOME/.local/bin:$PATH"` to the shell profile |
| `azrouter` is not recognized (Windows) | The install folder is not on PATH in this terminal | Open a new terminal, or run `& "$env:LOCALAPPDATA\Programs\azrouter\azrouter.exe"` |
| `az` runs the Azure CLI | The Azure CLI owns `az` on this machine | Use `azrouter` |

Exit codes: 0 means OK, 1 means the command failed (the message says why), and 2 means a usage error.

The key is stored in `~/.config/azrouter/config.json` (on Windows `%USERPROFILE%\.config\azrouter\config.json`), which
only the user can read. `azrouter logout` removes it.
