CoreStory Pre Ingestion API

The pre_ingestion API from CoreStory — 10 operation(s) for pre_ingestion.

GitHub OpenAPI

Operations 11

POST /api/pre-ingestion/start Start Pre-Ingestion Process #
POST /api/pre-ingestion/start/upload-repository Upload repository files and run the pre-ingestion analysis #
POST /api/pre-ingestion/upload-url Get a pre-signed URL for direct file upload #
POST /api/pre-ingestion/start/from-storage Start pre-ingestion from an already-uploaded file #
GET /api/pre-ingestion/{job_id}/status Get Pre-Ingestion Job Status #
GET /api/pre-ingestion/{pre_ingestion_id}/coverage Get Pre-Ingestion Job Results #
GET /api/pre-ingestion/{pre_ingestion_id}/excluded-files Get Excluded File Paths from Pre-Ingestion Job #
GET /api/pre-ingestion/{pre_ingestion_id}/included-files Get Included File Paths from Pre-Ingestion Job #
DELETE /api/pre-ingestion/{pre_ingestion_id} Delete Pre-Ingestion Job #
PATCH /api/pre-ingestion/{pre_ingestion_id} Update Pre-Ingestion Job #
GET /api/pre-ingestion/{pre_ingestion_id}/estimate-ingestion Estimate the LOC cost and allowance headroom for ingesting a codebase #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/corestory:corestory-pre-ingestion-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

corestory-pre-ingestion-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Crowdbotics API Documentation Pre Ingestion API
  description: '# CoreStory API Overview


    The CoreStory API provides programmatic access to structured insights derived from software source code. It is designed for engineering, architecture, and product teams who need to extract business logic, technical specifications, architectural relationships, and system-level context from complex or legacy codebases. By interfacing directly with CoreStory API, users can:


    - Generate full Product Requirements Documents (PRDs) from a codebase

    - Extract detailed Technical Specifications for modernization or migration

    - Query a codebase using natural language to surface implementation details, logic paths, dependencies, and architectural insights

    - Construct and visualize knowledge graphs of systems, components, and relationships

    - Ingest, store, and retrieve content from a vector store for AI-powered retrieval-augmented generation (RAG) workflows


    CoreStory is especially valuable in contexts where:


    - Codebases are large, unstructured, or under-documented

    - Product and engineering teams are onboarding to unfamiliar systems

    - Technical stakeholders require visibility into system design or feature coverage

    - Modernization, replatforming, or M&A due diligence is underway


    The API can be integrated into existing CI/CD pipelines, internal developer portals, architecture review boards, product planning processes, or documentation automation workflows. All endpoints support secure authentication and are designed for high-availability, asynchronous workloads. Output formats include JSON, Markdown, and PDF, with flexible formatting options for downstream consumption. For step-by-step usage instructions and workflows, refer to the CoreStory API Quick Start Guide. ## Features


    * **Document Generation**

    * Generate complete Product Requirements Documents (PRD)

    * Generate Technical Specifications

    * Generate individual document sections (executive overview, user personas, etc.)

    * Format documents in JSON or Markdown


    * **Vector Store Management**

    * Ingest and manage documents in vector store

    * Query and retrieve document content

    * Manage document embeddings


    * **Context Management**

    * Manage context for different document types

    * Set and retrieve PRD context

    * Support for future context types (technical specs, user stories, etc.)


    * **Knowledge Graph**

    * Generate knowledge graphs from codebase queries

    * Visualize relationships between code entities

    * Analyze code structure and dependencies


    * **API Endpoints**

    * `/api/documents/*` - Document generation and formatting

    * `/api/generate/*` - Document formatting utilities

    * `/api/vector-store/*` - Vector store management

    * `/api/agents/*` - AI agent operations

    * `/api/context/*` - Context management for documents

    * `/api/graph/*` - Knowledge graph generation and analysis


    Note: JWT authentication support coming soon. All endpoints currently provide detailed OpenAPI documentation. * **Observability**

    * OpenTelemetry instrumentation for distributed tracing

    * Prometheus metrics endpoint at `/metrics`

    * Comprehensive request/response tracking

    * Custom business metrics


    # CoreStory System Architecture


    This document provides a high-level overview of how the CoreStory platform ingests, analyzes, and serves structured software intelligence through its API. The system is designed to process codebases and related technical artifacts in order to generate product specifications, technical documents, and knowledge graph representations. ---


    ## Core Components


    ### 1. **Ingestion Layer**


    - Accepts Git URLs, file uploads, or local archives

    - Extracts source files, documentation, and metadata

    - Initiates chunking and embedding via the vector store pipeline


    ### 2. **Vector Store and Context Engine**


    - Stores chunked and embedded documents

    - Supports semantic search and document retrieval

    - Feeds LLMs with scoped context for generation and reasoning


    ### 3.'
  version: 1.33.0
servers:
- url: /
  description: Current server
security:
- BearerAuth: []
tags:
- name: pre_ingestion
paths:
  /api/pre-ingestion/start:
    post:
      tags:
      - pre_ingestion
      summary: Start Pre-Ingestion Process
      description: 'Start the pre-ingestion process for a specific repository. This process

        will analyze the repository and return a summary of the supported files.


        Args:

        request (PreIngestionRequest): The incoming request object.

        user (ClerkUser): The authenticated user.

        organization (Organization): The organization context.

        db (Session): The database session.


        Returns:

        PreIngestionResponse: Details about the initiated pre-ingestion process.'
      operationId: start_pre_ingestion
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartPreIngestionRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreIngestionResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/start/upload-repository:
    post:
      tags:
      - pre_ingestion
      summary: Upload repository files and run the pre-ingestion analysis
      description: Upload a single zipped repository file to Azure Blob Storage or Local directory,create a new project, and trigger pre-ingestion analysis.
      operationId: start_pre_ingestion_from_upload
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_start_pre_ingestion_from_upload'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreIngestionResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/upload-url:
    post:
      tags:
      - pre_ingestion
      summary: Get a pre-signed URL for direct file upload
      description: Returns a time-limited pre-signed URL that allows the client to upload a file directly to storage, bypassing server-side proxying and Cloudflare's upload size limits.
      operationId: get_upload_url
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UploadUrlRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadUrlResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/start/from-storage:
    post:
      tags:
      - pre_ingestion
      summary: Start pre-ingestion from an already-uploaded file
      description: Triggers the pre-ingestion analysis for a file that was uploaded directly to storage via a pre-signed URL obtained from the /upload-url endpoint.
      operationId: start_pre_ingestion_from_storage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartFromStorageRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreIngestionResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/{job_id}/status:
    get:
      tags:
      - pre_ingestion
      summary: Get Pre-Ingestion Job Status
      description: 'Get the status of a pre-ingestion job by its ID.


        Args:

        job_id (int): The ID of the pre-ingestion job.

        user (ClerkUser): The authenticated user.

        organization (Organization): The organization context.

        db (Session): The database session.


        Returns:

        PreIngestionResponse: Details about the pre-ingestion job status.'
      operationId: get_pre_ingestion_status
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: integer
          title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreIngestionResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/{pre_ingestion_id}/coverage:
    get:
      tags:
      - pre_ingestion
      summary: Get Pre-Ingestion Job Results
      description: 'Get the coverage results of a pre-ingestion job by its ID.


        Args:

        job (PreIngestion): The pre-ingestion job, resolved and org-checked by the dependency.

        user (ClerkUser): The authenticated user.

        db (Session): The database session.


        Returns:

        PreIngestionCoverageResponse: Coverage details of the pre-ingestion job.'
      operationId: get_pre_ingestion_coverage
      parameters:
      - name: pre_ingestion_id
        in: path
        required: true
        schema:
          type: integer
          title: Pre Ingestion Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreIngestionCoverageResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/{pre_ingestion_id}/excluded-files:
    get:
      tags:
      - pre_ingestion
      summary: Get Excluded File Paths from Pre-Ingestion Job
      description: 'Get the list of excluded file paths from a pre-ingestion job by its ID.


        Args:

        job (PreIngestion): The pre-ingestion job, resolved and org-checked by the dependency.

        user (ClerkUser): The authenticated user.

        db (Session): The database session.

        file_name (str, optional): Filter files by name.


        Returns:

        list[str]: List of excluded file paths.'
      operationId: get_pre_ingestion_excluded_files
      parameters:
      - name: pre_ingestion_id
        in: path
        required: true
        schema:
          type: integer
          title: Pre Ingestion Id
      - name: page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          description: Page number (1-based)
          default: 1
          title: Page
        description: Page number (1-based)
      - name: size
        in: query
        required: false
        schema:
          type: integer
          maximum: 1000
          minimum: 1
          description: Items per page
          default: 100
          title: Size
        description: Items per page
      - name: file_name
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: File Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedFilePathResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/{pre_ingestion_id}/included-files:
    get:
      tags:
      - pre_ingestion
      summary: Get Included File Paths from Pre-Ingestion Job
      description: 'Get the list of included file paths from a pre-ingestion job by its ID.


        Args:

        job (PreIngestion): The pre-ingestion job, resolved and org-checked by the dependency.

        user (ClerkUser): The authenticated user.

        db (Session): The database session.

        file_name (str, optional): Filter files by name.


        Returns:

        list[str]: Paginated list of included file paths.'
      operationId: get_pre_ingestion_included_files
      parameters:
      - name: pre_ingestion_id
        in: path
        required: true
        schema:
          type: integer
          title: Pre Ingestion Id
      - name: page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          description: Page number (1-based)
          default: 1
          title: Page
        description: Page number (1-based)
      - name: size
        in: query
        required: false
        schema:
          type: integer
          maximum: 1000
          minimum: 1
          description: Items per page
          default: 100
          title: Size
        description: Items per page
      - name: file_name
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: File Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedFilePathResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/{pre_ingestion_id}:
    delete:
      tags:
      - pre_ingestion
      summary: Delete Pre-Ingestion Job
      description: 'Delete a pre-ingestion job by its ID.


        Args:

        job (PreIngestion): The pre-ingestion job, resolved and org-checked by the dependency.

        user (ClerkUser): The authenticated user.

        db (Session): The database session.

        storage (StorageBackend): Storage backend for artifact cleanup.


        Returns:

        dict: Confirmation message upon successful deletion.'
      operationId: delete_pre_ingestion_job
      parameters:
      - name: pre_ingestion_id
        in: path
        required: true
        schema:
          type: integer
          title: Pre Ingestion Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Delete Pre Ingestion Job
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
    patch:
      tags:
      - pre_ingestion
      summary: Update Pre-Ingestion Job
      description: 'Update a pre-ingestion job by its ID.


        Args:

        job (PreIngestion): The pre-ingestion job, resolved and org-checked by the dependency.

        user (ClerkUser): The authenticated user.

        application_context (str, optional): New application context.

        db (Session): The database session.


        Returns:

        PreIngestionResponse: Updated details of the pre-ingestion job.'
      operationId: update_pre_ingestion_job
      parameters:
      - name: pre_ingestion_id
        in: path
        required: true
        schema:
          type: integer
          title: Pre Ingestion Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreIngestionUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreIngestionResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
  /api/pre-ingestion/{pre_ingestion_id}/estimate-ingestion:
    get:
      tags:
      - pre_ingestion
      summary: Estimate the LOC cost and allowance headroom for ingesting a codebase
      description: 'Estimate the cost of ingesting a codebase.


        Ingestion consumes no CIUs — it is governed by the org''s LOC cap — so the

        CIU cost is zero and the CIU balance is unaffected. The real currency is

        LOC: the ``loc`` field reports how many lines this ingestion would consume

        and how much of the org''s allowance remains.'
      operationId: estimate_ciu_cost_for_ingestion
      parameters:
      - name: pre_ingestion_id
        in: path
        required: true
        schema:
          type: integer
          title: Pre Ingestion Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateIngestionResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
components:
  schemas:
    ErrorBody:
      properties:
        message:
          type: string
          title: Message
        type:
          type: string
          title: Type
        details:
          additionalProperties: true
          type: object
          title: Details
          description: Optional extra context for the error.
        code:
          anyOf:
          - type: string
          - type: 'null'
          title: Code
          description: Stable machine-readable code for clients that branch on the specific failure.
        required_organization:
          anyOf:
          - $ref: '#/components/schemas/RequiredOrganization'
          - type: 'null'
          description: Set when the caller can retry after switching organization context.
      type: object
      required:
      - message
      - type
      title: ErrorBody
    PreIngestionUpdateRequest:
      properties:
        application_context:
          anyOf:
          - type: string
          - type: 'null'
          title: Application Context
      type: object
      title: PreIngestionUpdateRequest
    UploadUrlRequest:
      properties:
        filename:
          type: string
          minLength: 1
          title: Filename
          description: Name of the file to upload (e.g. 'codebase.zip')
        file_size_bytes:
          type: integer
          exclusiveMinimum: 0.0
          title: File Size Bytes
          description: Size of the file in bytes
        content_type:
          type: string
          title: Content Type
          description: MIME type of the file
          default: application/octet-stream
      type: object
      required:
      - filename
      - file_size_bytes
      title: UploadUrlRequest
    StartFromStorageRequest:
      properties:
        storage_key:
          type: string
          minLength: 1
          title: Storage Key
          description: Storage key returned by the upload-url endpoint
        app_custom_name:
          type: string
          minLength: 1
          title: App Custom Name
          description: Custom application name for the project
        context:
          type: string
          title: Context
          description: Application context for the project
          default: ''
      type: object
      required:
      - storage_key
      - app_custom_name
      title: StartFromStorageRequest
    UploadUrlResponse:
      properties:
        upload_url:
          type: string
          title: Upload Url
          description: Pre-signed URL for direct upload to storage
        storage_key:
          type: string
          title: Storage Key
          description: Storage key to reference when starting ingestion
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: UTC timestamp when the upload URL expires
      type: object
      required:
      - upload_url
      - storage_key
      - expires_at
      title: UploadUrlResponse
    LOCRejectionReason:
      type: string
      enum:
      - codebase_too_large
      - cumulative_would_exceed
      title: LOCRejectionReason
      description: 'Why the LOC gate rejected (or would reject) an ingestion.


        The frontend messages these two cases differently for the upsell.'
    Body_start_pre_ingestion_from_upload:
      properties:
        app_custom_name:
          type: string
          title: App Custom Name
          description: Custom application name for the project
        context:
          type: string
          title: Context
          description: Application context for the project
          default: ''
        file:
          type: string
          title: File
          description: Zipped repository file to upload
          format: binary
      type: object
      required:
      - app_custom_name
      - file
      title: Body_start_pre_ingestion_from_upload
    PreIngestionCoverageResponse:
      properties:
        project_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Project Id
        repository_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Repository Url
        branch:
          anyOf:
          - type: string
          - type: 'null'
          title: Branch
        total_files:
          type: integer
          title: Total Files
          default: 0
        total_directories:
          type: integer
          title: Total Directories
          default: 0
        code_analysis:
          additionalProperties: true
          type: object
          title: Code Analysis
          description: Dict with ingestion files analysis and detections.
        file_coverage:
          type: number
          title: File Coverage
          description: Coverage percentage from 0.0 to 100.0
          default: 0.0
        included_count:
          additionalProperties: true
          type: object
          title: Included Count
          description: List of objects representing file type and its count
        excluded_count:
          additionalProperties: true
          type: object
          title: Excluded Count
          description: List of objects representing file type and its count
        exclusion_reasons:
          additionalProperties: true
          type: object
          title: Exclusion Reasons
          description: Breakdown of files by exclusion reason (e.g., minified, third_party_vendored)
      type: object
      required:
      - repository_url
      - branch
      - included_count
      - excluded_count
      title: PreIngestionCoverageResponse
    EstimateIngestionResponse:
      properties:
        estimated_ciu_cost:
          type: number
          title: Estimated Ciu Cost
          description: Estimated CIU cost for ingesting the codebase
        remaining_ciu_balance:
          anyOf:
          - type: number
          - type: 'null'
          title: Remaining Ciu Balance
          description: Remaining CIU balance for the organization after the estimated cost is deducted
        loc:
          anyOf:
          - $ref: '#/components/schemas/LOCEstimate'
          - type: 'null'
          description: LOC-based ingestion estimate and the organization's LOC allowance headroom
      type: object
      required:
      - estimated_ciu_cost
      title: EstimateIngestionResponse
    RequiredOrganization:
      properties:
        id:
          type: string
          title: Id
          description: Clerk organization id the client should switch to.
        name:
          type: string
          title: Name
          description: Display name of that organization.
      type: object
      required:
      - id
      - name
      title: RequiredOrganization
      description: The organization a caller must be acting under before a denied request can succeed.
    PreIngestionStatus:
      type: string
      enum:
      - started
      - cloning
      - parsing
      - analyzed
      - completed
      - failed
      title: PreIngestionStatus
      description: PreIngestion status enumeration
    ErrorSchema:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
      - error
      title: ErrorSchema
    PaginatedFilePathResponse:
      properties:
        results:
          items:
            type: string
          type: array
          title: Results
          description: List of filepaths in pre-ingestion job
        pagination:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Pagination
      type: object
      required:
      - results
      - pagination
      title: PaginatedFilePathResponse
    StartPreIngestionRequest:
      properties:
        public_repo_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Public Repo Url
          description: Full GitHub repository URL (format 1)
        repo_full_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Repo Full Name
          description: Repository full name like 'owner/repo' (format 2)
        repo_branch:
          type: string
          title: Repo Branch
          description: Branch name
          default: main
        github_app_installation_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Github App Installation Id
          description: GitHub App installation ID for private repository access
        app_custom_name:
          type: string
          minLength: 1
          title: App Custom Name
          description: Custom application name for the project
      type: object
      required:
      - app_custom_name
      title: StartPreIngestionRequest
      description: Body schema for POST /api/pre-ingestion/start.
    PreIngestionResponse:
      properties:
        id:
          type: integer
          title: Id
        project_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Project Id
        status:
          $ref: '#/components/schemas/PreIngestionStatus'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated At
        progress:
          type: number
          title: Progress
          description: Progress percentage from 0.0 to 100.0
          default: 0.0
        application_context:
          anyOf:
          - type: string
          - type: 'null'
          title: Application Context
        failure_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Failure Type
          description: Short categorical failure tag set only when the job is FAILED. Lets the UI render category-specific guidance without parsing the message. See `app.utils.pre_ingestion.classify_pre_ingestion_failure` for the authoritative set of values.
        failure_reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Failure Reason
          description: Human-readable, sanitized failure message safe to show in the UI. Set only when the job is FAILED.
      type: object
      required:
      - id
      - status
      - created_at
      - updated_at
      title: PreIngestionResponse
    LOCEstimate:
      properties:
        incoming_supported_loc:
          type: integer
          title: Incoming Supported Loc
        included_file_count:
          type: integer
          title: Included File Count
        consumed:
          type: integer
          title: Consumed
        allowance:
          type: integer
          title: Allowance
        remaining:
          type: integer
          title: Remaining
        rejection_reason:
          anyOf:
          - $ref: '#/components/schemas/LOCRejectionReason'
          - type: 'null'
      type: object
      required:
      - incoming_supported_loc
      - included_file_count
      - consumed
      - allowance
      - remaining
      - rejection_reason
      title: LOCEstimate
      description: A read-only LOC estimate for a pending ingestion against the org's allowance.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter the Bearer token from Clerk authentication
x-tagGroups:
- name: Ingest Your Codebase
  tags:
  - vector_store
  - projects
  - pre_ingestion
  - reingestion
- name: Generate Code Intelligence
  tags:
  - documents
  - document_generation
  - document_formatters
  - prd
  - prd_version
  - tech_spec
  - quality_metrics
  - sample_projects
- name: Query Your Codebase
  tags:
  - conversations
  - workflows
  - discovery
  - context
  - artifacts
- name: Manage and Inspect Intelligence
  tags:
  - api_debugging
  - events
  - version
  - files
  - cache
  - token_tracking
- name: Authenticate and Manage Access
  tags:
  - clerk_authentication
  - git_webhooks
  - github_integration
  - organizations
  - api_key_management
  - mcp_token_management
  - user
- name: (Advanced) Prompt Tuning
  tags:
  - prompts
- name: MCP Protocol
  tags:
  - mcp_protocol
- name: Administration
  tags:
  - admin
x-provenance:
  method: harvested
  publisher: CoreStory
  source: https://c2s.corestory.ai/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)