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

# Get a Completion by Job ID

> Fetch the stored result of a past completion by the job_id its response returned, or of a past /v1/agent/batch/completions call by its batch_id. Returns 404 when no completion with that id belongs to any API key on the caller's account, and 503 when the lookup fails and can be retried.



## OpenAPI

````yaml https://api.swarms.world/openapi.json get /v1/job/{job_id}
openapi: 3.1.0
info:
  title: Swarms API
  description: >-
    Swarms API provides scalable, secure orchestration for multi-agent systems.
    Access robust endpoints for managing agents and swarms, automating
    workflows, and monitoring execution. Requires an API key—see the [API Keys
    page](https://swarms.world/platform/api-keys). Refer to [Swarms API
    Documentation](https://docs.swarms.ai) for guides and details.
  version: 1.0.0
servers:
  - url: https://api.swarms.world
    description: Swarms Production API
security: []
paths:
  /v1/job/{job_id}:
    get:
      tags:
        - Logging
        - Results
        - Completions
        - Jobs
        - Job Retrieval
        - History
        - Data Access
      summary: Get a Completion by Job ID
      description: >-
        Fetch the stored result of a past completion by the job_id its response
        returned, or of a past /v1/agent/batch/completions call by its batch_id.
        Returns 404 when no completion with that id belongs to any API key on
        the caller's account, and 503 when the lookup fails and can be retried.
      operationId: get_job_v1_job__job_id__get
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9_-]+$
            title: Job Id
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
            title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResultOutput'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    JobResultOutput:
      properties:
        job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Job Id
          description: >-
            The job_id the completion response returned. Absent on
            /v1/agent/batch/completions results, which carry `batch_id` instead.
        batch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Batch Id
          description: >-
            The batch_id a /v1/agent/batch/completions response returned.
            Present only on batch results.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: >-
            The run's status, e.g. 'success'. Absent on /v1/agent/completions
            results, which report `success` instead.
        usage:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Usage
          description: >-
            Token counts and the cost charged for the run, as the original
            response reported them.
        timestamp:
          anyOf:
            - type: string
            - type: 'null'
          title: Timestamp
          description: >-
            When the run finished, in ISO 8601. Absent on /v1/swarm/completions
            results.
      additionalProperties: true
      type: object
      title: JobResultOutput
      description: |-
        A past completion's stored response body, exactly as its endpoint
        returned it. Fields beyond those below depend on that endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

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