{
  "openapi": "3.1.0",
  "info": {
    "title": "Gully RPC",
    "version": "1.0.0",
    "summary": "JSON-RPC for every chain Gully RPC serves, and the public status JSON.",
    "description": "Standard Ethereum JSON-RPC over HTTPS.\n\n**Keyless.** `https://rpc.gullyrpc.xyz/gullychain/evm/{chainId}` needs no key: 25 requests per second per visitor, cached. Good for wallets, front ends and trying things out.\n\n**With a key.** `https://rpc.gullyrpc.xyz/public/evm/{chainId}` with a key from https://app.gullyrpc.xyz (keys start with `hk_live_` and are shown once). `public` is a fixed path segment, the same for everyone; it is not your key. Send the key as the `X-ERPC-Secret-Token` header. Limits follow your plan.\n\n**Chains served now**\n\n| Chain | Chain id | Keyless |\n|---|---|---|\n| Gully Chain Testnet | 485590 | yes |\n| Kinetiq Elysium | 99901 | yes |\n| Anubis Network | 6714 | yes |\n| Ethereum | 1 | key needed |\n| Base | 8453 | yes |\n| BNB Chain | 56 | yes |\n| Arbitrum One | 42161 | key needed |\n| Robinhood | 4663 | yes |\n\nOver the limit the answer is HTTP 429. Batches are accepted; keep them under 50 calls.",
    "x-generated-by": "scripts/gen-openapi.mjs"
  },
  "servers": [
    {
      "url": "https://rpc.gullyrpc.xyz",
      "description": "Gully RPC gateway"
    }
  ],
  "tags": [
    {
      "name": "JSON-RPC"
    },
    {
      "name": "Status"
    }
  ],
  "paths": {
    "/gullychain/evm/{chainId}": {
      "post": {
        "operationId": "keylessJsonRpc",
        "tags": [
          "JSON-RPC"
        ],
        "summary": "Keyless JSON-RPC",
        "description": "No key. 25 requests per second per visitor. Read methods are cached for a short time.",
        "security": [],
        "parameters": [
          {
            "name": "chainId",
            "in": "path",
            "required": true,
            "description": "Chain id.",
            "schema": {
              "type": "integer",
              "enum": [
                485590,
                99901,
                6714,
                4663,
                8453,
                56
              ]
            },
            "example": 485590
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "eth_blockNumber",
                "params": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                },
                "example": {
                  "jsonrpc": "2.0",
                  "id": 1,
                  "result": "0x1281a69"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this visitor. Slow down and retry."
          }
        }
      }
    },
    "/public/evm/{chainId}": {
      "post": {
        "operationId": "keyedJsonRpc",
        "tags": [
          "JSON-RPC"
        ],
        "summary": "JSON-RPC with your key",
        "description": "Every chain Gully RPC serves. Limits follow your plan. Treat the key like a password: use it on a server, never in a page.",
        "security": [
          {
            "projectKey": []
          }
        ],
        "parameters": [
          {
            "name": "chainId",
            "in": "path",
            "required": true,
            "description": "Chain id of a served chain.",
            "schema": {
              "type": "integer",
              "enum": [
                485590,
                99901,
                6714,
                1,
                8453,
                56,
                42161,
                4663
              ]
            },
            "example": 485590
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              },
              "example": {
                "jsonrpc": "2.0",
                "id": 1,
                "method": "eth_blockNumber",
                "params": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonRpcResponse"
                },
                "example": {
                  "jsonrpc": "2.0",
                  "id": 1,
                  "result": "0x1281a69"
                }
              }
            }
          },
          "401": {
            "description": "Missing or unknown key."
          },
          "429": {
            "description": "Over the limit of your plan."
          }
        }
      }
    },
    "/status.json": {
      "get": {
        "operationId": "getStatus",
        "tags": [
          "Status"
        ],
        "summary": "What is served now",
        "description": "The roster every Gully RPC page reads: served chains, chains in preparation, features and the keyless project.",
        "security": [],
        "servers": [
          {
            "url": "https://gullyrpc.xyz",
            "description": "Gully RPC site"
          }
        ],
        "responses": {
          "200": {
            "description": "The roster.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "projectKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-ERPC-Secret-Token",
        "description": "Your Gully RPC key from the portal."
      }
    },
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "const": "2.0"
          },
          "id": {
            "type": [
              "integer",
              "string"
            ]
          },
          "method": {
            "type": "string",
            "examples": [
              "eth_blockNumber",
              "eth_getBalance",
              "eth_call",
              "eth_getLogs"
            ]
          },
          "params": {
            "type": "array"
          }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "type": "string"
          },
          "id": {
            "type": [
              "integer",
              "string",
              "null"
            ]
          },
          "result": {},
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "Status": {
        "type": "object",
        "properties": {
          "updated": {
            "type": "string",
            "format": "date"
          },
          "chains": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "chainId": {
                  "type": "integer"
                },
                "kind": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "live",
                    "beta",
                    "syncing",
                    "coming-soon"
                  ]
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "keyless": {
            "type": "object",
            "properties": {
              "project": {
                "type": "string"
              },
              "rpsPerIp": {
                "type": "integer"
              },
              "chains": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-rate-limit": {
    "headers": [],
    "keyless": {
      "perSecondPerVisitor": 25
    }
  },
  "x-try-it": {
    "keyless": true,
    "operations": [
      "keylessJsonRpc",
      "getStatus"
    ],
    "note": "Runs against the keyless endpoint only. Gully Chain Testnet holds test funds with no real value.",
    "methods": [
      "eth_blockNumber",
      "eth_chainId",
      "eth_gasPrice",
      "eth_getBalance",
      "eth_getBlockByNumber",
      "eth_getCode",
      "eth_call"
    ]
  }
}
