How to Use Claude Code with NaraRouter (Rupiah Pricing)
Set up Claude Code with NaraRouter in a few minutes: settings.json, ANTHROPIC_BASE_URL, API key, and model aliases, billed in Rupiah.
In this article
What you need
Claude Code can run on NaraRouter because NaraRouter exposes an Anthropic-compatible /v1/messages endpoint. You only need three things: Claude Code installed, a NaraRouter API key from the dashboard at router.bynara.id, and a model alias from the NaraRouter model catalog. Claude Code reads its endpoint and token from the env block in ~/.claude/settings.json, so no shell export is needed. Usage is billed to your NaraRouter credits in Rupiah, and you can top up with QRIS.
Step 1: create the settings file
If ~/.claude/settings.json does not exist yet, create it. A global settings file is the simplest setup for a single user.
Step 2: point Claude Code at NaraRouter
Add an env object to settings.json with the following keys. Use the base URL without /v1, because Claude Code appends the Messages path itself.
- ANTHROPIC_BASE_URL: https://router.bynara.id
- ANTHROPIC_AUTH_TOKEN: your NaraRouter API key
- ANTHROPIC_DEFAULT_OPUS_MODEL: a model alias from the catalog
- ANTHROPIC_DEFAULT_SONNET_MODEL: a model alias from the catalog
- ANTHROPIC_DEFAULT_HAIKU_MODEL: a lighter model alias for quick tasks
Step 3: restart and test
Close any running Claude Code session and start it again so the new endpoint loads. Send a tiny prompt first. If the token is wrong, Claude Code fails immediately, before it touches your workspace.
Keeping costs predictable
Coding agents send long contexts, so model choice drives cost. Use a lighter alias for the Haiku slot, check request history in the NaraRouter dashboard after a session, and compare per-model rates in the catalog. The same API key also works in Cursor, OpenCode, and other OpenAI- or Anthropic-compatible tools.