Glio Jobs API

Job creation and status management

OpenAPI Specification

glio-jobs-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Glio Jobs API
  description: Multi-provider AI media generation API with unified interface.
  version: 1.0.0
servers:
- url: https://api.glio.io
  description: Glio API
security:
- BearerAuth: []
tags:
- name: Jobs
  description: Job creation and status management
paths:
  /v1/jobs:
    post:
      operationId: createJob
      summary: Create a new job
      description: 'Submit a job for AI media generation. Returns 202 Accepted with job details.


        **Note:** Either `model` or `parent_job_id` is required. Chain actions (extend, upscale, vary) can inherit model from parent job.'
      tags:
      - Jobs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Either `model` or `parent_job_id` is required.
              anyOf:
              - required:
                - model
              - required:
                - parent_job_id
              properties:
                model:
                  type: string
                  enum:
                  - bytedance-seedream
                  - bytedance-seedream-v4-edit
                  - bytedance-seedream-v4-text-to-image
                  - claude-opus-4-6
                  - claude-opus-4-7
                  - claude-opus-4-8
                  - claude-sonnet-4-6
                  - elevenlabs-sfx
                  - elevenlabs-tts-multilingual
                  - elevenlabs-tts-turbo
                  - flux-2-flex-i2i
                  - flux-2-flex-t2i
                  - flux-2-pro-i2i
                  - flux-2-pro-t2i
                  - google-imagen4
                  - gpt-image-1.5-i2i
                  - gpt-image-1.5-t2i
                  - gpt-image-2-i2i
                  - gpt-image-2-t2i
                  - grok-imagine-i2i
                  - grok-imagine-i2v
                  - grok-imagine-t2i
                  - grok-imagine-t2v
                  - hailuo-02-pro-i2v
                  - hailuo-02-pro-t2v
                  - hailuo-02-standard-i2v
                  - hailuo-02-standard-t2v
                  - hailuo-2.3-pro-i2v
                  - hailuo-2.3-standard-i2v
                  - happyhorse-1-0-i2v
                  - happyhorse-1-0-r2v
                  - happyhorse-1-0-t2v
                  - happyhorse-1-0-v2v-edit
                  - ideogram-character
                  - ideogram-character-edit
                  - ideogram-character-remix
                  - ideogram-v3-reframe
                  - kling-3.0
                  - kling-3.0-motion-control
                  - kling-avatar-pro
                  - kling-avatar-standard
                  - kling-v2.1-master-i2v
                  - kling-v2.1-master-t2v
                  - kling-v2.1-pro-i2v
                  - kling-v2.1-standard-i2v
                  - kling-v2.5-turbo-i2v
                  - kling-v2.5-turbo-t2v
                  - kling-v2.6-motion-control
                  - kling-v2.6-pro-i2v
                  - kling-v2.6-pro-t2v
                  - ltxv-2
                  - ltxv-2-fast
                  - luma-ray2-v2v
                  - nano-banana-2-i2i
                  - nano-banana-2-t2i
                  - nano-banana-pro-i2i
                  - nano-banana-pro-t2i
                  - qwen-i2i
                  - qwen-image-edit
                  - qwen-t2i
                  - qwen2-image-edit
                  - qwen2-t2i
                  - recraft-crisp-upscale
                  - recraft-remove-background
                  - runway-i2v
                  - runway-t2v
                  - seedance-2
                  - seedance-2-fast
                  - seedance-v1-lite-i2v
                  - seedance-v1-lite-t2v
                  - seedance-v1-pro-fast-i2v
                  - seedance-v1-pro-i2v
                  - seedance-v1-pro-t2v
                  - seedance-v1.5-pro-i2v
                  - seedance-v1.5-pro-t2v
                  - seedream-4-5-edit
                  - seedream-4-5-text-to-image
                  - seedream-5-lite-edit
                  - seedream-5-lite-t2i
                  - suno
                  - suno-add-instrumental
                  - suno-add-vocals
                  - suno-lyrics
                  - suno-sounds
                  - topaz-image-upscale
                  - topaz-video-upscale
                  - veo3-i2v
                  - veo3-ref2v
                  - veo3-t2v
                  - wan-2-2-animate-move
                  - wan-2-2-animate-replace
                  - wan-2-2-speech-to-video
                  - wan-2-2-turbo-i2v
                  - wan-2-2-turbo-t2v
                  - wan-2-6-i2v
                  - wan-2-6-t2v
                  - wan-2-6-v2v
                  - wan-2-7-i2v
                  - wan-2-7-r2v
                  - wan-2-7-t2v
                  description: Model alias (required for generate actions)
                action:
                  type: string
                  default: generate
                  description: 'Action type: generate, extend, upscale, vary, modify, remix'
                parent_job_id:
                  type: string
                  format: uuid
                  description: Parent job ID for chain operations
                params:
                  type: object
                  description: Model-specific generation parameters
                  additionalProperties: true
            examples:
              Kling 2.6 Pro Text-to-Video Generate:
                summary: Kling 2.6 Pro Text-to-Video text generation
                value:
                  model: kling-v2.6-pro-t2v
                  action: generate
                  params:
                    prompt: A white cat playing piano in a jazz club, cinematic lighting
                    sound: false
                    duration: 5
                    aspect_ratio: '16:9'
              Seedance 2 Generate:
                summary: Seedance 2 text generation
                value:
                  model: seedance-2
                  action: generate
                  params:
                    prompt: A beautiful landscape at sunset
                    aspect_ratio: '16:9'
                    duration: 5
              GPT Image 2 Text-to-Image Generate:
                summary: GPT Image 2 Text-to-Image text generation
                value:
                  model: gpt-image-2-t2i
                  action: generate
                  params:
                    prompt: A futuristic cityscape at sunset, detailed architecture
                    aspect_ratio: auto
      responses:
        '202':
          description: Job created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                    - pending
                    - submitted
                    - polling
                    - processing
                    - completed
                    - failed
                  action:
                    type: string
                  parent_job_id:
                    oneOf:
                    - type: string
                      format: uuid
                    - type: 'null'
                  model:
                    type: string
                    description: Model alias from request
                  estimated_cost:
                    oneOf:
                    - type: string
                    - type: number
                    nullable: true
                    description: Estimated cost in GL (may be string for Decimal precision)
                  created_at:
                    type: string
                    format: date-time
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
        '402':
          description: Insufficient credits
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
        '404':
          description: Model or parent job not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
    get:
      operationId: listJobs
      summary: List jobs
      description: List all jobs for the authenticated user.
      tags:
      - Jobs
      parameters:
      - name: limit
        in: query
        schema:
          type: integer
          default: 20
          maximum: 100
        description: Number of jobs to return (max 100)
      - name: offset
        in: query
        schema:
          type: integer
          default: 0
        description: Number of jobs to skip
      - name: status
        in: query
        schema:
          type: string
          enum:
          - pending
          - submitted
          - polling
          - processing
          - completed
          - failed
        description: Filter by job status
      responses:
        '200':
          description: List of jobs
          content:
            application/json:
              schema:
                type: object
                properties:
                  jobs:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                      properties:
                        id:
                          type: string
                          format: uuid
                        status:
                          type: string
                          enum:
                          - pending
                          - submitted
                          - polling
                          - processing
                          - completed
                          - failed
                        action:
                          type: string
                        parent_job:
                          oneOf:
                          - type: string
                            format: uuid
                          - type: 'null'
                        model_slug:
                          type: string
                        media_type:
                          type: string
                          enum:
                          - video
                          - image
                          - audio
                          - text
                          - unknown
                        cost:
                          oneOf:
                          - type: string
                          - type: number
                          nullable: true
                        cost_usd:
                          type: number
                          nullable: true
                        created_at:
                          type: string
                          format: date-time
                        updated_at:
                          type: string
                          format: date-time
                  total:
                    type: integer
                  limit:
                    type: integer
                  offset:
                    type: integer
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
  /v1/jobs/{job_id}:
    get:
      operationId: getJob
      summary: Get job status
      description: Retrieve job details including status, result, and available actions.
      tags:
      - Jobs
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Job ID (UUID)
      responses:
        '200':
          description: Job details
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                    - pending
                    - submitted
                    - polling
                    - processing
                    - completed
                    - failed
                  action:
                    type: string
                  parent_job:
                    oneOf:
                    - type: string
                      format: uuid
                    - type: 'null'
                    description: Parent job ID (same value as POST parent_job_id)
                  model_slug:
                    type: string
                    description: Model alias (same value as POST model)
                  media_type:
                    type: string
                    enum:
                    - video
                    - image
                    - audio
                    - text
                    - unknown
                  final_result:
                    oneOf:
                    - type: object
                      properties:
                        url:
                          type: string
                          format: uri
                        urls:
                          type: array
                          items:
                            type: string
                            format: uri
                        duration:
                          type: number
                      additionalProperties: true
                    - type: 'null'
                    description: Result data when job is completed
                  cost:
                    oneOf:
                    - type: string
                    - type: number
                    nullable: true
                    description: Final cost in GL (may be string for Decimal precision)
                  cost_usd:
                    type: number
                    nullable: true
                    description: Final cost in USD (1 GL = $0.01)
                  available_actions:
                    type: array
                    description: Available follow-up actions for completed jobs
                    items:
                      type: object
                      title: Extend
                      properties:
                        name:
                          type: string
                          const: extend
                        display_name:
                          type: string
                        description:
                          type: string
                        ui_type:
                          type: string
                          enum:
                          - confirm
                          - prompt
                          - index_select
                        cost:
                          oneOf:
                          - type: string
                          - type: number
                          nullable: true
                        parameters:
                          type: array
                          items:
                            type: object
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                additionalProperties: true
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
        '404':
          description: Job not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
    delete:
      operationId: deleteJob
      summary: Delete job
      description: Soft-delete a completed or failed job from user-visible history and remove stored media files.
      tags:
      - Jobs
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: Job ID (UUID)
      responses:
        '200':
          description: Job deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                    - deleted
                  files_deleted:
                    type: integer
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
        '404':
          description: Job not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
        '409':
          description: Only completed or failed jobs can be deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  detail:
                    type: string
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key or JWT
      description: 'API key or JWT token: `Bearer <your-token>`'