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

# Run up to 500 jobs

> No rate limits on paid usage. Every job is priced first: when your paid credits and the app's own limit cover them all, all are accepted (202) and run in order as your running slots free up (10 at once, up to 40 as you buy more credits). If they do not fit, nothing is accepted: 402 says how many fit and how much more is needed. Optional Idempotency-Key for the whole batch; each job may carry its own idempotencyKey.



## OpenAPI

````yaml scripts/api/sources/openapi.json POST /batches
openapi: 3.1.0
info:
  title: Summer API
  version: '1'
  description: >-
    Curated, tested game-dev models: 3D, images, video, voice, sound and music,
    into your Summer assets.
servers:
  - url: https://www.summerengine.com/v1
security:
  - bearer: []
paths:
  /batches:
    post:
      summary: Run up to 500 jobs
      description: >-
        No rate limits on paid usage. Every job is priced first: when your paid
        credits and the app's own limit cover them all, all are accepted (202)
        and run in order as your running slots free up (10 at once, up to 40 as
        you buy more credits). If they do not fit, nothing is accepted: 402 says
        how many fit and how much more is needed. Optional Idempotency-Key for
        the whole batch; each job may carry its own idempotencyKey.
      operationId: batches_create
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 128
          description: >-
            One key for the whole batch: a retry with the same key answers the
            batch it made and never queues it twice.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jobs
              properties:
                jobs:
                  type: array
                  minItems: 1
                  maxItems: 500
                  items:
                    type: object
                    required:
                      - model
                      - input
                    properties:
                      model:
                        type: string
                      input:
                        type: object
                      idempotencyKey:
                        type: string
                      webhookUrl:
                        type: string
                        format: uri
      responses:
        '202':
          description: >-
            Accepted: every job queued, each at the price it holds (no quoteId:
            each job is priced when the batch is accepted).
          content:
            application/json:
              schema:
                type: object
                properties:
                  batch:
                    type: object
                    properties:
                      id:
                        type: string
                      estimatedPrice:
                        type: string
                      jobs:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: >-
                                q:<id> until it starts; reads answer the job it
                                became.
                            state:
                              type: string
                              enum:
                                - queued
                            model:
                              type: string
                            estimatedPrice:
                              type: string
        default:
          description: An error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
            - request_id
            - doc_url
          properties:
            type:
              type: string
            code:
              type: string
              description: >-
                A stable code: invalid_input, not_signed_in, no_credits (the
                paid balance), over_limit (the app's own spend limit), ...
            message:
              type: string
            param:
              type:
                - string
                - 'null'
              description: The field to fix, such as input.prompt or Idempotency-Key.
            request_id:
              type: string
            doc_url:
              type: string
            fix_url:
              type: string
              description: Where the person fixes it, such as adding credits.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A Summer sign-in: an OAuth 2.1 access token, valid one hour. Sign in
        once with npx -y summer-engine login, then print a token with summer
        token. Each app you sign in spends your paid credits up to the limit you
        set in Connected apps.

````

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