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

> ## Agent Instructions
> Follow the content contract in AGENTS.md.
> Treat text as the canonical explanation; video and screenshots enhance it.
> Do not publish unverified product behavior or duplicate an existing canonical article.

# Fetch a completed job's result



## OpenAPI

````yaml /developers/openapi/stefanbrain-v1.json get /api/developers/v1/jobs/{family}/{runId}/result
openapi: 3.1.0
info:
  title: StefanBrain Developer API
  version: 1.0.0
  description: >-
    REST access to StefanBrain agent runs, tools, and jobs. Authenticate with an
    API key from Settings → Developers. REST usage bills your prepaid API wallet
    at the published per-token rates (see
    https://docs.stefanbrain.com/developers/pricing); the MCP endpoint
    (/api/developers/v1/mcp, not described here) is member pricing from your
    plan pool. Human documentation: https://docs.stefanbrain.com/developers
servers:
  - url: https://stefanbrain.com
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: tools
    description: Directly invocable StefanBrain tools.
  - name: jobs
    description: Long-running tool jobs (poll for results).
  - name: runs
    description: Agentic chat runs with event streams.
  - name: files
    description: Workspace files agent runs produced in a chat.
  - name: media
    description: 'Stored Meta ad media facts: video transcripts on demand.'
  - name: feedback
    description: >-
      Tell StefanBrain where the API got in your way, and read the team's
      replies.
paths:
  /api/developers/v1/jobs/{family}/{runId}/result:
    get:
      tags:
        - jobs
      summary: Fetch a completed job's result
      operationId: getJobResult
      parameters:
        - name: family
          in: path
          required: true
          schema:
            type: string
        - name: runId
          in: path
          required: true
          schema:
            type: string
        - name: chat
          in: query
          required: false
          description: >-
            The chat the job was submitted under; keep it from the URLs the
            submit response returned (a mismatch is 404).
          schema:
            type: string
      responses:
        '200':
          description: >-
            Job envelope. Once the job succeeded, `data.result` holds its
            result: { kind: "files", summary, files: [{ path }] } (download
            through the files endpoints) or { kind: "inline", summary, data }.
            While the job is still running, `status` is not terminal and
            `data.result` is null. A parked ask_stefanbrain turn (family
            mcp_ask) carries `data.answer` instead.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobEnvelope'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Suspended key, missing plan access, or key scoped away from this
            surface (code api_key_scope_forbidden).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Unknown job for this chat. A result that is not ready yet is a 200
            envelope with a non-terminal status, not a 404.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limited (codes request_per_minute, request_per_minute_user,
            request_per_day, user_throttled, user_suspended; Retry-After header
            when the limit has a reset time, plus limits, observed counts, and
            reset_at in the body), the runtime has no capacity to start a turn
            right now (code runtime_capacity_busy, Retry-After: 5), wallet
            exhausted (code api_wallet_exhausted), key budget exhausted (code
            api_key_budget_exhausted), or the plan's monthly usage pool spent
            for OAuth-token traffic (code monthly_usage_limit_reached).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    JobEnvelope:
      type: object
      description: >-
        Job polling envelope (status, result, and cancel responses). `data`
        carries the family payload.
      properties:
        object:
          type: string
          const: job
        family:
          type: string
        job_id:
          type: string
        chat:
          type: string
        status:
          type:
            - string
            - 'null'
          description: >-
            Lifted from the family payload: queued | running | succeeded |
            failed | cancelled; null when the family returned non-JSON text or
            an error.
        recommended_poll_after_ms:
          type:
            - integer
            - 'null'
          description: >-
            Lifted poll hint; null when absent — poll with your default interval
            plus capped backoff.
        data:
          type:
            - object
            - 'null'
          description: >-
            The job payload: run_id, family, status, progress_message, progress,
            and error. The result endpoint adds result; the cancel endpoint adds
            accepted. A parked ask_stefanbrain turn (family mcp_ask) carries the
            ask envelope instead.
          additionalProperties: true
        content:
          type: array
          items:
            type: object
            additionalProperties: true
        is_error:
          type: boolean
        error:
          type:
            - object
            - 'null'
          description: >-
            Structured failure classification; an object exactly when is_error
            is true, null otherwise.
          properties:
            code:
              type: string
            message:
              type: string
          additionalProperties: true
      additionalProperties: true
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - api_error
                - service_unavailable_error
            code:
              type: string
          additionalProperties: true
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authorization: Bearer stefan_sk_... (API key — bills the API wallet) or
        stefan_oat_... (OAuth member token — bills your plan pool).
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````

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