I2PControl JSON-RPC

Remote router management API via the I2PControl webapp

I2PControl API Documentation

I2PControl is a JSON-RPC 2.0 API bundled with the I2P router (since version 0.9.39). It enables authenticated monitoring and control of the router via structured JSON requests.

Default password: itoopie — this is the factory default and should be changed immediately for security.


1. Overview & Access

ImplementationDefault EndpointProtocolEnabled by DefaultNotes
Java I2P (2.10.0+)http://127.0.0.1:7657/jsonrpc/HTTP❌ Must be enabled via WebApps (Router Console)Bundled webapp
i2pd (C++ implementation)https://127.0.0.1:7650/HTTPS✅ Enabled by defaultLegacy plugin behavior

In the Java I2P case, you must go to Router Console → WebApps → I2PControl and enable it (set to start automatically). Once active, all methods require that you first authenticate and receive a session token.


2. JSON-RPC Format

All requests follow the JSON-RPC 2.0 structure:

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "MethodName",
  "params": {
    /* named parameters */
  }
}

A successful response includes a result field; on failure, an error object is returned:

{
  "jsonrpc": "2.0",
  "id": "1",
  "result": { /* data */ }
}

or

{
  "jsonrpc": "2.0",
  "id": "1",
  "error": {
    "code": -32001,
    "message": "Invalid password"
  }
}

3. Authentication Flow

Request (Authenticate)

curl -s -H "Content-Type: application/json" \
  -d '{
        "jsonrpc": "2.0",
        "id": "1",
        "method": "Authenticate",
        "params": {
          "API": 1,
          "Password": "itoopie"
        }
      }' \
  http://127.0.0.1:7657/jsonrpc/

Successful Response

{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "Token": "a1b2c3d4e5",
    "API": 1
  }
}
FieldDirectionTypeDescription
APIRequestlongI2PControl API version requested by the client. Use 1.
PasswordRequestStringPassword used to authenticate with I2PControl.
APIResponselongPrimary API version implemented by the server.
TokenResponseStringAuthentication token used for subsequent requests.

You must include that Token in all subsequent requests in the params.


4. Methods & Endpoints

4.1 RouterInfo

Fetches key telemetry about the router.

Request Example

curl -s -H "Content-Type: application/json" \
  -d '{
        "jsonrpc": "2.0",
        "id": "2",
        "method": "RouterInfo",
        "params": {
          "Token": "a1b2c3d4e5",
          "i2p.router.version": "",
          "i2p.router.status": "",
          "i2p.router.net.status": "",
          "i2p.router.net.tunnels.participating": "",
          "i2p.router.net.bw.inbound.1s": "",
          "i2p.router.net.bw.outbound.1s": ""
        }
      }' \
  http://127.0.0.1:7657/jsonrpc/

Include each desired key in params with any value. Only requested keys are returned.

Router and Bandwidth Fields

KeyTypeDescription
i2p.router.statusStringFree-format, translated router status intended for display.
i2p.router.uptimelongRouter uptime in milliseconds. Older i2pd versions may return a string.
i2p.router.versionStringFull router version.
i2p.router.net.statuslongNetwork status code; see the table below.
i2p.router.net.bw.inbound.1sdoubleCurrent inbound bandwidth in bytes per second.
i2p.router.net.bw.inbound.15sdouble15-second average inbound bandwidth in bytes per second.
i2p.router.net.bw.outbound.1sdoubleCurrent outbound bandwidth in bytes per second.
i2p.router.net.bw.outbound.15sdouble15-second average outbound bandwidth in bytes per second.
i2p.router.net.tunnels.participatinglongNumber of tunnels in which this router is participating.

Status Code Enum (i2p.router.net.status)

CodeMeaning
0OK
1TESTING
2FIREWALLED
3HIDDEN
4WARN_FIREWALLED_AND_FAST
5WARN_FIREWALLED_AND_FLOODFILL
6WARN_FIREWALLED_WITH_INBOUND_TCP
7WARN_FIREWALLED_WITH_UDP_DISABLED
8ERROR_I2CP
9ERROR_CLOCK_SKEW
10ERROR_PRIVATE_TCP_ADDRESS
11ERROR_SYMMETRIC_NAT
12ERROR_UDP_PORT_IN_USE
13ERROR_NO_ACTIVE_PEERS_CHECK_CONNECTION_AND_FIREWALL
14ERROR_UDP_DISABLED_AND_TCP_UNSET

NetDB and Peer Fields

KeyTypeDescription
i2p.router.netdb.knownpeerslongNumber of known peers, excluding the local router.
i2p.router.netdb.activepeerslongNumber of active peers.
i2p.router.netdb.fastpeerslongNumber of peers classified as fast.
i2p.router.netdb.highcapacitypeerslongNumber of peers classified as high capacity.
i2p.router.netdb.isreseedingbooleanWhether a reseed is in progress.

4.2 GetRate

Used to fetch rate metrics (e.g. bandwidth, tunnel success) over a given time window.

ParameterTypeDescription
StatStringRouter RateStat name.
PeriodlongRate period in milliseconds.

Request Example

curl -s -H "Content-Type: application/json" \
  -d '{
        "jsonrpc": "2.0",
        "id": "3",
        "method": "GetRate",
        "params": {
          "Token": "a1b2c3d4e5",
          "Stat": "bw.combined",
          "Period": 60000
        }
      }' \
  http://127.0.0.1:7657/jsonrpc/

Sample Response

{
  "jsonrpc": "2.0",
  "id": "3",
  "result": {
    "Result": 12345.67
  }
}

4.3 RouterManager

Perform administrative actions.

ParameterResultDescription
RestartnullInitiates an immediate router restart.
RestartGracefulnullRestarts after participating tunnels expire.
ShutdownnullInitiates an immediate router shutdown.
ShutdownGracefulnullShuts down after participating tunnels expire.
ReseednullStarts a router reseed.
FindUpdatesboolean or StringBlocking. Searches for a signed router update.
UpdateStringBlocking. Starts a signed router update and returns its final status.

Request Example

curl -s -H "Content-Type: application/json" \
  -d '{
        "jsonrpc": "2.0",
        "id": "4",
        "method": "RouterManager",
        "params": {
          "Token": "a1b2c3d4e5",
          "Restart": true
        }
      }' \
  http://127.0.0.1:7657/jsonrpc/

Successful Response

{
  "jsonrpc": "2.0",
  "id": "4",
  "result": {
    "Restart": null
  }
}

4.4 NetworkSetting

Get or set network configuration parameters (ports, upnp, bandwidth share, etc.)

Submit a key with null to read its current value, or submit a String to change it.

KeyAccepted ValueDescription
i2p.router.net.ntcp.portString, 1–65535NTCP port; a change requires restart.
i2p.router.net.ntcp.hostnameStringNTCP hostname; a change requires restart.
i2p.router.net.ntcp.autoipalways, true, or falseNTCP automatic address selection.
i2p.router.net.ssu.portString, 1–65535SSU port; a change requires restart.
i2p.router.net.ssu.hostnameStringSSU external hostname; a change requires restart.
i2p.router.net.ssu.autoipssu, local,ssu, upnp,ssu, or local,upnp,ssuSSU address-discovery sources.
i2p.router.net.ssu.detectedipnullRead-only detected SSU address.
i2p.router.net.upnpStringUPnP setting.
i2p.router.net.bw.shareString, 0–100Percentage of bandwidth available for participating tunnels.
i2p.router.net.bw.inNon-negative integer StringInbound bandwidth limit in KiB/s.
i2p.router.net.bw.outNon-negative integer StringOutbound bandwidth limit in KiB/s.
i2p.router.net.laptopmodeStringLaptop mode setting.

Request Example (get current values)

curl -s -H "Content-Type: application/json" \
  -d '{
        "jsonrpc": "2.0",
        "id": "5",
        "method": "NetworkSetting",
        "params": {
          "Token": "a1b2c3d4e5",
          "i2p.router.net.ntcp.port": null,
          "i2p.router.net.ssu.port": null,
          "i2p.router.net.bw.share": null,
          "i2p.router.net.upnp": null
        }
      }' \
  http://127.0.0.1:7657/jsonrpc/

Sample Response

{
  "jsonrpc": "2.0",
  "id": "5",
  "result": {
    "i2p.router.net.ntcp.port": "1234",
    "i2p.router.net.ssu.port": "5678",
    "i2p.router.net.bw.share": "50",
    "i2p.router.net.upnp": "true",
    "SettingsSaved": false,
    "RestartNeeded": false
  }
}

Note: i2pd versions prior to 2.41 may return numeric types instead of strings — clients should handle both.


4.5 AdvancedSettings

Allows manipulating internal router parameters.

ParameterTypeDescription
getStringReturns one setting inside a get result object.
getAlln/aReturns the complete configuration map inside getAll.
setMap<String, String>Updates the supplied settings without removing other keys.
setAllMap<String, String>Destructive: replaces all settings and removes keys not supplied.

Parameter names are case-sensitive and use the lower camel-case spelling shown above.

Request Example

curl -s -H "Content-Type: application/json" \
  -d '{
        "jsonrpc": "2.0",
        "id": "6",
        "method": "AdvancedSettings",
        "params": {
          "Token": "a1b2c3d4e5",
          "set": {
            "router.sharePercentage": "75",
            "i2np.flushInterval": "6000"
          }
        }
      }' \
  http://127.0.0.1:7657/jsonrpc/

Response Example

{
  "jsonrpc": "2.0",
  "id": "6",
  "result": {}
}

4.6 Echo

Echoes a String for debugging and connectivity checks.

ParameterTypeDescription
EchoStringValue returned as Result.
{
  "jsonrpc": "2.0",
  "id": "7",
  "method": "Echo",
  "params": {
    "Token": "a1b2c3d4e5",
    "Echo": "hello"
  }
}
{
  "jsonrpc": "2.0",
  "id": "7",
  "result": {
    "Result": "hello"
  }
}

4.7 I2PControl

Manages I2PControl itself. The current Java handler supports password changes.

ParameterTypeDescription
i2pcontrol.passwordStringSets a new I2PControl password and revokes existing authentication tokens.

The result contains SettingsSaved. If the password was changed, the result also contains "i2pcontrol.password": null. Listen-address and listen-port settings from the legacy standalone plugin are not active in the current Java handler.


5. Error Codes

Standard JSON-RPC2 Error Codes

CodeMeaning
-32700JSON parse error
-32600Invalid request
-32601Method not found
-32602Invalid parameters
-32603Internal error

I2PControl Specific Error Codes

CodeMeaning
-32001Invalid password provided
-32002No authentication token presented
-32003Authentication token doesn’t exist
-32004The provided authentication token was expired and will be removed
-32005The version of the I2PControl API used wasn’t specified, but is required to be specified
-32006The version of the I2PControl API specified is not supported by I2PControl

6. Usage & Best Practices

  • Always include the Token parameter (except when authenticating).
  • Change the default password (itoopie) upon first use.
  • For Java I2P, ensure the I2PControl webapp is enabled via WebApps.
  • Be prepared for slight variations: some fields may be numbers or strings, depending on I2P version.
  • Wrap long status strings for display-friendly output.