> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinecone.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a task (with steps)



## OpenAPI

````yaml https://raw.githubusercontent.com/pinecone-io/pinecone-api/refs/heads/main/2026-07/nexus_2026-07.oas.yaml GET /tasks/{id}
openapi: 3.0.3
info:
  title: Nexus API
  contact:
    name: Pinecone Support
    url: https://support.pinecone.io
    email: support@pinecone.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 2026-07
  description: >
    Nexus turns a set of sources into a queryable, self-improving knowledge
    base. A context is **sources + a manifest**: upload sources, **curate** them
    into a searchable index (curate is explicit — there is no auto-curate), and
    then query the context. The manifest (a single validated JSON document)
    defines how the context indexes, retrieves, and answers.


    Conventions:


      * The `{slug}` path parameter accepts the URL-safe context slug **or**
        its UUID.

      * Contexts return a `ContextResponse` (derived flags), not the raw
        persisted model. Tasks return a `TaskResponse`.

      * Querying is the unified KnowQL Query API: `POST /api/query` runs one
        turn (`ask` in, answer out); multi-turn conversations are **sessions**
        (`GET/DELETE /api/sessions`, `GET /api/queries/{id}`). Read the
        answer from `output[].content[].text`.

      * Tasks are a top-level, project-owned resource at `/api/tasks` —
        they are no longer nested under contexts. Active workflow types are
        `optimize`, `curate`, `search`, `search_cc`, `search_rag`, `explore`,
        `profile`, `import`, `pack`, `restore`.
servers:
  - url: https://{host}/api
    description: Your Nexus deployment host
    variables:
      host:
        default: api.example.com
security:
  - bearerAuth: []
  - apiKey: []
tags:
  - name: Auth
    description: Login and identity.
  - name: Project
    description: The active Pinecone project and its disclosure state.
  - name: Contexts
    description: A context is sources + a manifest. Curate it explicitly before querying.
  - name: Manifest
    description: Manifest templates and the per-context manifest.
  - name: Source Files
    description: >-
      Per-context source imports (upload, connector, public repo) and the source
      file tree.
  - name: Knowledge
    description: Read-only browse of curated knowledge (chunks + artifacts).
  - name: Curation
    description: Curate workflow trigger, curation ledger, and version-pin primitives.
  - name: Connectors
    description: >-
      Project-level links to external source providers (Box, ...). Linked via
      OAuth or an API key, then used to import source documents into a context.
  - name: Query
    description: >-
      The unified KnowQL Query API: run a query turn (`/query`), fetch a turn
      (`/queries/{id}`), inspect its trace, manage feedback, comparison flags,
      and multi-turn sessions (`/sessions`).
  - name: Tasks
    description: >-
      Top-level, project-owned task records for every workflow (optimize,
      curate, search, work, explore, profile, import, pack, restore, groom).
  - name: Task Files
    description: Read, list, and delete files from live or archived task containers.
paths:
  /tasks/{id}:
    parameters:
      - $ref: '#/components/parameters/TaskId'
      - $ref: '#/components/parameters/ApiVersionHeader'
    get:
      tags:
        - Tasks
      summary: Get a task (with steps)
      operationId: get_task
      responses:
        '200':
          description: The task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    TaskId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Task id.
    ApiVersionHeader:
      in: header
      name: X-Pinecone-Api-Version
      description: >-
        Date-based contract version. Omit to resolve to the Nexus default
        version (`2026-07`, the oldest served version); send `unstable` for the
        in-development surface. The resolved version is echoed back on the same
        header. A present-but-unrecognized value is rejected with `400
        unsupported_api_version`.
      required: false
      style: simple
      schema:
        type: string
        default: 2026-07
        x-enum:
          - 2026-07
          - unstable
  schemas:
    TaskResponse:
      type: object
      required:
        - id
        - project_id
        - created_by
        - workflow
        - state
        - input
        - steps
        - tokens_prompt
        - tokens_completion
        - runtime_seconds
        - created_at
      properties:
        id:
          type: string
        project_id:
          type: string
        context_id:
          type: string
          nullable: true
        agent_id:
          type: string
          nullable: true
        session_id:
          type: string
          nullable: true
          description: Set for query turns
        created_by:
          type: string
        workflow:
          $ref: '#/components/schemas/Workflow'
        state:
          $ref: '#/components/schemas/TaskState'
        error:
          type: string
          nullable: true
        input:
          $ref: '#/components/schemas/TaskInput'
        output:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/TaskOutput'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/TaskStep'
          description: Populated only on GET /tasks/{id}
        tokens_prompt:
          type: integer
          format: int64
        tokens_completion:
          type: integer
          format: int64
        runtime_seconds:
          type: integer
          format: int64
        running_from:
          type: string
          format: date-time
          nullable: true
        timeout_seconds:
          type: integer
          nullable: true
        timeout_at:
          type: string
          format: date-time
          nullable: true
        archived_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        last_activity_at:
          type: string
          format: date-time
          nullable: true
        schedule:
          type: string
          nullable: true
        scheduled_at:
          type: string
          format: date-time
          nullable: true
        parent_task_id:
          type: string
          nullable: true
        progress:
          $ref: '#/components/schemas/TaskProgress'
    Workflow:
      type: string
      x-enum:
        - optimize
        - curate
        - search
        - search_cc
        - search_rag
        - work
        - explore
        - profile
        - import
        - pack
        - restore
        - groom
      description: >-
        The canonical workflow name. Legacy aliases (`build`, `query`,
        `query_search`, `query_sac`, `query_cc`, `query_rag`, `response`,
        `agent`, `session`) are still accepted on input and normalized to the
        canonical value.
    TaskState:
      type: string
      x-enum:
        - scheduled
        - starting
        - provisioning
        - running
        - stopping
        - completed
        - cancelled
        - failed
    TaskInput:
      description: >-
        A task's per-workflow `input`, written once at creation and echoed back
        verbatim. It carries no discriminant of its own — the sibling `workflow`
        field selects the shape.
      anyOf:
        - $ref: '#/components/schemas/SearchInput'
        - $ref: '#/components/schemas/CurateInput'
        - $ref: '#/components/schemas/ImportInput'
        - $ref: '#/components/schemas/PackInput'
        - $ref: '#/components/schemas/RestoreInput'
        - $ref: '#/components/schemas/ExploreInput'
        - $ref: '#/components/schemas/ProfileInput'
        - $ref: '#/components/schemas/OptimizeInput'
        - $ref: '#/components/schemas/GroomInput'
    TaskOutput:
      description: >-
        A task's reported `output` — heterogeneous: every workflow reports a
        different per-state shape, stored and echoed verbatim. An unrecognized
        or newer shape is preserved as-is rather than rejected, so treat this
        union as open.
      anyOf:
        - $ref: '#/components/schemas/SearchTurnCompletedOutput'
        - $ref: '#/components/schemas/SearchCcTurnCompletedOutput'
        - $ref: '#/components/schemas/SearchTurnFailedOutput'
        - $ref: '#/components/schemas/PackTaskOutput'
        - $ref: '#/components/schemas/RestoreTaskOutput'
        - $ref: '#/components/schemas/OptimizeResultOutput'
        - $ref: '#/components/schemas/OptimizeNoopOutput'
        - $ref: '#/components/schemas/GroomMetricsOutput'
        - $ref: '#/components/schemas/CurateRunOutput'
        - $ref: '#/components/schemas/CurateManifestTuneOutput'
        - $ref: '#/components/schemas/CurateNoopOutput'
        - $ref: '#/components/schemas/ExploreOutput'
        - $ref: '#/components/schemas/ProfileEstimateOutput'
        - $ref: '#/components/schemas/ProfileEmptyOutput'
        - $ref: '#/components/schemas/ImportOutput'
        - $ref: '#/components/schemas/StatusErrorOutput'
        - $ref: '#/components/schemas/StateFailedOutput'
        - type: object
          title: Other
          additionalProperties: true
          description: Any shape without a named variant
    TaskStep:
      type: object
      required:
        - step_id
        - status
      description: >-
        One reported step row. `step_id` and `status` are always set; the rest
        are per-call optionals.
      properties:
        step_id:
          type: string
        status:
          type: string
        type:
          type: string
        commentary:
          type: string
        code:
          type: string
          description: Redacted tool input (search)
        result:
          type: string
          description: Redacted tool output (search)
        cum_input_tokens:
          type: integer
          format: int64
        cum_output_tokens:
          type: integer
          format: int64
        job_id:
          type: string
          description: LlamaParse job id
        path:
          type: string
          description: Source path being parsed
    TaskProgress:
      type: object
      required:
        - phase
        - phases
        - label
        - pct
      description: Coarse task progress surfaced to the console.
      properties:
        phase:
          type: integer
          format: int64
        phases:
          type: integer
          format: int64
        label:
          type: string
        pct:
          type: number
          format: double
        eta_seconds:
          type: integer
          format: int64
          nullable: true
    Error:
      type: object
      required:
        - message
      description: The error envelope every non-2xx response uses.
      properties:
        message:
          type: string
        code:
          type: string
          description: >-
            Stable machine-readable code, present only on errors a client must
            branch on. 
          x-enum:
            - unsupported_api_version
            - preview_not_enabled
            - preview_file_limit
            - preview_byte_limit
            - workspace_host_required
            - workspace_not_found
    SearchInput:
      type: object
      title: search / search_cc / search_rag / work
      required:
        - session_id
        - query_id
        - ask
        - messages
        - models
        - tools
        - shape
        - instructions
        - scope
        - turn_timeout_seconds
        - retrieval
        - comparison_group
      properties:
        session_id:
          type: string
        query_id:
          type: string
        ask:
          type: string
          description: >-
            Title fallback for the tasks UI; empty when the turn had no user
            message
        messages:
          type: array
          items:
            type: object
            required:
              - role
              - content
            properties:
              role:
                type: string
              content:
                type: string
        models:
          type: array
          items:
            type: string
        tools:
          type: array
          items:
            type: string
        shape:
          type: object
          nullable: true
          additionalProperties: true
        instructions:
          type: string
          nullable: true
        scope:
          type: array
          items:
            type: string
        turn_timeout_seconds:
          type: integer
          format: int64
        retrieval:
          type: object
          description: >-
            The turn's retrieval controls; every key is written, `null` where
            the caller omitted it.
          required:
            - retrieval_only
            - pointers_only
            - chunks_only
            - artifacts_only
            - max_retrieved
            - max_retrieved_chars
            - compose
            - max_steps
            - thinking_level
          properties:
            retrieval_only:
              type: boolean
              nullable: true
            pointers_only:
              type: boolean
              nullable: true
            chunks_only:
              type: boolean
              nullable: true
            artifacts_only:
              type: boolean
              nullable: true
            max_retrieved:
              type: integer
              format: int64
              nullable: true
            max_retrieved_chars:
              type: integer
              format: int64
              nullable: true
            compose:
              type: boolean
              nullable: true
            max_steps:
              type: integer
              format: int64
              nullable: true
            thinking_level:
              type: string
              nullable: true
              x-enum:
                - minimal
                - low
                - medium
                - high
        comparison_group:
          type: string
          nullable: true
    CurateInput:
      type: object
      title: curate
      required:
        - trigger
        - force
        - scope
      properties:
        trigger:
          type: string
          description: e.g. manual / reconcile / restore / resume
        force:
          type: boolean
        scope:
          type: string
          description: e.g. full / reconcile / restore
        batch_size:
          type: integer
        models:
          type: array
          items:
            type: string
        legs:
          type: array
          items:
            type: string
          description: >-
            `["chunks"]` gates the run to the chunk + keyword indices, skipping
            artifact extraction
        artifacts_reset:
          type: boolean
        skip_corpus_aggregation:
          type: boolean
        claimed_version:
          type: integer
          format: int64
          description: The version a drained predecessor had claimed
    ImportInput:
      title: import
      description: >-
        One of three disjoint shapes, discriminated by which of `connector_id` /
        `url` / `raw_archive_key` is present.
      anyOf:
        - type: object
          title: Connector import
          required:
            - provider
            - connector_id
            - item_type
            - files
            - path
          properties:
            provider:
              type: string
            connector_id:
              type: string
            folder:
              type: string
              nullable: true
            item_type:
              type: string
              x-enum:
                - folder
                - file
            files:
              type: array
              items:
                type: string
            path:
              type: string
            preview:
              $ref: '#/components/schemas/PreviewLimits'
        - type: object
          title: Public-repo import
          required:
            - provider
            - url
            - path
          properties:
            provider:
              type: string
            url:
              type: string
            path:
              type: string
            preview:
              $ref: '#/components/schemas/PreviewLimits'
        - type: object
          title: Archive upload
          required:
            - raw_archive_key
            - path
          properties:
            raw_archive_key:
              type: string
              description: Staging key under the source bucket's `_inbox/` prefix
            path:
              type: string
            preview:
              $ref: '#/components/schemas/PreviewLimits'
    PackInput:
      type: object
      title: pack
      required:
        - include_traces
        - slug
        - context_id
      properties:
        include_traces:
          type: boolean
        slug:
          type: string
        context_id:
          type: string
    RestoreInput:
      type: object
      title: restore
      required:
        - pack_key
        - pack_filename
        - target_context_id
        - target_slug
        - target_name
      properties:
        pack_key:
          type: string
        pack_filename:
          type: string
        target_context_id:
          type: string
        target_slug:
          type: string
        target_name:
          type: string
    ExploreInput:
      type: object
      title: explore
      required:
        - guide
        - trigger
      properties:
        guide:
          type: string
        trigger:
          type: string
    ProfileInput:
      type: object
      title: profile
      required:
        - manifest
        - trigger
      properties:
        manifest:
          allOf:
            - $ref: '#/components/schemas/Manifest'
          description: The candidate manifest the run profiles, not a stored one.
        trigger:
          type: string
    OptimizeInput:
      type: object
      title: optimize
      description: Every field optional — an input with no keys is a valid no-op optimize.
      properties:
        candidate_queries:
          type: array
          items:
            $ref: '#/components/schemas/CandidateQuery'
        eval_pass_rate_threshold:
          type: number
          format: double
        retrieval_p90_latency_ms:
          type: integer
          format: int64
        optimize_timeout_seconds:
          type: integer
          format: int64
        max_tool_turns:
          type: integer
        max_iterations:
          type: integer
        models:
          type: array
          items:
            type: string
    GroomInput:
      type: object
      title: groom
      properties:
        budget:
          type: integer
        groom_timeout_seconds:
          type: integer
          format: int64
        models:
          type: array
          items:
            type: string
    SearchTurnCompletedOutput:
      type: object
      title: search / search_rag completed
      required:
        - status
        - query_id
        - answer
        - output_json
        - citations
        - latency_ms
      properties:
        status:
          type: string
        query_id:
          type: string
        answer:
          type: string
        output_json:
          type: object
          nullable: true
          additionalProperties: true
        citations:
          type: array
          items:
            type: string
        latency_ms:
          type: integer
          format: int64
    SearchCcTurnCompletedOutput:
      type: object
      title: search_cc completed
      required:
        - status
        - query_id
        - answer
        - citations
        - latency_ms
        - steps
      properties:
        status:
          type: string
        query_id:
          type: string
        answer:
          type: string
        citations:
          type: array
          items:
            type: string
        latency_ms:
          type: integer
          format: int64
        steps:
          type: integer
          format: int64
    SearchTurnFailedOutput:
      type: object
      title: search failed
      required:
        - status
        - query_id
        - error
      properties:
        status:
          type: string
        query_id:
          type: string
        error:
          type: string
    PackTaskOutput:
      type: object
      required:
        - state
      description: >-
        A pack task's output, discriminated by `state`. Fields are per-state;
        absent fields are omitted rather than nulled.
      properties:
        state:
          type: string
          x-enum:
            - running
            - completed
            - failed
            - unknown
        slug:
          type: string
        include_traces:
          type: boolean
        started_at:
          type: string
        completed_at:
          type: string
        enriching:
          type: boolean
        sources_total:
          type: integer
          format: int64
        knowledge_total:
          type: integer
          format: int64
        traces_total:
          type: integer
          format: int64
        files_written:
          type: integer
          format: int64
        bytes_collected:
          type: integer
          format: int64
        pack_filename:
          type: string
        pack_size:
          type: integer
          format: int64
        sources_files:
          type: integer
          format: int64
        knowledge_files:
          type: integer
          format: int64
        traces_included:
          type: boolean
        traces_files:
          type: integer
          format: int64
        corpus_groups_included:
          type: integer
          format: int64
        details:
          $ref: '#/components/schemas/PackDetails'
        error:
          type: string
    RestoreTaskOutput:
      type: object
      title: restore
      required:
        - state
      description: Progressive restore reports, discriminated by which fields are present.
      properties:
        state:
          type: string
        pack_filename:
          type: string
        pack_size:
          type: integer
          format: int64
        target_context_id:
          type: string
        target_slug:
          type: string
        stage_progress:
          type: object
          required:
            - phase
            - done
            - total
          properties:
            phase:
              type: string
            done:
              type: integer
              format: int64
            total:
              type: integer
              format: int64
        sources_count:
          type: integer
          format: int64
        knowledge_count:
          type: integer
          format: int64
        sources_staged:
          type: integer
          format: int64
        knowledge_staged:
          type: integer
          format: int64
        manifest_set:
          type: boolean
        corpus_groups_set:
          type: integer
          format: int64
        started_at:
          type: string
        completed_at:
          type: string
    OptimizeResultOutput:
      type: object
      title: optimize result
      required:
        - status
        - best_score
        - best_iteration
        - best_latency_ok
        - total_iterations
        - pass_rate_threshold
        - p90_latency_limit_ms
        - elapsed_seconds
        - usage
        - models
        - manifest
        - changed_legs
      properties:
        status:
          type: string
          description: >-
            `ready` only when the best iteration cleared both the pass-rate and
            latency bars
        best_score:
          type: number
          format: double
        best_iteration:
          type: integer
          format: int64
        best_latency_ok:
          type: boolean
        total_iterations:
          type: integer
          format: int64
        pass_rate_threshold:
          type: number
          format: double
        p90_latency_limit_ms:
          type: number
          format: double
          nullable: true
        elapsed_seconds:
          type: number
          format: double
        usage:
          $ref: '#/components/schemas/ChatUsage'
        models:
          type: object
          additionalProperties:
            type: string
          description: tier → resolved model id
        manifest:
          allOf:
            - $ref: '#/components/schemas/Manifest'
          description: >-
            The tuned manifest the orchestrator persists onto the context when
            the task completes.
        changed_legs:
          type: array
          items:
            type: string
    OptimizeNoopOutput:
      type: object
      title: optimize no-op
      required:
        - status
        - reason
        - candidate_queries
        - problems
      description: Too few candidate queries or problems to tune from.
      properties:
        status:
          type: string
        reason:
          type: string
        candidate_queries:
          type: integer
          format: int64
        problems:
          type: integer
          format: int64
    GroomMetricsOutput:
      type: object
      title: groom
      required:
        - status
        - budget
        - batches_staged
        - batches_consumed
        - facts_distilled
        - facts_added
        - facts_merged
        - facts_dropped_untyped
        - edges_added
        - artifacts_pruned
        - artifact_files_written
        - artifact_files_deleted
        - artifact_count
        - artifact_bytes
        - duration_ms
      properties:
        status:
          type: string
        budget:
          type: integer
          format: int64
        batches_staged:
          type: integer
          format: int64
        batches_consumed:
          type: integer
          format: int64
        facts_distilled:
          type: integer
          format: int64
        facts_added:
          type: integer
          format: int64
        facts_merged:
          type: integer
          format: int64
        facts_dropped_untyped:
          type: integer
          format: int64
        edges_added:
          type: integer
          format: int64
        artifacts_pruned:
          type: integer
          format: int64
        artifact_files_written:
          type: integer
          format: int64
        artifact_files_deleted:
          type: integer
          format: int64
        artifact_count:
          type: integer
          format: int64
        artifact_bytes:
          type: integer
          format: int64
        duration_ms:
          type: integer
          format: int64
    CurateRunOutput:
      type: object
      title: curate run
      required:
        - status
        - flipped
        - versioned
        - mode
        - scope
        - images_skipped_no_vision
        - usage
        - sample_queries
        - delta
      properties:
        status:
          type: string
        flipped:
          type: boolean
        versioned:
          type: boolean
        mode:
          type: string
          description: '`incremental` when the context has a manifest, `full` otherwise'
        scope:
          type: string
        images_skipped_no_vision:
          type: integer
          format: int64
        usage:
          $ref: '#/components/schemas/CurateUsage'
        sample_queries:
          type: array
          items:
            type: string
          description: Example questions the corpus can answer
        delta:
          type: object
          required:
            - new
            - changed
            - deleted
            - processed
            - failed
            - failed_sources
            - failed_sources_truncated
            - failed_sources_file
            - corpus_artifacts
            - corpus_edges
            - corpus_artifacts_screened
            - screened
            - chunks_created
            - chunks_updated
            - artifacts_created
            - artifacts_updated
            - chunks_screened
            - artifacts_screened
            - images_skipped_no_vision
            - artifacts_errored
            - sources_content_truncated
          properties:
            new:
              type: integer
              format: int64
            changed:
              type: integer
              format: int64
            deleted:
              type: integer
              format: int64
            processed:
              type: integer
              format: int64
            failed:
              type: integer
              format: int64
            failed_sources:
              type: array
              items:
                type: string
            failed_sources_truncated:
              type: boolean
              description: >-
                Whether failed_sources was capped and the full list spilled to a
                file
            failed_sources_file:
              type: string
              description: Where the full failed-sources list was written when truncated
            corpus_artifacts:
              type: integer
              format: int64
            corpus_edges:
              type: integer
              format: int64
            corpus_artifacts_screened:
              type: integer
              format: int64
            screened:
              type: integer
              format: int64
              description: Sum of the per-leg and corpus screen counts
            chunks_created:
              type: integer
              format: int64
            chunks_updated:
              type: integer
              format: int64
            artifacts_created:
              type: integer
              format: int64
            artifacts_updated:
              type: integer
              format: int64
            chunks_screened:
              type: integer
              format: int64
            artifacts_screened:
              type: integer
              format: int64
            images_skipped_no_vision:
              type: integer
              format: int64
            artifacts_errored:
              type: integer
              format: int64
            sources_content_truncated:
              type: integer
              format: int64
    CurateManifestTuneOutput:
      type: object
      title: curate manifest_tune
      required:
        - status
        - flipped
        - versioned
        - mode
        - usage
        - delta
      description: >-
        The post-optimize artifacts re-eval. Targets optimize trial namespaces,
        so `flipped` is always false and `mode` is always `manifest_tune`.
      properties:
        status:
          type: string
        flipped:
          type: boolean
          x-enum:
            - false
        versioned:
          type: boolean
        mode:
          type: string
          x-enum:
            - manifest_tune
        usage:
          $ref: '#/components/schemas/CurateUsage'
        delta:
          type: object
          required:
            - artifacts_reevaluated
            - failed
            - failed_sources
            - failed_sources_truncated
            - failed_sources_file
            - corpus_artifacts
            - corpus_edges
            - chunks_created
            - chunks_updated
            - artifacts_created
            - artifacts_updated
            - chunks_screened
            - artifacts_screened
            - images_skipped_no_vision
            - artifacts_errored
            - sources_content_truncated
          properties:
            artifacts_reevaluated:
              type: integer
              format: int64
            failed:
              type: integer
              format: int64
            failed_sources:
              type: array
              items:
                type: string
            failed_sources_truncated:
              type: boolean
            failed_sources_file:
              type: string
            corpus_artifacts:
              type: integer
              format: int64
            corpus_edges:
              type: integer
              format: int64
            chunks_created:
              type: integer
              format: int64
            chunks_updated:
              type: integer
              format: int64
            artifacts_created:
              type: integer
              format: int64
            artifacts_updated:
              type: integer
              format: int64
            chunks_screened:
              type: integer
              format: int64
            artifacts_screened:
              type: integer
              format: int64
            images_skipped_no_vision:
              type: integer
              format: int64
            artifacts_errored:
              type: integer
              format: int64
            sources_content_truncated:
              type: integer
              format: int64
    CurateNoopOutput:
      type: object
      title: curate no-op
      required:
        - status
        - flipped
        - versioned
        - mode
        - scope
        - delta
      description: >-
        Nothing changed since the last run; `delta` is the literal string
        `empty`.
      properties:
        status:
          type: string
        flipped:
          type: boolean
        versioned:
          type: boolean
        mode:
          type: string
        scope:
          type: string
        delta:
          type: string
          x-enum:
            - empty
    ExploreOutput:
      type: object
      title: explore
      required:
        - status
        - matches
        - none
        - guide
        - models
        - usage
      properties:
        status:
          type: string
        matches:
          type: array
          description: >-
            Validated template recommendations; unknown or low-confidence
            proposals are dropped upstream.
          items:
            $ref: '#/components/schemas/TemplateMatch'
        none:
          type: boolean
          description: True when no template fit
        guide:
          type: string
        models:
          type: object
          additionalProperties:
            type: string
          description: tier → resolved model id
        usage:
          $ref: '#/components/schemas/ChatUsage'
    ProfileEstimateOutput:
      type: object
      title: profile estimate
      required:
        - state
        - g
        - density
        - cost
        - sampling
      properties:
        state:
          type: string
        g:
          type: object
          required:
            - value
            - lo
            - hi
            - method
            - recurrence
            - confidence
            - note
          description: Estimated distinct-artifact count with its uncertainty band.
          properties:
            value:
              type: integer
              format: int64
            lo:
              type: integer
              format: int64
            hi:
              type: integer
              format: int64
            method:
              type: string
              description: >-
                The estimator the recurrence blend selected; `empty` on the
                no-sample path
            recurrence:
              type: number
              format: double
            confidence:
              type: string
            note:
              type: string
        density:
          type: object
          required:
            - entities_per_doc
            - avg_doc_chars
          description: Measured on the sampling window, not the full curate read-depth.
          properties:
            entities_per_doc:
              type: number
              format: double
            avg_doc_chars:
              type: integer
              format: int64
        cost:
          type: object
          required:
            - by_tier
            - default_tier
          properties:
            by_tier:
              type: object
              required:
                - lite
                - standard
                - pro
              properties:
                lite:
                  $ref: '#/components/schemas/ProfileTierCost'
                standard:
                  $ref: '#/components/schemas/ProfileTierCost'
                pro:
                  $ref: '#/components/schemas/ProfileTierCost'
            default_tier:
              type: string
              description: The tier the context's current `artifact_model` resolves to
        sampling:
          type: object
          required:
            - n_total
            - n_sampled
            - fraction
            - wall_s
          description: How much of the corpus the profile actually read.
          properties:
            n_total:
              type: integer
              format: int64
            n_sampled:
              type: integer
              format: int64
            fraction:
              type: number
              format: double
            wall_s:
              type: number
              format: double
    ProfileEmptyOutput:
      type: object
      title: profile empty
      required:
        - state
        - reason
      properties:
        state:
          type: string
        reason:
          type: string
    ImportOutput:
      type: object
      title: import
      required:
        - status
        - imported_items
        - output_files
        - failed
        - skipped
        - skipped_items
        - manifest_sample
        - manifest_truncated
        - manifest_file
      properties:
        status:
          type: string
        imported_items:
          type: integer
          format: int64
        output_files:
          type: integer
          format: int64
        failed:
          type: integer
          format: int64
        skipped:
          type: integer
          format: int64
        skipped_items:
          type: array
          description: Bounded sample of the skipped records
          items:
            $ref: '#/components/schemas/ImportManifestEntry'
        manifest_sample:
          type: array
          description: Bounded sample of the records that produced output
          items:
            $ref: '#/components/schemas/ImportManifestEntry'
        manifest_truncated:
          type: boolean
          description: Whether either sample was cut
        manifest_file:
          type: string
          description: Where the full manifest was written
        manifest_object:
          type: string
          description: Object-store key of the full manifest
    StatusErrorOutput:
      type: object
      title: status-keyed failure
      required:
        - status
        - error
      description: >-
        The groom / curate terminal-failure convention — best-effort forensics
        on a task deliberately left Running so the orchestrator can resume it.
      properties:
        status:
          type: string
        error:
          type: string
    StateFailedOutput:
      type: object
      title: state-keyed failure
      required:
        - state
        - error
      description: The pack / restore terminal-failure convention.
      properties:
        state:
          type: string
        error:
          type: string
    PreviewLimits:
      type: object
      required:
        - allow_archives
        - allowed_extensions
        - remaining_files
        - remaining_bytes
      description: >-
        Preview-mode import caps grafted onto the input; absent outside preview
        mode.
      properties:
        allow_archives:
          type: boolean
        allowed_extensions:
          type: array
          items:
            type: string
        remaining_files:
          type: integer
          format: int64
        remaining_bytes:
          type: integer
          format: int64
    Manifest:
      type: object
      description: >-
        The context manifest that drives curate and search. A sparse document —
        every field is optional and an omitted key falls back to the validator
        default, so absent fields are omitted rather than nulled. Value
        constraints are enforced by the write-side validator.
      properties:
        curate:
          $ref: '#/components/schemas/CurateManifest'
        optimize:
          $ref: '#/components/schemas/OptimizeManifest'
    CandidateQuery:
      type: object
      required:
        - ask
      description: A query the optimize run tunes toward.
      properties:
        ask:
          type: string
        answer:
          type: string
          description: Used as eval ground truth
        fallback_to_chunks:
          type: boolean
        latency_ms:
          type: number
          format: double
    PackDetails:
      type: object
      description: Publisher-facing pack enrichment.
      properties:
        description:
          type: string
        sample_queries:
          type: array
          items:
            type: string
    ChatUsage:
      type: object
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
        - by_model
        - cache_read_tokens
        - cache_write_tokens
      description: >-
        The chat-seam token rollup reported by the inference client, which
        carries the cache-token fields. Used by optimize and explore.
      properties:
        prompt_tokens:
          type: integer
          format: int64
        completion_tokens:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
        by_model:
          type: object
          description: >-
            Keyed by the model the proxy actually dispatched to, so tier
            fallbacks are visible.
          additionalProperties:
            $ref: '#/components/schemas/ModelUsage'
        cache_read_tokens:
          type: integer
          format: int64
        cache_write_tokens:
          type: integer
          format: int64
    CurateUsage:
      type: object
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
        - by_model
        - embed_by_model
      description: >-
        Curate's token rollup: the chat-seam totals plus the embed/rerank seam
        (`embed_by_model`). It does not carry the cache-token fields.
      properties:
        prompt_tokens:
          type: integer
          format: int64
        completion_tokens:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
        by_model:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ModelUsage'
        embed_by_model:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SeamUsage'
    TemplateMatch:
      type: object
      required:
        - template_id
        - rationale
        - confidence
      properties:
        template_id:
          type: string
        rationale:
          type: string
        confidence:
          type: number
          format: double
    ProfileTierCost:
      type: object
      required:
        - tokens
        - time_s
      properties:
        tokens:
          type: object
          required:
            - point
            - lo
            - hi
            - input
            - output
          description: >-
            `point` is the estimate at G's midpoint and splits into
            input/output; `lo`/`hi` are band totals.
          properties:
            point:
              type: integer
              format: int64
            lo:
              type: integer
              format: int64
            hi:
              type: integer
              format: int64
            input:
              type: integer
              format: int64
            output:
              type: integer
              format: int64
        time_s:
          type: object
          required:
            - lo
            - hi
          properties:
            lo:
              type: integer
              format: int64
            hi:
              type: integer
              format: int64
    ImportManifestEntry:
      type: object
      required:
        - src
        - action
        - out
        - fmt
        - reason
        - bytes
      description: One ingest record.
      properties:
        src:
          type: string
        action:
          type: string
          x-enum:
            - parsed
            - copied
            - extracted
            - skipped
            - failed
        out:
          type: array
          items:
            type: string
          description: Empty exactly when nothing was written
        fmt:
          type: string
        reason:
          type: string
        bytes:
          type: integer
          format: int64
    CurateManifest:
      type: object
      properties:
        chunks:
          $ref: '#/components/schemas/ChunksConfig'
        artifacts:
          $ref: '#/components/schemas/ArtifactsConfig'
    OptimizeManifest:
      type: object
      description: Scheduled self-tuning config.
      properties:
        schedule:
          type: string
          maxLength: 128
          default: 0 * * * *
          description: cron
        latency_threshold_ms:
          type: integer
          minimum: 0
          maximum: 600000
          default: 60000
        min_group_size:
          type: integer
          minimum: 1
          maximum: 100
          default: 2
        eval_pass_rate_threshold:
          type: number
          format: double
          minimum: 0
          maximum: 1
          default: 1
        max_iterations:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
    ModelUsage:
      type: object
      required:
        - tier
        - prompt_tokens
        - completion_tokens
        - cache_read_tokens
        - cache_write_tokens
        - total_tokens
      description: Per-model chat-seam counts; both usage roll-ups write every key.
      properties:
        tier:
          type: string
        prompt_tokens:
          type: integer
          format: int64
        completion_tokens:
          type: integer
          format: int64
        cache_read_tokens:
          type: integer
          format: int64
        cache_write_tokens:
          type: integer
          format: int64
        total_tokens:
          type: integer
          format: int64
    SeamUsage:
      type: object
      required:
        - kind
        - tier
        - embed_tokens
        - rerank_units
      description: >-
        Per-model embed/rerank-seam counts: billed per token (embed) or per
        request (rerank).
      properties:
        kind:
          type: string
        tier:
          type: string
        embed_tokens:
          type: integer
          format: int64
        rerank_units:
          type: integer
          format: int64
    ChunksConfig:
      type: object
      description: Source chunking + embedding config.
      properties:
        enabled:
          type: boolean
          default: true
        embedding_model:
          type: string
          maxLength: 128
          default: multilingual-e5-large
        chunking:
          $ref: '#/components/schemas/ChunkingConfig'
        keyword:
          type: object
          properties:
            enabled:
              type: boolean
              default: true
    ArtifactsConfig:
      type: object
      description: Knowledge-artifact extraction config.
      properties:
        enabled:
          type: boolean
          default: false
        artifact_model:
          type: string
          x-enum:
            - standard
            - lite
          default: lite
        artifact_types:
          type: array
          maxItems: 32
          items:
            $ref: '#/components/schemas/ArtifactType'
        edge_types:
          type: array
          maxItems: 32
          items:
            $ref: '#/components/schemas/EdgeType'
        min_doc_count:
          type: integer
          minimum: 1
          maximum: 64
          default: 1
        max_tokens:
          type: integer
          minimum: 128
          maximum: 8192
          default: 1500
        max_doc_chars:
          type: integer
          minimum: 1000
          maximum: 2000000
          default: 60000
        extraction_window_chars:
          type: integer
          minimum: 0
          maximum: 1000000
          default: 0
        mention_max_chars:
          type: integer
          minimum: 100
          maximum: 4000
          default: 400
        max_mentions_per_artifact:
          type: integer
          minimum: 1
          maximum: 500
          default: 40
        mention_context_chars:
          type: integer
          minimum: 1000
          maximum: 100000
          default: 8000
        max_artifacts_per_type:
          type: integer
          minimum: 1
          maximum: 10000
          default: 10000
    ChunkingConfig:
      type: object
      properties:
        strategy:
          type: string
          x-enum:
            - markdown_heading
            - sliding_window
            - html
            - csv
            - code
          default: markdown_heading
        target_size:
          type: integer
          minimum: 64
          maximum: 4096
          default: 512
        overlap:
          type: integer
          minimum: 0
          maximum: 1024
          default: 64
        respect_sections:
          type: boolean
          default: true
    ArtifactType:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 64
        kind:
          type: string
          x-enum:
            - summary
            - topic
            - entity
            - event
            - doc
            - page
            - glossary
          default: topic
        scope:
          type: string
          x-enum:
            - document
            - corpus
          default: corpus
        icon:
          type: string
        description:
          type: string
        coverage:
          type: array
          maxItems: 32
          items:
            type: string
            maxLength: 128
        sections:
          type: array
          maxItems: 64
          items:
            type: string
            maxLength: 128
        min_doc_count:
          type: integer
          minimum: 1
          maximum: 64
          default: 1
        format:
          type: string
          x-enum:
            - markdown
            - sqlite
          default: markdown
        columns:
          type: array
          maxItems: 64
          description: sqlite-format artifacts only
          items:
            type: object
            required:
              - name
            properties:
              name:
                type: string
                maxLength: 64
              type:
                type: string
                x-enum:
                  - TEXT
                  - INTEGER
                  - REAL
                  - NUMERIC
                default: TEXT
              description:
                type: string
        natural_key:
          type: array
          maxItems: 16
          items:
            type: string
            maxLength: 64
    EdgeType:
      type: object
      required:
        - name
        - from
        - to
      properties:
        name:
          type: string
          maxLength: 64
        from:
          type: string
          maxLength: 64
          description: Source artifact-type name
        to:
          type: string
          maxLength: 64
          description: Target artifact-type name
        description:
          type: string
        attributes:
          type: array
          maxItems: 16
          items:
            type: string
            maxLength: 64
  responses:
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Session token from POST /auth/login. Pass as `Authorization: Bearer
        <token>`. The alternative `X-Pinecone-Api-Key` header is also accepted
        for direct-key auth (used by the Nexus CLI on first contact).
    apiKey:
      type: apiKey
      in: header
      name: X-Pinecone-Api-Key
      description: Pinecone API key, accepted as an alternative to the bearer JWT.

````