{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entri-games/json-schema/entri-games-envelope-schema.json",
  "title": "Envelope",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entri-games-openapi.json#/components/schemas/Envelope",
  "type": "object",
  "required": [
    "ok",
    "api_version",
    "request_id"
  ],
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "api_version": {
      "type": "string"
    },
    "api_revision": {
      "type": "string"
    },
    "request_id": {
      "type": "string"
    },
    "say_to_human": {
      "type": "string"
    },
    "data": {
      "type": "object"
    },
    "needs_human": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "links": {
      "type": "object"
    },
    "next": {
      "type": "object"
    },
    "context_tips": {
      "type": "object"
    },
    "content_notice": {
      "type": "object"
    },
    "error": {
      "type": "object",
      "required": [
        "code",
        "message",
        "say_to_human",
        "retryable"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "account_inactive",
            "agent_api_disabled",
            "agent_budget_exhausted",
            "agent_budget_unset",
            "agent_daily_cap",
            "agent_quest_limit",
            "already_done",
            "answer_rejected",
            "answer_too_long",
            "answer_too_short",
            "bad_request",
            "budget_unknown",
            "capacity_busy",
            "chat_read_only",
            "company_exists",
            "confirm_send",
            "confirm_spend",
            "contact_daily_limit",
            "context_rejected",
            "daily_quota",
            "event_busy",
            "event_unavailable",
            "feature_unavailable",
            "finalize_failed",
            "finalizing",
            "fork_required",
            "human_opens_contact",
            "idempotency_key_required",
            "idempotency_key_reused",
            "image_rejected",
            "insufficient_scope",
            "internal",
            "interview_busy",
            "interview_in_telegram",
            "interview_incomplete",
            "interview_required",
            "invalid_token",
            "limiter_unavailable",
            "llm_daily_cap",
            "low_balance",
            "method_not_allowed",
            "needs_clarification",
            "not_found",
            "operation_lost",
            "operation_retry_exhausted",
            "origin_forbidden",
            "output_rejected",
            "own_quest",
            "payload_too_large",
            "profile_required",
            "project_changed",
            "quest_gone",
            "quest_not_publishable",
            "quest_response_private",
            "quest_slots_full",
            "question_closed",
            "question_stale",
            "rate_limited",
            "reason_private_contact",
            "reason_required",
            "respond_to_required",
            "response_too_large",
            "review_changed",
            "showcase_unavailable",
            "similar_quest_closed",
            "spend_limit",
            "telegram_flow_active",
            "temporarily_unavailable",
            "test_account_pool",
            "text_rejected",
            "text_too_long",
            "text_too_short",
            "timeout",
            "too_many_projects",
            "unsupported_media_type",
            "use_person_part"
          ],
          "x-extensible-enum": true
        },
        "message": {
          "type": "string"
        },
        "say_to_human": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "retry_after_s": {
          "type": "number"
        },
        "resets_at": {
          "type": "string"
        },
        "human_action": {
          "type": "object"
        },
        "details": {
          "type": "object"
        }
      }
    }
  }
}