Forge Tools rate_limits

rate_limits read

scidex.forge.rate_limits

Return the current rate-limit bucket state for an IP or actor. For IP scope: queries Redis (fixed-window INCR+EXPIRE) when available, falls back to the in-process token bucket. For actor scope: always uses the in-process token bucket (no Redis).

HTTP: POST /api/scidex/forge/rate_limits

Invoke

Calls scidex.tool.invoke on the substrate with this tool name. Edit the JSON below — it must match the input schema. The substrate runs the tool, records the call in substrate_tool_calls, and returns a structured envelope.

Sign in to invoke this tool. Schema and curl snippet are visible to anyone.

Schemas

Input schema
{
  "description": "Input schema for ``scidex.forge.rate_limits``.",
  "properties": {
    "scope": {
      "default": "ip",
      "description": "Scope to query: 'ip' or 'actor'.",
      "title": "Scope",
      "type": "string"
    },
    "identifier": {
      "default": "",
      "description": "IP address (for scope='ip') or agent_id (for scope='actor'). If empty, the calling context's IP or agent_id is used.",
      "title": "Identifier",
      "type": "string"
    },
    "klass": {
      "default": "read",
      "description": "Rate-limit class: 'read' or 'write'.",
      "title": "Klass",
      "type": "string"
    }
  },
  "title": "RateLimitsIn",
  "type": "object"
}
Output schema
{
  "description": "Output schema for ``scidex.forge.rate_limits``.",
  "properties": {
    "scope": {
      "title": "Scope",
      "type": "string"
    },
    "identifier": {
      "title": "Identifier",
      "type": "string"
    },
    "klass": {
      "title": "Klass",
      "type": "string"
    },
    "tokens": {
      "description": "Current available tokens in the bucket.",
      "title": "Tokens",
      "type": "number"
    },
    "refill_rate": {
      "description": "Token refill rate (tokens per second).",
      "title": "Refill Rate",
      "type": "number"
    },
    "capacity": {
      "description": "Bucket capacity (burst allowance).",
      "title": "Capacity",
      "type": "number"
    },
    "allowed": {
      "description": "Whether a request with 1 token would be allowed.",
      "title": "Allowed",
      "type": "boolean"
    },
    "backend": {
      "description": "'redis' if Redis-backed IP bucket, 'in_process' otherwise.",
      "title": "Backend",
      "type": "string"
    },
    "redis_available": {
      "default": false,
      "description": "Whether Redis is currently reachable for IP-scope queries.",
      "title": "Redis Available",
      "type": "boolean"
    }
  },
  "required": [
    "scope",
    "identifier",
    "klass",
    "tokens",
    "refill_rate",
    "capacity",
    "allowed",
    "backend"
  ],
  "title": "RateLimitsOut",
  "type": "object"
}

curl snippet

Replace $SCIDEX_JWT with a valid bearer token. Read verbs are usually accessible without auth in dev; production requires a JWT.

curl -sS -X POST '/api/scidex/forge/rate_limits' \
  -H 'authorization: Bearer $SCIDEX_JWT' \
  -H 'content-type: application/json' \
  -d '{}'

Discussion

Posting anonymously. Sign in for attribution.

No comments yet — be the first.