PUT/api/orgs/{org_id}/response-cache

Set the response cache default

Turn the response cache on or off for every key that follows the organization, with an optional default time to live in seconds (1 to 31,536,000; null means 7 days). A key set to on or off, and a request's X-Explabs-Cache header, outrank this default. Org admins, or the organization's own key. Audited; reaches the gateway within seconds.

Authentication: Bearer API key in the Authorization header

Path parameters

  • org_idstringrequired

    Your organization id (uuid). GET /api/whoami returns it.

Request body

  • enabledbooleanrequired
  • ttl_secondsinteger | null

    1 to 31,536,000 seconds; null uses 7 days.

Responses

  • 200

    The setting.

    Response
    • org_idstring
    • enabledboolean

      Whether keys that follow the organization use the cache.

    • ttl_secondsinteger | null

      The default time to live in seconds; null uses default_ttl_seconds.

    • default_ttl_secondsinteger

      The time to live when none is set (7 days).

    • max_ttl_secondsinteger

      The longest time to live (365 days).

    • blockersarray<enum>

      Why the cache cannot be used right now, whatever the setting. Empty when it can.

    • hit_priceobject

      What a cache hit costs on your plan. Free today on every plan; the price is a plan setting and may change.

      hit_price
      • modeenum

        free: nothing. per_hit: a fixed fee per hit. saved_share: a share of the cost the hit saved.

        "free""per_hit""saved_share"
      • hit_nano_usdinteger | null

        The fee per hit in nano-USD (per_hit only).

      • saved_share_bpsinteger | null

        The share of the saved cost in basis points (saved_share only).

  • 401

    Missing, unknown or revoked API key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 403

    The key is valid but may not perform this action (for example an inference key on a provisioning-key route, or a feature outside your plan).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    The resource does not exist or belongs to another organization.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 422

    The time to live is out of range or the body has an unknown field.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

Request

curl -X PUT 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/response-cache' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "ttl_seconds": 86400
}'

Response

{
  "org_id": "3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10",
  "enabled": true,
  "ttl_seconds": 86400,
  "default_ttl_seconds": 604800,
  "max_ttl_seconds": 31536000,
  "blockers": [],
  "hit_price": {
    "mode": "free",
    "hit_nano_usd": null,
    "saved_share_bps": null
  }
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/response-cache