> ## Documentation Index
> Fetch the complete documentation index at: https://routeme.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# JSON-RPC proxy

> Send a single JSON-RPC request or a JSON-RPC batch (array). Replace {apiKey} with your actual API key.



## OpenAPI

````yaml /api-reference/openapi.json post /rpc/{chainId}/{apiKey}
openapi: 3.0.0
info:
  title: RouteMesh API
  version: 1.0.0
  description: >-
    HTTP API for routing JSON-RPC requests across providers, managing API keys,
    and viewing usage.
  license:
    name: Proprietary
    url: https://routeme.sh
servers:
  - url: https://api.routeme.sh
    description: API server — health, chains, API keys, usage, and public submissions
  - url: https://lb.routeme.sh
    description: RPC router (primary load balancer)
  - url: https://lb2.routeme.sh
    description: RPC router (AWS backup load balancer)
security: []
tags:
  - name: RPC
    description: Forward JSON-RPC requests to the router.
  - name: Chains
    description: Discover supported chains.
  - name: Submissions
    description: Public chain and node listing requests (rate-limited per IP).
  - name: API Keys
    description: Manage your API keys for self-service access.
  - name: Usage
    description: View your usage and billing data.
  - name: Health
    description: Service health checks.
paths:
  /rpc/{chainId}/{apiKey}:
    servers:
      - url: https://lb.routeme.sh
        description: Primary RPC router
      - url: https://lb2.routeme.sh
        description: AWS backup RPC router
    post:
      tags:
        - RPC
      summary: JSON-RPC proxy
      description: >-
        Send a single JSON-RPC request or a JSON-RPC batch (array). Replace
        {apiKey} with your actual API key.
      operationId: postRpc
      parameters:
        - name: chainId
          in: path
          required: true
          description: Chain ID (e.g. 1 for Ethereum, 137 for Polygon, 8453 for Base).
          schema:
            type: string
          example: '1'
        - name: apiKey
          in: path
          required: true
          description: Your RouteMesh API key (from the dashboard).
          schema:
            type: string
            format: password
          example: your-api-key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/JsonRpcRequest'
                - $ref: '#/components/schemas/JsonRpcBatchRequest'
      responses:
        '200':
          description: JSON-RPC response (single or batch)
          headers:
            X-Batch-Id:
              $ref: '#/components/headers/XBatchId'
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/JsonRpcResponse'
                  - $ref: '#/components/schemas/JsonRpcBatchResponse'
        '400':
          description: Bad request (e.g. invalid JSON or invalid JSON-RPC payload)
        '401':
          description: Unauthorized (invalid API key)
        '403':
          description: Forbidden (domain not allowed)
        '422':
          description: >-
            Unprocessable entity (e.g. chain not supported or method not
            supported)
        '424':
          description: >-
            Failed dependency (all upstream providers failed with non-2xx
            responses)
        '429':
          description: >-
            Too many requests (all upstream providers rate limited / on
            cooldown)
        '500':
          description: Internal server error
        '504':
          description: Gateway timeout (router timed out waiting for upstream providers)
components:
  schemas:
    JsonRpcRequest:
      type: object
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        method:
          type: string
          description: JSON-RPC method name (e.g. eth_blockNumber, eth_call).
        params:
          oneOf:
            - type: array
              items: {}
            - type: object
              additionalProperties: true
          description: Method parameters (varies by method).
        id: {}
      required:
        - jsonrpc
        - method
        - id
      additionalProperties: false
    JsonRpcBatchRequest:
      type: array
      items:
        $ref: '#/components/schemas/JsonRpcRequest'
    JsonRpcResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        id: {}
        result:
          description: Result value (varies by JSON-RPC method).
        error:
          anyOf:
            - $ref: '#/components/schemas/JsonRpcError'
      required:
        - jsonrpc
        - id
      additionalProperties: true
    JsonRpcBatchResponse:
      type: array
      items:
        $ref: '#/components/schemas/JsonRpcResponse'
    JsonRpcError:
      description: >-
        JSON-RPC error object. See [RPC Error Codes](/rpc-error-codes) for full
        code → meaning and when each occurs.
      type: object
      properties:
        code:
          type: integer
          description: >-
            Router error codes: -32700 (parse error), -32600 (invalid request),
            -32602 (invalid params), -32603 (internal error), -32000 (server
            error), -32001 (chain not supported), -32002 (method not supported),
            -32003 (all nodes on cooldown).
        message:
          type: string
          description: Human-readable error message.
        data:
          description: Optional additional error data.
      required:
        - code
        - message
      additionalProperties: true
  headers:
    XBatchId:
      description: >-
        Correlation ID for this HTTP request. Save it and share with RouteMesh
        support to help trace requests across logs and analytics.
      schema:
        type: string
      example: 1f4f3b23-1c2b-4c87-9c2f-7e2e0f0df4b5

````