# Troubleshooting

> The most common problems when using Vikey and how to fix them.

Start with the simplest test. If this works, your key and balance are fine, and the problem is in the tool's config:

```bash
curl https://api.vikey.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "openai/gpt-6-luna", "max_tokens": 16, "messages": [{"role": "user", "content": "ping"}]}'
```

## Common problems

| Symptom | Most likely cause | Fix |
| --- | --- | --- |
| `404` on every request | Wrong base URL. The OpenAI SDK needs `/v1`, the Anthropic SDK and Claude Code do not. | See [Base URL](/en/base-url/) |
| `401 Invalid API key` | Wrong key, a stray space, or a key from another account | Copy it again from **API Keys** |
| `401` although the key is right | The tool sends the key in the wrong header, or the environment variable is not read | Check your tool's guide under Coding agents |
| `402 Insufficient balance` | No balance left, or `max_tokens` too large for what is left | [Top up](/en/account/top-up/), or lower `max_tokens` |
| `403 API key is inactive` | The key is turned off | Turn it on again in **API Keys** |
| `Model '...' not found` | A typo in the model id, or the tool sends its built-in model name | Use an id from the [pricing page](https://vikey.ai/en/pricing). For Claude Code, add [`modelOverrides`](/en/agents/claude-code/). |
| `ambiguous_model` | A short name matches several providers | Use the full id, such as `deepseek/deepseek-v4.1-flash` |
| Codex: `wire_api = "chat" is no longer supported` | An old Codex config | Change it to `wire_api = "responses"`, see [Codex](/en/agents/codex/) |
| opencode: `Model not found: vikey/...` | The unsupported `providers` format, or the model is missing from `models` | Use the format in [opencode](/en/agents/opencode/) |
| Claude Code asks you to log in | The key is in project settings, not user settings or the shell | See [Claude Code](/en/agents/claude-code/) |
| Cost higher than expected | Long prompts resent without cache, or an expensive model used for light tasks | Check **Usage** per model and consider [Vikey Auto](/en/models/vikey-auto/) |
| The answer stops halfway | The `max_tokens` limit was reached | Raise `max_tokens` |
| `502` or `503` | The model has a problem on the provider side | Retry shortly, or use another model |

## Still stuck?

Contact us on [Telegram](https://t.me/+gAhmT7YKbtRmZWM9) or [WhatsApp](https://wa.me/6287780232611). Include:

- The `request_id` from the error message, if any
- The tool and its version, for example Claude Code 2.1.323
- The model id you used
- When it happened

Never send your API key to anyone, including support.

Source: https://docs.vikey.ai/en/troubleshooting/
