{
  "openapi": "3.1.0",
  "info": {
    "title": "OniRelay Developer API",
    "version": "1.0.0",
    "description": "Build community modules and integrations. Game actions return queued jobs; only a companion acknowledgement confirms completion."
  },
  "servers": [
    {
      "url": "https://hosting.oninetwork.com/api/relay/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "OniRelayKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Create a scoped key in Community tools → Developer API. Credentials belong to one community."
      }
    }
  },
  "paths": {
    "/status": {
      "get": {
        "summary": "Connection health and plan limits",
        "operationId": "status",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: status:read. The key’s community is determined by the server.",
        "x-required-scope": "status:read",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        }
      }
    },
    "/players": {
      "get": {
        "summary": "Observed player presence and allowed statistics",
        "operationId": "players",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: players:read. The key’s community is determined by the server.",
        "x-required-scope": "players:read",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        }
      }
    },
    "/events": {
      "get": {
        "summary": "Recent activity, without private player coordinates",
        "operationId": "events",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: events:read. The key’s community is determined by the server.",
        "x-required-scope": "events:read",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        }
      }
    },
    "/modules": {
      "get": {
        "summary": "Module manifests and effective activation",
        "operationId": "modules",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: modules:read. The key’s community is determined by the server.",
        "x-required-scope": "modules:read",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        }
      }
    },
    "/modules/invoke": {
      "post": {
        "summary": "Queue a registered module command",
        "operationId": "modules_invoke",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: modules:invoke. The key’s community is determined by the server.",
        "x-required-scope": "modules:invoke",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "module",
                  "command"
                ],
                "properties": {
                  "module": {
                    "type": "string"
                  },
                  "command": {
                    "type": "string"
                  },
                  "args": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/jobs/{job}": {
      "get": {
        "summary": "Read the caller’s job result",
        "operationId": "jobs_job",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: modules:invoke or game:message. The key’s community is determined by the server.",
        "x-required-scope": "modules:invoke or game:message",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "job",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{32}$"
            }
          }
        ]
      }
    },
    "/discord/messages": {
      "post": {
        "summary": "Post a mention-safe embed to an authorized channel",
        "operationId": "discord_messages",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: discord:post. The key’s community is determined by the server.",
        "x-required-scope": "discord:post",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "channel",
                  "text"
                ],
                "properties": {
                  "channel": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 256
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 1800
                  }
                }
              }
            }
          }
        }
      }
    },
    "/game/messages": {
      "post": {
        "summary": "Queue a game message",
        "operationId": "game_messages",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: game:message. The key’s community is determined by the server.",
        "x-required-scope": "game:message",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 1500
                  },
                  "player": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/rewards/claim": {
      "post": {
        "summary": "Request an eligible linked player’s reward",
        "operationId": "rewards_claim",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: rewards:claim. The key’s community is determined by the server.",
        "x-required-scope": "rewards:claim",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "player",
                  "reward"
                ],
                "properties": {
                  "player": {
                    "type": "string"
                  },
                  "reward": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/claims/{claim}": {
      "get": {
        "summary": "Read a reward claim’s confirmed delivery status",
        "operationId": "claims_claim",
        "security": [
          {
            "OniRelayKey": []
          }
        ],
        "description": "Required scope: rewards:claim. The key’s community is determined by the server.",
        "x-required-scope": "rewards:claim",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Missing or revoked credential"
          },
          "403": {
            "description": "Scope, role or community access denied"
          },
          "402": {
            "description": "Premium required"
          },
          "404": {
            "description": "Resource not found"
          },
          "409": {
            "description": "Setup, revision or capability conflict"
          },
          "429": {
            "description": "Rate limit; retry in the next minute"
          },
          "503": {
            "description": "Provider unavailable; completion is not assumed"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "claim",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "x-plans": {
    "basic": {
      "name": "OniRelay Free",
      "monthly_usd": 0,
      "worlds": 1,
      "modules": 3,
      "boards": 1,
      "history_days": 7,
      "api_per_minute": 30,
      "posts_per_minute": 12,
      "schedules": 0,
      "custom_commands": 15,
      "stored_modules": 30,
      "source_bytes": 65536,
      "server_command_presets": 0,
      "server_commands_per_minute": 0,
      "addon_commands_per_minute": 30,
      "live_stat_lines": 20,
      "commands_per_module": 5,
      "settings_characters": 1024,
      "storage_utf16_units": 8192,
      "schedule_min_seconds": 300,
      "link_code_seconds": 600,
      "sdk_lease_seconds": 30,
      "command_deadline_seconds": 15,
      "local_map_size": 128,
      "local_map_cooldown_seconds": 15,
      "entity_scan_radius_chunks": 4,
      "entity_scan_max_chunks": 6,
      "entity_scan_cooldown_seconds": 15,
      "archive_retention_days": 30,
      "archive_bytes": 21474836480,
      "archive_count": 100,
      "chat_routes": 20,
      "chat_groups": 5,
      "chat_group_members": 10,
      "chat_source_ids": 20,
      "chat_source_per_minute": 30,
      "chat_feed_per_minute": 120,
      "chat_echo_seconds": 120,
      "health_probe_seconds": 300,
      "health_debounce_seconds": 30,
      "retired_sessions": 4096,
      "achievement_poll_seconds": 300,
      "achievement_pages": 20,
      "achievement_records": 2000,
      "admission_proof_seconds": 2592000,
      "admission_records": 10000,
      "verification_role_records": 10000,
      "voice_receipts": 1000,
      "voice_moves_per_tick": 20,
      "module_upload_bytes": 8388608,
      "personality_aliases": 8,
      "personality_replies": 20,
      "personality_cooldown_seconds": 10,
      "map_count": 32,
      "map_tiles": 256,
      "map_bytes": 67108864,
      "map_retention_days": 30,
      "marker_limit": 200,
      "player_marker_limit": 20,
      "module_marker_limit": 50,
      "marker_receipt_limit": 100000,
      "local_map_capture_seconds": 900,
      "scoreboard_capture_seconds": 1800,
      "location_fresh_seconds": 15,
      "player_status_fresh_seconds": 15,
      "skin_capture_count": 512,
      "skin_capture_bytes": 67108864,
      "skin_player_captures": 20,
      "skin_render_queue": 8,
      "skin_history_page": 5,
      "invite_slug_history": 50,
      "invite_view_receipts": 10000,
      "invite_attempt_records": 20000,
      "invite_metrics_retention_days": 90,
      "directory_page_size": 50,
      "directory_per_minute": 60,
      "directory_work_seconds": 2,
      "directory_history_days": 30,
      "overview_worlds": 5,
      "overview_roster_size": 20,
      "overview_per_minute": 30,
      "permission_checks_per_minute": 10,
      "handoff_poll_seconds": 60,
      "handoff_fresh_seconds": 150,
      "handoff_empty_seconds": 60,
      "public_directory_profiles": 10000,
      "public_directory_page_size": 20,
      "public_directory_per_minute": 600,
      "data_export_seconds": 86400,
      "data_export_bytes": 67108864,
      "data_export_plain_bytes": 134217728,
      "data_export_rows": 100000,
      "data_export_chunk_bytes": 262144,
      "data_export_work_seconds": 90,
      "data_export_queue": 8,
      "history_deletion_records": 500,
      "history_deletion_bytes": 8388608,
      "history_deletion_record_bytes": 8388608,
      "history_deletion_work_seconds": 5,
      "history_deletion_preview_seconds": 300
    },
    "premium": {
      "name": "OniRelay Premium",
      "monthly_usd": 3,
      "worlds": 1,
      "modules": 15,
      "boards": 5,
      "history_days": 90,
      "api_per_minute": 120,
      "posts_per_minute": 60,
      "schedules": 15,
      "custom_commands": 75,
      "stored_modules": 100,
      "source_bytes": 262144,
      "server_command_presets": 25,
      "server_commands_per_minute": 30,
      "addon_commands_per_minute": 120,
      "live_stat_lines": 20,
      "commands_per_module": 5,
      "settings_characters": 1024,
      "storage_utf16_units": 8192,
      "schedule_min_seconds": 300,
      "link_code_seconds": 600,
      "sdk_lease_seconds": 30,
      "command_deadline_seconds": 15,
      "local_map_size": 128,
      "local_map_cooldown_seconds": 15,
      "entity_scan_radius_chunks": 4,
      "entity_scan_max_chunks": 6,
      "entity_scan_cooldown_seconds": 15,
      "archive_retention_days": 30,
      "archive_bytes": 21474836480,
      "archive_count": 100,
      "chat_routes": 20,
      "chat_groups": 5,
      "chat_group_members": 10,
      "chat_source_ids": 20,
      "chat_source_per_minute": 30,
      "chat_feed_per_minute": 120,
      "chat_echo_seconds": 120,
      "health_probe_seconds": 300,
      "health_debounce_seconds": 30,
      "retired_sessions": 4096,
      "achievement_poll_seconds": 300,
      "achievement_pages": 20,
      "achievement_records": 2000,
      "admission_proof_seconds": 2592000,
      "admission_records": 10000,
      "verification_role_records": 10000,
      "voice_receipts": 1000,
      "voice_moves_per_tick": 20,
      "module_upload_bytes": 8388608,
      "personality_aliases": 8,
      "personality_replies": 20,
      "personality_cooldown_seconds": 10,
      "map_count": 32,
      "map_tiles": 256,
      "map_bytes": 67108864,
      "map_retention_days": 30,
      "marker_limit": 200,
      "player_marker_limit": 20,
      "module_marker_limit": 50,
      "marker_receipt_limit": 100000,
      "local_map_capture_seconds": 900,
      "scoreboard_capture_seconds": 1800,
      "location_fresh_seconds": 15,
      "player_status_fresh_seconds": 15,
      "skin_capture_count": 512,
      "skin_capture_bytes": 67108864,
      "skin_player_captures": 20,
      "skin_render_queue": 8,
      "skin_history_page": 5,
      "invite_slug_history": 50,
      "invite_view_receipts": 10000,
      "invite_attempt_records": 20000,
      "invite_metrics_retention_days": 90,
      "directory_page_size": 50,
      "directory_per_minute": 60,
      "directory_work_seconds": 2,
      "directory_history_days": 30,
      "overview_worlds": 5,
      "overview_roster_size": 20,
      "overview_per_minute": 30,
      "permission_checks_per_minute": 10,
      "handoff_poll_seconds": 60,
      "handoff_fresh_seconds": 150,
      "handoff_empty_seconds": 60,
      "public_directory_profiles": 10000,
      "public_directory_page_size": 20,
      "public_directory_per_minute": 600,
      "data_export_seconds": 86400,
      "data_export_bytes": 67108864,
      "data_export_plain_bytes": 134217728,
      "data_export_rows": 100000,
      "data_export_chunk_bytes": 262144,
      "data_export_work_seconds": 90,
      "data_export_queue": 8,
      "history_deletion_records": 500,
      "history_deletion_bytes": 8388608,
      "history_deletion_record_bytes": 8388608,
      "history_deletion_work_seconds": 5,
      "history_deletion_preview_seconds": 300
    }
  }
}
