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

# Start a run

> Starts a run from a `quoteId` (priced fields fixed) or the full request with `name` and `maxCostUsd`. The estimate is reserved from the wallet, settled when the run succeeds and released if it fails or is cancelled. Requires compute `manage` access.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/training/jobs
openapi: 3.0.3
info:
  title: AI Reserve Gateway API
  description: >-
    The AI Reserve API surface — OpenAI-compatible chat completions,
    Anthropic-compatible messages, Bedrock Converse, images, video, files,
    text-to-speech, realtime voice sessions, provider-hidden GPU infrastructure,
    and fine-tuning — all behind one endpoint and one API key.
  version: 1.0.0
servers:
  - url: https://api.aireserve.com
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: >-
      Per-end-customer usage, cost, and billable amounts for organizations that
      tag requests with their own customers.
  - name: GPU Infrastructure
    description: >-
      Provision and manage provider-hidden GPU instances. The recommended
      Instances API accepts workload requirements and an hourly price ceiling;
      AI Reserve handles provider placement internally. Every mutation is
      asynchronous and returns an operation to poll.
  - name: Customer keys
    description: >-
      Mint, list, and revoke API keys pinned to your own end customers (and
      their organizations), so spend splits per customer without per-request
      tagging.
  - name: AWS CLI login
    description: >-
      Browser-authorization endpoints consumed by `aws login --profile …` (AWS
      CLI v2.32.0+). All three routes are unauthenticated — the caller has no
      credential until `/v1/token` succeeds.
  - name: Fine-tuning
    description: >-
      Fine-tune open models on your own data. Data lives in an S3 bucket inside
      your organization's AWS hub account; you name a base, LoRA or full, a
      price ceiling and how the result must be servable, and AI Reserve places
      the run on a backend internally. The result is a model in your bucket you
      can deploy or download.
paths:
  /v1/training/jobs:
    post:
      tags:
        - Fine-tuning
      summary: Start a run
      description: >-
        Starts a run from a `quoteId` (priced fields fixed) or the full request
        with `name` and `maxCostUsd`. The estimate is reserved from the wallet,
        settled when the run succeeds and released if it fails or is cancelled.
        Requires compute `manage` access.
      operationId: startTrainingJob
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Client-chosen key of 8–180 characters `[A-Za-z0-9:_-]`. Replaying it
            returns the same run.
          schema:
            type: string
            minLength: 8
            maxLength: 180
            pattern: ^[A-Za-z0-9:_-]+$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                quoteId:
                  type: string
                  minLength: 16
                  maxLength: 8192
                costAcknowledged:
                  type: boolean
                  enum:
                    - true
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                datasetId:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                baseModel:
                  type: string
                  minLength: 1
                  maxLength: 200
                method:
                  type: string
                  enum:
                    - lora
                    - full
                hyperparameters:
                  default:
                    epochs: 3
                    learningRate: 0.0001
                    batchSize: 16
                    maxSeqLen: 4096
                    loraRank: 16
                  type: object
                  properties:
                    epochs:
                      default: 3
                      type: integer
                      minimum: 1
                      maximum: 50
                    learningRate:
                      default: 0.0001
                      type: number
                      minimum: 0
                      exclusiveMinimum: true
                      maximum: 1
                    batchSize:
                      default: 16
                      type: integer
                      minimum: 1
                      maximum: 256
                    maxSeqLen:
                      default: 4096
                      type: integer
                      minimum: 256
                      maximum: 131072
                    loraRank:
                      type: integer
                      minimum: 1
                      maximum: 128
                  additionalProperties: false
                serving:
                  type: string
                  enum:
                    - serverless
                    - dedicated
                    - download
                maxCostUsd:
                  type: number
                  minimum: 0
                  maximum: 100000
                providerParameters:
                  type: object
                  additionalProperties:
                    anyOf:
                      - type: string
                        maxLength: 512
                      - type: number
                      - type: boolean
              required:
                - costAcknowledged
                - datasetId
                - baseModel
                - method
                - serving
              additionalProperties: false
      responses:
        '202':
          description: Accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  name:
                    type: string
                  datasetId:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  baseModel:
                    type: string
                  method:
                    type: string
                    enum:
                      - lora
                      - full
                  serving:
                    type: string
                    enum:
                      - serverless
                      - dedicated
                      - download
                  hyperparameters:
                    type: object
                    properties:
                      epochs:
                        default: 3
                        type: integer
                        minimum: 1
                        maximum: 50
                      learningRate:
                        default: 0.0001
                        type: number
                        minimum: 0
                        exclusiveMinimum: true
                        maximum: 1
                      batchSize:
                        default: 16
                        type: integer
                        minimum: 1
                        maximum: 256
                      maxSeqLen:
                        default: 4096
                        type: integer
                        minimum: 256
                        maximum: 131072
                      loraRank:
                        type: integer
                        minimum: 1
                        maximum: 128
                    required:
                      - epochs
                      - learningRate
                      - batchSize
                      - maxSeqLen
                    additionalProperties: false
                  maxCostUsd:
                    type: string
                  state:
                    type: string
                    enum:
                      - pending
                      - submitting
                      - queued
                      - running
                      - succeeded
                      - failed
                      - cancelling
                      - cancelled
                  backend:
                    nullable: true
                    description: >-
                      Where the run executed, once started. A fact about the
                      run, never an input.
                    type: string
                  estimatedCostUsd:
                    nullable: true
                    type: string
                  estimatedMinutes:
                    nullable: true
                    type: number
                  actualCostUsd:
                    nullable: true
                    type: string
                  trainedTokens:
                    nullable: true
                    type: number
                  chargeState:
                    type: string
                    enum:
                      - none
                      - pending
                      - settled
                      - released
                      - failed
                  modelId:
                    nullable: true
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  error:
                    nullable: true
                    type: string
                  createdAt:
                    type: string
                  startedAt:
                    nullable: true
                    type: string
                  completedAt:
                    nullable: true
                    type: string
                required:
                  - id
                  - name
                  - datasetId
                  - baseModel
                  - method
                  - serving
                  - hyperparameters
                  - maxCostUsd
                  - state
                  - backend
                  - estimatedCostUsd
                  - estimatedMinutes
                  - actualCostUsd
                  - trainedTokens
                  - chargeState
                  - modelId
                  - error
                  - createdAt
                  - startedAt
                  - completedAt
                additionalProperties: false
        '400':
          description: Invalid request or schema violation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingError'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingError'
        '402':
          description: >-
            Wallet not enabled or cannot cover the estimate
            (`insufficient_funds`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingError'
        '403':
          description: Key lacks the required compute access (`read` or `manage`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingError'
        '404':
          description: Resource not found or owned by another organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingError'
        '409':
          description: >-
            `no_placement` with `details` (see `TrainingNoPlacementDetails`),
            `dataset_not_ready`, `quote_expired`, or `aws_account_required`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingError'
        '503':
          description: >-
            `storage_unconfigured` or `backend_unconfigured`: the environment is
            missing a credential; retry after it is added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingError'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    TrainingError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              enum:
                - invalid_request_error
            param:
              type: string
              nullable: true
              enum:
                - null
            code:
              type: string
            details:
              type: object
              additionalProperties: {}
          required:
            - message
            - type
            - param
            - code
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your AI Reserve API key (aireserve_api_…) from the API Keys page in the
        portal (https://portal.aireserve.com/keys).
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: The same API key sent as an `x-api-key` header.

````

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