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

# Create research

> Accept a research question. A new run returns 202 and reserves the panel price. The same Idempotency-Key with the same prompt and panel returns 200 for 24 hours, sets Idempotent-Replayed: true, and does not reserve credits again.



## OpenAPI

````yaml https://seneca-research.fly.dev/v1/openapi.json post /v1/research
openapi: 3.1.0
info:
  title: Seneca Research API
  version: 0.1.0
  description: >-
    Create a research run, poll it, then read the customer report. Original
    model text is a separate read: list /v1/research/{run_id}/responses, read
    one model at /v1/research/{run_id}/responses/text, or download the panel as
    JSONL from /v1/research/{run_id}/responses/export. Send Authorization:
    Bearer seneca_sk_… Narrative quickstart:
    https://seneca.professionalaiagents.com/api.md
servers:
  - url: https://seneca-research.fly.dev
    description: Production
security: []
paths:
  /v1/research:
    post:
      tags:
        - public-api
      summary: Create research
      description: >-
        Accept a research question. A new run returns 202 and reserves the panel
        price. The same Idempotency-Key with the same prompt and panel returns
        200 for 24 hours, sets Idempotent-Replayed: true, and does not reserve
        credits again.
      operationId: create_research_v1_research_post
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 255
            pattern: ^[A-Za-z0-9._:-]{1,255}$
            description: >-
              Required. 1–255 characters: letters, numbers, or . _ : -. Reuse
              this exact value, with the same prompt and panel, to retry a
              request whose response was lost. A different prompt or panel with
              this value returns 409 idempotency_conflict. The key expires after
              24 hours.
          description: >-
            Required. 1–255 characters: letters, numbers, or . _ : -. Reuse this
            exact value, with the same prompt and panel, to retry a request
            whose response was lost. A different prompt or panel with this value
            returns 409 idempotency_conflict. The key expires after 24 hours.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicResearchCreate'
      responses:
        '200':
          description: >-
            Idempotent replay of the original run. The response header
            Idempotent-Replayed is true. No second run is created and no second
            reserve is written.
          headers:
            Idempotent-Replayed:
              description: true when this response replays an existing run.
              schema:
                type: string
                const: 'true'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicRunOut'
        '202':
          description: >-
            Research accepted. Store id and poll GET /v1/research/{id} until
            status is completed, partial, or failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicRunOut'
        '400':
          description: >-
            invalid_request, idempotency_key_required, invalid_idempotency_key,
            or quick_pulse_unavailable. A malformed body is invalid_request and
            does not reserve credits. quick_pulse_unavailable rejects a new
            Quick Pulse launch and does not reserve credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
        '401':
          description: >-
            authentication_required when the bearer token is missing or not a
            bearer token. invalid_api_key when the key is unknown, revoked, or
            expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
        '402':
          description: >-
            insufficient_credits or subscription_required. insufficient_credits
            includes details.required and details.available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
        '409':
          description: >-
            idempotency_conflict when Idempotency-Key is reused with a different
            prompt or panel. concurrency_limit_reached when the workspace
            already has the maximum number of runs in progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
        '429':
          description: >-
            rate_limit_exceeded. Creates are limited to 30 requests per minute
            per workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
        '500':
          description: internal_error. The body does not include a traceback or a secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicErrorResponse'
      security:
        - SenecaApiKey: []
components:
  schemas:
    PublicResearchCreate:
      properties:
        prompt:
          type: string
          title: Prompt
          description: The research question. The server trims surrounding whitespace.
        panel:
          type: string
          title: Panel
          description: >-
            Research depth. Canonical ids and server-owned prices: wide (15
            credits, 10 curated models), consensus (45 credits, 40 curated
            models), seneca (100 credits, every production-eligible model). The
            server chooses the models. Extra fields, including a model list, are
            rejected.
      additionalProperties: false
      type: object
      required:
        - prompt
        - panel
      title: PublicResearchCreate
    PublicRunOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        object:
          type: string
          const: research.run
          title: Object
          default: research.run
        status:
          type: string
          title: Status
          description: queued, running, synthesizing, completed, partial, or failed.
        phase:
          anyOf:
            - type: string
            - type: 'null'
          title: Phase
          description: >-
            panel while models are still answering. Null while synthesizing or
            after the run finishes.
        source:
          anyOf:
            - type: string
            - type: 'null'
          title: Source
        panel:
          anyOf:
            - type: string
            - type: 'null'
          title: Panel
          description: >-
            Canonical panel id: wide, consensus, or seneca. A stored Quick Pulse
            run still reports quick_pulse.
        prompt:
          type: string
          title: Prompt
        credits_reserved:
          type: integer
          title: Credits Reserved
          description: >-
            Credits reserved when the run was accepted. This is the panel price
            and does not change if the run is later refunded.
        credits_charged:
          anyOf:
            - type: integer
            - type: 'null'
          title: Credits Charged
          description: >-
            Null while the run is in progress. Equal to credits_reserved when a
            customer report is delivered, including a partial run that has a
            report. 0 after a verified technical failure with no customer
            report; that refund restores the reserve. failure_code does not
            change between a charged failure and a refunded one.
        failure_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Failure Code
          description: research_failed when status is failed. Null otherwise.
        created_at:
          type: string
          format: date-time
          title: Created At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        progress:
          $ref: '#/components/schemas/PublicProgressOut'
      additionalProperties: false
      type: object
      required:
        - id
        - status
        - prompt
        - credits_reserved
        - created_at
        - progress
      title: PublicRunOut
    PublicErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/PublicErrorObject'
      additionalProperties: false
      type: object
      required:
        - error
      title: PublicErrorResponse
      description: Error envelope returned by every /v1 failure. Documentation model only.
    PublicProgressOut:
      properties:
        total_models:
          type: integer
          title: Total Models
        completed_models:
          type: integer
          title: Completed Models
        successful_models:
          type: integer
          title: Successful Models
        failed_models:
          type: integer
          title: Failed Models
      additionalProperties: false
      type: object
      required:
        - total_models
        - completed_models
        - successful_models
        - failed_models
      title: PublicProgressOut
    PublicErrorObject:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        details:
          additionalProperties: true
          type: object
          title: Details
      additionalProperties: false
      type: object
      required:
        - code
        - message
      title: PublicErrorObject
  securitySchemes:
    SenecaApiKey:
      type: http
      description: >-
        Workspace API key created while signed in on the Developers page. Send
        Authorization: Bearer seneca_sk_… A Clerk session token is not accepted.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.