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

# Get Model Prediction

> Retrieve the status and results of a model prediction by its ID.

Prediction statuses are `starting` or `processing` while work is in flight.
Terminal statuses are `success`, `failed`, and `cancelled`.




## OpenAPI

````yaml /openapi_specs/models.json get /v1/prediction/{id}
openapi: 3.0.3
info:
  title: each::labs Official API v1
  description: >
    Official each::labs API V1.

    This API provides access to our comprehensive AI model catalog and other
    resources.


    ## Public contract notes


    - Public API routes handled by request logging include `X-Request-Id` for
      support and log correlation. Clients may send `X-Request-Id`; otherwise
      api-service generates one. Root, health, and metrics endpoints are excluded.
    - REST error bodies keep the backward-compatible JSON shape used by existing
      clients. Most errors include at least `error`; some shared error paths also
      include `status` and `details`. Use the HTTP status code as the primary
      programmatic signal unless an endpoint documents a richer envelope.
    - Rate-limit and retry headers are endpoint-dependent. If a response
    includes
      `Retry-After`, honor it before retrying; otherwise use bounded exponential
      backoff for retryable 429/5xx responses.
    - api-service exposes single workflow trigger through
      `/v1/workflows/trigger/{workflowID}/{versionID}`. Bulk workflow trigger is
      not routed through api-service; use the workflows-engine public API directly
      where bulk trigger is required.
  version: 1.0.0
  contact:
    name: API Support
    email: support@eachlabs.ai
  x-logo:
    url: ./logo-white.svg
    altText: each::labs
servers:
  - url: https://api.eachlabs.ai
    description: Production server
security: []
tags:
  - name: AI Models
    description: Endpoints for listing and retrieving AI models and other resources.
  - name: AI Models Prediction
    description: Endpoints for managing model predictions
  - name: Uploads
    description: Endpoints for uploading files that can be used as model inputs.
  - name: Executions
    description: Endpoints for listing execution history.
  - name: Workflows
    description: Endpoints for triggering workflow executions through api-service.
  - name: OpenAI Compatibility
    description: OpenAI-compatible endpoints for LLM Router requests.
  - name: Webhooks
    description: >
      Endpoints for retrieving webhook information and delivery history.


      **Note:** Currently, webhooks are only supported for Workflows V2. We are
      actively expanding webhook support to other services and will update this
      documentation as new integrations become available.
paths:
  /v1/prediction/{id}:
    get:
      tags:
        - AI Models Prediction
      summary: Get Model Prediction
      description: >
        Retrieve the status and results of a model prediction by its ID.


        Prediction statuses are `starting` or `processing` while work is in
        flight.

        Terminal statuses are `success`, `failed`, and `cancelled`.
      operationId: getPrediction
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Prediction ID
          example: abc123-def456-ghi789
      responses:
        '200':
          description: Prediction retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prediction'
              example:
                id: abc123-def456-ghi789
                input:
                  prompt: A beautiful sunset over the ocean with vibrant colors
                  aspect_ratio: '16:9'
                status: success
                output: https://storage.example.com/predictions/abc123/image.jpg
                logs: null
                metrics:
                  predict_time: 12.5
                  cost: 0.05
                urls:
                  cancel: >-
                    https://api.eachlabs.ai/v1/prediction/abc123-def456-ghi789/cancel
                  get: https://api.eachlabs.ai/v1/prediction/abc123-def456-ghi789
        '404':
          description: Prediction not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Prediction not found
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Prediction:
      type: object
      properties:
        id:
          type: string
          description: Unique prediction identifier
          example: abc123-def456-ghi789
        input:
          type: object
          description: Input parameters used for the prediction
          additionalProperties: true
          example:
            prompt: A beautiful sunset over the ocean with vibrant colors
            aspect_ratio: '16:9'
        status:
          type: string
          description: |
            Current status of the prediction. `starting` and `processing` are
            non-terminal. `success`, `failed`, and `cancelled` are terminal.
          enum:
            - starting
            - processing
            - success
            - failed
            - cancelled
          example: success
        output:
          description: Prediction output (type varies based on model)
          oneOf:
            - type: string
            - type: array
            - type: object
          example: https://storage.example.com/predictions/abc123/image.jpg
        logs:
          type: string
          nullable: true
          description: Execution logs from the prediction
          example: null
        metrics:
          type: object
          description: Performance and cost metrics
          properties:
            predict_time:
              type: number
              description: Time taken for prediction in seconds
              example: 12.5
            cost:
              type: number
              description: Cost of the prediction in USD
              example: 0.05
        urls:
          type: object
          description: Related API endpoints
          properties:
            cancel:
              type: string
              format: uri
              description: URL to cancel the prediction
              example: >-
                https://api.eachlabs.ai/v1/prediction/abc123-def456-ghi789/cancel
            get:
              type: string
              format: uri
              description: URL to get the prediction
              example: https://api.eachlabs.ai/v1/prediction/abc123-def456-ghi789
    Error:
      type: object
      description: >
        Backward-compatible REST error body. Endpoint-specific handlers may
        return only

        `error`; shared error paths may also include `status` and `details`.
      properties:
        status:
          type: integer
          description: HTTP status code, when returned by the shared error handler.
          example: 400
        error:
          type: string
          description: Safe user-facing error message.
          example: error message
        details:
          nullable: true
          description: Optional validation or request details for client errors.
      required:
        - error
  responses:
    InternalServerError:
      description: Internal server error
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'Failed to fetch models: internal error'
  headers:
    RequestId:
      description: >-
        Request correlation ID. Echoes the incoming `X-Request-Id` header or a
        generated ID.
      schema:
        type: string
      example: 123e4567-e89b-12d3-a456-426614174000
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````