{
  "openapi": "3.1.0",
  "info": {
    "title": "Gridline API",
    "version": "v1",
    "summary": "OpenAI-compatible fine-tuning, distillation, evals and batch inference for open models.",
    "description": "Gridline's API follows OpenAI's Files, Fine-tuning, Batch and Models APIs, so the OpenAI SDKs work with the base URL changed. Gridline-only fields sit under a gridline key, and Gridline-only routes under /gridline/.\n\nAuthentication: send a Gridline API key as a bearer token (Authorization: Bearer). The docs keep it in the GRIDLINE_TOKEN environment variable. GET routes need the read scope; POST and DELETE routes need routing:write.\n\nErrors: every 4xx and 5xx answer has the body {\"error\": {\"message\", \"type\", \"param\", \"code\"}}. Limit refusals add error.limit. Rate limits answer 429 with Retry-After. Every response carries x-request-id.\n\nVersioning: the major version is in the path (/openai/v1). Breaking changes ship only under a new path version. Before we remove or break anything under /openai/v1, we give at least 90 days' notice: in the docs changelog, by email to account owners, and with Deprecation and Sunset headers on the affected responses. No route is deprecated today, and no response carries a Deprecation or Sunset header. Versioning and deprecation policy: https://gridlinegpu.com/docs/openai-migration#versioning"
  },
  "externalDocs": {
    "description": "Gridline docs",
    "url": "https://gridlinegpu.com/docs"
  },
  "servers": [
    {
      "url": "https://api.gridlinegpu.com/openai/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Files",
      "description": "Upload, list, download and delete files, and make fine-tune files from batch or eval results."
    },
    {
      "name": "Fine-tuning",
      "description": "LoRA and QLoRA fine-tuning jobs (supervised and DPO) on open models."
    },
    {
      "name": "Batches",
      "description": "Batch inference over a JSONL file of requests."
    },
    {
      "name": "Models",
      "description": "Catalog models, your ft: models, their adapters and merged weights."
    },
    {
      "name": "Usage",
      "description": "Usage and spend per API key."
    },
    {
      "name": "Evals",
      "description": "Evals that grade a model's outputs, run as batches."
    },
    {
      "name": "Webhooks",
      "description": "Endpoints that receive batch and fine-tuning job events."
    },
    {
      "name": "Distillation",
      "description": "One-call distillation of a teacher model into a student."
    }
  ],
  "paths": {
    "/files": {
      "post": {
        "operationId": "createFile",
        "summary": "Upload a file",
        "description": "Upload a JSONL file as multipart/form-data with the fields purpose and file. purpose=batch holds batch request lines (custom_id, method, url, body); purpose=fine-tune holds one chat conversation per line. Send purpose before file. Fine-tune files are checked line by line as they upload. Needs the routing:write scope.",
        "tags": [
          "Files"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "batch",
                      "fine-tune"
                    ],
                    "description": "What the file is for."
                  },
                  "file": {
                    "type": "string",
                    "contentMediaType": "application/octet-stream",
                    "description": "The JSONL file."
                  }
                },
                "required": [
                  "purpose",
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The file.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listFiles",
        "summary": "List files",
        "description": "List your files, newest first. Expired files are left out. Needs the read scope.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "purpose",
            "in": "query",
            "required": false,
            "description": "Only files with this purpose.",
            "schema": {
              "type": "string",
              "enum": [
                "batch",
                "batch_output",
                "fine-tune"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The file id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of files.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/{file_id}": {
      "get": {
        "operationId": "retrieveFile",
        "summary": "Retrieve a file",
        "description": "Retrieve a file object. Needs the read scope.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "description": "The file id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteFile",
        "summary": "Delete a file",
        "description": "Delete a file. Refused while a batch still reads it. Needs the routing:write scope.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "description": "The file id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file was deleted.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDeleted"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/{file_id}/content": {
      "get": {
        "operationId": "downloadFile",
        "summary": "Download a file",
        "description": "Download a file's bytes, such as a batch's output or error file. A fine-tuning job's step metrics file downloads as CSV. Needs the read scope.",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "description": "The file id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file's bytes.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/distill": {
      "post": {
        "operationId": "createDistillFiles",
        "summary": "Make fine-tune files from a batch",
        "description": "Turn a batch's requests and results (Gridline's or OpenAI's batch output, or Anthropic's message batch results) into fine-tune training and validation files. Not charged. Needs the routing:write scope.",
        "tags": [
          "Files"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "results_file": {
                    "type": "string",
                    "description": "A file id of an uploaded file.",
                    "pattern": "^file-[a-f0-9]{32}$"
                  },
                  "requests_file": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The batch's input file. Needed when results_file was uploaded with purpose batch; for a Gridline batch's output it is found from the batch.",
                    "pattern": "^file-[a-f0-9]{32}$"
                  },
                  "provider": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "openai",
                      "anthropic"
                    ],
                    "description": "The results' format."
                  },
                  "require_json": {
                    "type": "boolean",
                    "description": "Leave out answers that are not valid JSON.",
                    "default": false
                  },
                  "keep_truncated": {
                    "type": "boolean",
                    "description": "Keep answers that hit their token limit.",
                    "default": false
                  },
                  "eval_fraction": {
                    "type": "number",
                    "description": "Share of rows for the validation file.",
                    "minimum": 0,
                    "exclusiveMaximum": 1,
                    "default": 0.1
                  },
                  "seed": {
                    "type": "integer",
                    "description": "The split's seed.",
                    "minimum": 0,
                    "maximum": 2147483647,
                    "default": 0
                  },
                  "student_system": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A system message for every training row; \"\" for none.",
                    "maxLength": 2048
                  },
                  "max_train_rows": {
                    "type": "integer",
                    "description": "The most training rows to write.",
                    "minimum": 1,
                    "maximum": 50000
                  }
                },
                "required": [
                  "results_file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The training and validation files.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DistillResult"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/files/preferences": {
      "post": {
        "operationId": "createPreferenceFiles",
        "summary": "Make DPO files from an eval run",
        "description": "Turn a completed eval run's graded outputs into DPO preference training and validation files. Needs the routing:write scope.",
        "tags": [
          "Files"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "eval_id": {
                    "type": "string",
                    "description": "The eval.",
                    "pattern": "^eval_[a-f0-9]{32}$"
                  },
                  "run_id": {
                    "type": "string",
                    "description": "The completed run.",
                    "pattern": "^evalrun_[a-f0-9]{32}$"
                  },
                  "prompt_id_field": {
                    "type": "string",
                    "description": "The item field that groups outputs by prompt.",
                    "default": "prompt_id"
                  },
                  "criterion": {
                    "description": "The score_model criterion, by name or index. Default: the eval's only one.",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "min_margin": {
                    "type": "number",
                    "description": "The smallest score gap a pair needs.",
                    "minimum": 0,
                    "default": 0
                  },
                  "keep_truncated": {
                    "type": "boolean",
                    "description": "Keep outputs that hit their token limit.",
                    "default": false
                  },
                  "validation_fraction": {
                    "type": "number",
                    "description": "Share of pairs for the validation file.",
                    "minimum": 0,
                    "maximum": 0.5,
                    "default": 0
                  },
                  "seed": {
                    "type": "integer",
                    "description": "The split's seed.",
                    "minimum": 0,
                    "maximum": 2147483647,
                    "default": 0
                  }
                },
                "required": [
                  "eval_id",
                  "run_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preference files.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreferencesResult"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/fine_tuning/jobs": {
      "post": {
        "operationId": "createFineTuningJob",
        "summary": "Create a fine-tuning job",
        "description": "Create a LoRA or QLoRA fine-tuning job (supervised or DPO) on a base model. The job is quoted before it starts; with dry_run the answer is the quote and nothing is created. Paid from prepaid credits. Needs the routing:write scope.",
        "tags": [
          "Fine-tuning"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FineTuningJobCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job, or with dry_run its quote.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/FineTuningJob"
                    },
                    {
                      "$ref": "#/components/schemas/FineTuningJobQuote"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listFineTuningJobs",
        "summary": "List fine-tuning jobs",
        "description": "List your fine-tuning jobs, newest first. Needs the read scope.",
        "tags": [
          "Fine-tuning"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The job id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of jobs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FineTuningJobList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/fine_tuning/jobs/{job_id}": {
      "get": {
        "operationId": "retrieveFineTuningJob",
        "summary": "Retrieve a fine-tuning job",
        "description": "Retrieve a job: its status, quote, result and fine-tuned model. Needs the read scope.",
        "tags": [
          "Fine-tuning"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "The fine-tuning job id.",
            "schema": {
              "type": "string",
              "pattern": "^ftjob-"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FineTuningJob"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/fine_tuning/jobs/{job_id}/events": {
      "get": {
        "operationId": "listFineTuningJobEvents",
        "summary": "List a job's events",
        "description": "A job's progress, warnings and eval metrics, newest first. Needs the read scope.",
        "tags": [
          "Fine-tuning"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "The fine-tuning job id.",
            "schema": {
              "type": "string",
              "pattern": "^ftjob-"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The event id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FineTuningJobEventList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/fine_tuning/jobs/{job_id}/checkpoints": {
      "get": {
        "operationId": "listFineTuningJobCheckpoints",
        "summary": "List a job's checkpoints",
        "description": "A succeeded job's checkpoints: its ft: model at the last step, with its metrics. Needs the read scope.",
        "tags": [
          "Fine-tuning"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "The fine-tuning job id.",
            "schema": {
              "type": "string",
              "pattern": "^ftjob-"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The checkpoint id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of checkpoints.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FineTuningJobCheckpointList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/fine_tuning/jobs/{job_id}/cancel": {
      "post": {
        "operationId": "cancelFineTuningJob",
        "summary": "Cancel a fine-tuning job",
        "description": "Cancel a job. A job already cancelled is returned as it is. Needs the routing:write scope.",
        "tags": [
          "Fine-tuning"
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "description": "The fine-tuning job id.",
            "schema": {
              "type": "string",
              "pattern": "^ftjob-"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FineTuningJob"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/batches": {
      "post": {
        "operationId": "createBatch",
        "summary": "Create a batch",
        "description": "Run an uploaded purpose=batch file as a batch on one endpoint. A batch is charged for the results it delivers, from prepaid credits. Needs the routing:write scope.",
        "tags": [
          "Batches"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input_file_id": {
                    "type": "string",
                    "description": "The purpose=batch file."
                  },
                  "endpoint": {
                    "type": "string",
                    "enum": [
                      "/v1/chat/completions",
                      "/v1/embeddings",
                      "/v1/rerank",
                      "/v1/systemone"
                    ],
                    "description": "The endpoint every request line calls."
                  },
                  "completion_window": {
                    "type": "string",
                    "enum": [
                      "24h",
                      "72h"
                    ],
                    "description": "The completion window."
                  },
                  "metadata": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
                    "maxProperties": 16,
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 512
                    }
                  },
                  "output_expires_after": {
                    "type": "object",
                    "description": "When the output and error files are deleted.",
                    "properties": {
                      "anchor": {
                        "type": "string",
                        "const": "created_at"
                      },
                      "seconds": {
                        "type": "integer",
                        "description": "Seconds after the output file is created.",
                        "minimum": 3600,
                        "maximum": 2592000
                      }
                    },
                    "required": [
                      "anchor",
                      "seconds"
                    ]
                  }
                },
                "required": [
                  "input_file_id",
                  "endpoint",
                  "completion_window"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The batch.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listBatches",
        "summary": "List batches",
        "description": "List your batches, newest first. Needs the read scope.",
        "tags": [
          "Batches"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The batch id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of batches.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/batches/{batch_id}": {
      "get": {
        "operationId": "retrieveBatch",
        "summary": "Retrieve a batch",
        "description": "Retrieve a batch: its status, counts, files and usage. Needs the read scope.",
        "tags": [
          "Batches"
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "description": "The batch id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The batch.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/batches/{batch_id}/cancel": {
      "post": {
        "operationId": "cancelBatch",
        "summary": "Cancel a batch",
        "description": "Cancel a batch. A validating batch is cancelled at once; a running one moves to cancelling. Needs the routing:write scope.",
        "tags": [
          "Batches"
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "description": "The batch id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The batch.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List models",
        "description": "The catalog models and your ft: models. Needs the read scope.",
        "tags": [
          "Models"
        ],
        "responses": {
          "200": {
            "description": "The models.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/models/{model}": {
      "get": {
        "operationId": "retrieveModel",
        "summary": "Retrieve a model",
        "description": "One catalog model, or one of your ft: models. Needs the read scope.",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "A model id; for adapter and merge routes, one of your ft: models.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The model.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Model"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteModel",
        "summary": "Delete an ft: model",
        "description": "Delete one of your ft: models and its adapter. Needs the routing:write scope.",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "A model id; for adapter and merge routes, one of your ft: models.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The model was deleted.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelDeleted"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/adapters/{model}/files/{name}": {
      "get": {
        "operationId": "downloadAdapterFile",
        "summary": "Download an ft: model's adapter",
        "description": "Download your ft: model's LoRA adapter, one file at a time. x-gridline-sha256 carries the file's SHA-256. Needs the read scope.",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "A model id; for adapter and merge routes, one of your ft: models.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The adapter file.",
            "schema": {
              "type": "string",
              "enum": [
                "adapter_model.safetensors",
                "adapter_config.json"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file's bytes.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-gridline-sha256": {
                "description": "The file's SHA-256, hex.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/octet-stream"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "adapter_config.json",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/adapters/{model}/merged": {
      "post": {
        "operationId": "createMergedWeights",
        "summary": "Merge an ft: model into its base",
        "description": "Start a merge of your ft: model's adapter into its base, to download as full safetensors at no charge. 202 when a new merge starts; 200 when one is pending or done. Needs the routing:write scope.",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "A model id; for adapter and merge routes, one of your ft: models.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The merge already pending or done.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergedWeights"
                }
              }
            }
          },
          "202": {
            "description": "A new merge started.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergedWeights"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "retrieveMergedWeights",
        "summary": "Retrieve a merge",
        "description": "The merge's status and, once it has succeeded, the export's file list. Needs the read scope.",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "A model id; for adapter and merge routes, one of your ft: models.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The merge.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergedWeights"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteMergedWeights",
        "summary": "Delete a merged export",
        "description": "Delete the merged export, or cancel a pending merge. Needs the routing:write scope.",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "A model id; for adapter and merge routes, one of your ft: models.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted or cancelled.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergedWeightsDeleted"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/adapters/{model}/merged/files/{path}": {
      "get": {
        "operationId": "downloadMergedWeightsFile",
        "summary": "Download a merged file",
        "description": "Download one file of the merged export: a 302 redirect to a short-lived URL, with the file's SHA-256 in x-gridline-sha256. Needs the read scope.",
        "tags": [
          "Models"
        ],
        "parameters": [
          {
            "name": "model",
            "in": "path",
            "required": true,
            "description": "A model id; for adapter and merge routes, one of your ft: models.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "description": "A file path from the export's file list.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the file.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "location": {
                "description": "A URL valid for 15 minutes.",
                "schema": {
                  "type": "string"
                }
              },
              "x-gridline-sha256": {
                "description": "The file's SHA-256, hex.",
                "schema": {
                  "type": "string"
                }
              },
              "x-gridline-bytes": {
                "description": "The file's size.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/usage/keys": {
      "get": {
        "operationId": "listApiKeyUsage",
        "summary": "Usage per API key",
        "description": "Usage per API key over a window of UTC days (at most 31): batches, fine-tuning jobs, tokens, held and charged amounts, and each key's spend limits. Needs the read scope.",
        "tags": [
          "Usage"
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First UTC day (YYYY-MM-DD). Default: the 1st of to's month.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Last UTC day (YYYY-MM-DD). Default: today.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Usage per key.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyUsageList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/usage/keys/{key}": {
      "get": {
        "operationId": "listApiKeyJobs",
        "summary": "One API key's jobs",
        "description": "One API key's batches and jobs, and its spend today and in total against its limits. Needs the read scope.",
        "tags": [
          "Usage"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "A key id (UUID), or current for the key you call with.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First UTC day (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Last UTC day (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The batch or job id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the key's jobs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyJobList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/evals": {
      "post": {
        "operationId": "createEval",
        "summary": "Create an eval",
        "description": "Create an eval: its testing criteria and the shape of its items. Needs the routing:write scope.",
        "tags": [
          "Evals"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The eval.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eval"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listEvals",
        "summary": "List evals",
        "description": "List your evals. Needs the read scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort order by creation.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The eval id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "description": "Sort field.",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "updated_at"
              ],
              "default": "created_at"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of evals.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/evals/{eval_id}": {
      "get": {
        "operationId": "retrieveEval",
        "summary": "Retrieve an eval",
        "description": "Retrieve an eval. Needs the read scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The eval.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eval"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "updateEval",
        "summary": "Update an eval",
        "description": "Update an eval's name or metadata; its criteria are fixed. Needs the routing:write scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The eval.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eval"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEval",
        "summary": "Delete an eval",
        "description": "Delete an eval and its ended runs. Refused while a run is open. Needs the routing:write scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The eval was deleted.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalDeleted"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/evals/{eval_id}/runs": {
      "post": {
        "operationId": "createEvalRun",
        "summary": "Start an eval run",
        "description": "Start a run, or quote one with dry_run. A run's generation and grading run as batches, charged as any batch. Needs the routing:write scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvalRunCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The run, or with dry_run its quote.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/EvalRun"
                    },
                    {
                      "$ref": "#/components/schemas/EvalRunQuote"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listEvalRuns",
        "summary": "List an eval's runs",
        "description": "List an eval's runs. Needs the read scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort order by creation.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The run id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only runs in this state.",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "in_progress",
                "completed",
                "failed",
                "canceled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of runs.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRunList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/evals/{eval_id}/runs/{run_id}": {
      "get": {
        "operationId": "retrieveEvalRun",
        "summary": "Retrieve an eval run",
        "description": "Retrieve a run: its status, counts and usage. Needs the read scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "description": "The eval run id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRun"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "cancelEvalRun",
        "summary": "Cancel an eval run",
        "description": "Cancel a run. Its batches are cancelled. Needs the routing:write scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "description": "The eval run id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRun"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEvalRun",
        "summary": "Delete an eval run",
        "description": "Delete a run and its results file. Refused while the run is open. Needs the routing:write scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "description": "The eval run id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run was deleted.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalRunDeleted"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/evals/{eval_id}/runs/{run_id}/output_items": {
      "get": {
        "operationId": "listEvalRunOutputItems",
        "summary": "List a run's graded rows",
        "description": "A run's graded rows; empty until it has results. Needs the read scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "description": "The eval run id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort order by creation.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "The output item id to page after (the last_id of the previous page).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only rows with this result.",
            "schema": {
              "type": "string",
              "enum": [
                "pass",
                "fail"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of graded rows.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalOutputItemList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}": {
      "get": {
        "operationId": "retrieveEvalRunOutputItem",
        "summary": "Retrieve a graded row",
        "description": "One graded row. Needs the read scope.",
        "tags": [
          "Evals"
        ],
        "parameters": [
          {
            "name": "eval_id",
            "in": "path",
            "required": true,
            "description": "The eval id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "description": "The eval run id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "output_item_id",
            "in": "path",
            "required": true,
            "description": "The output item id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The graded row.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvalOutputItem"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/webhook_endpoints": {
      "post": {
        "operationId": "createWebhookEndpoint",
        "summary": "Create a webhook endpoint",
        "description": "Create an endpoint for batch and fine-tuning job events. The answer includes its signing secret, once. Needs the routing:write scope.",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The endpoint, with its secret.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listWebhookEndpoints",
        "summary": "List webhook endpoints",
        "description": "List your endpoints, without their secrets. Needs the read scope.",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "Your endpoints.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/webhook_endpoints/{endpoint_id}": {
      "get": {
        "operationId": "retrieveWebhookEndpoint",
        "summary": "Retrieve a webhook endpoint",
        "description": "Retrieve one endpoint, without its secret. Needs the read scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "description": "The webhook endpoint id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhookEndpoint",
        "summary": "Delete a webhook endpoint",
        "description": "Delete an endpoint. Its pending deliveries stop and its delivery history is deleted. Needs the routing:write scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "description": "The webhook endpoint id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint was deleted.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDeleted"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/webhook_endpoints/{endpoint_id}/rotate_secret": {
      "post": {
        "operationId": "rotateWebhookEndpointSecret",
        "summary": "Rotate a signing secret",
        "description": "Replace the signing secret. The answer includes the new secret, once; the old one is accepted until previous_secret_expires_at. Needs the routing:write scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "description": "The webhook endpoint id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint, with its new secret.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/gridline/webhook_endpoints/{endpoint_id}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "List an endpoint's deliveries",
        "description": "The endpoint's most recent deliveries, newest first, with each one's status and attempts. Needs the read scope.",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "endpoint_id",
            "in": "path",
            "required": true,
            "description": "The webhook endpoint id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent deliveries.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/distillation/jobs": {
      "post": {
        "operationId": "createDistillationJob",
        "summary": "Create a distillation job",
        "description": "Distill a teacher into a student in one call: a teacher batch, the conversion to training files, the student's fine-tune and, by default, a student batch on the held-out prompts. Each step is an ordinary batch, file or fine-tuning job in your account, billed as it always is. With dry_run the answer is the quote. Needs the routing:write scope.",
        "tags": [
          "Distillation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DistillationJobCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The job, or with dry_run its quote.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DistillationJob"
                    },
                    {
                      "$ref": "#/components/schemas/DistillationQuote"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: a missing, unknown or out-of-range parameter (error.param names it), or a model that is not available.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The request body or the converted output is too large.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/distillation/jobs/{distillation_job_id}": {
      "get": {
        "operationId": "retrieveDistillationJob",
        "summary": "Retrieve a distillation job",
        "description": "Each step's ids, status and charge, and the ft: model. Needs the read scope.",
        "tags": [
          "Distillation"
        ],
        "parameters": [
          {
            "name": "distillation_job_id",
            "in": "path",
            "required": true,
            "description": "The distillation job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DistillationJob"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The service could not answer in time; retry after Retry-After.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/distillation/jobs/{distillation_job_id}/cancel": {
      "post": {
        "operationId": "cancelDistillationJob",
        "summary": "Cancel a distillation job",
        "description": "Cancel the step that is running. A job already cancelling is returned as it is. Needs the routing:write scope.",
        "tags": [
          "Distillation"
        ],
        "parameters": [
          {
            "name": "distillation_job_id",
            "in": "path",
            "required": true,
            "description": "The distillation job id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DistillationJob"
                }
              }
            }
          },
          "401": {
            "description": "No API key, or the key is invalid, expired or revoked.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope the route needs (insufficient_permissions), or the account may not use it.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such object in your account, or no such route.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The object's state refuses the action (invalid_state, file_in_use).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "A rate, open-job or account limit was reached (type requests or limit_exceeded codes, with error.limit), or the account lacks credit (type insufficient_quota).",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              },
              "retry-after": {
                "$ref": "#/components/headers/retry-after"
              },
              "x-should-retry": {
                "$ref": "#/components/headers/x-should-retry"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "The request failed; retry later.",
            "headers": {
              "x-request-id": {
                "$ref": "#/components/headers/x-request-id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "A Gridline API key (GRIDLINE_TOKEN). GET routes need the read scope; POST and DELETE routes need routing:write."
      }
    },
    "headers": {
      "x-request-id": {
        "description": "The request's id. Quote it when you contact support.",
        "schema": {
          "type": "string"
        }
      },
      "retry-after": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        }
      },
      "x-should-retry": {
        "description": "false when retrying the same request cannot succeed.",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Every 4xx and 5xx answer has this body.",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "description": "What went wrong, for a person to read."
              },
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request_error",
                  "requests",
                  "insufficient_quota",
                  "server_error"
                ],
                "description": "The error's class."
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The request field the error is about."
              },
              "code": {
                "type": "string",
                "description": "A machine-readable code.",
                "examples": [
                  "invalid_api_key",
                  "insufficient_permissions",
                  "permission_denied",
                  "invalid_request",
                  "placement_unavailable",
                  "invalid_value",
                  "file_too_large",
                  "invalid_file_format",
                  "not_found",
                  "model_not_found",
                  "file_in_use",
                  "adapter_invalid",
                  "invalid_state",
                  "unsupported_version",
                  "model_not_available",
                  "job_too_large",
                  "large_output_window_exceeded",
                  "context_length_exceeded",
                  "tools_unsupported_for_base",
                  "tool_rows_unavailable",
                  "template_token_in_content",
                  "price_unpublished",
                  "rate_limit_exceeded",
                  "spend_cap_exceeded",
                  "insufficient_quota",
                  "storage_limit_exceeded",
                  "limit_exceeded",
                  "limit_unenforceable",
                  "request_too_large",
                  "service_unavailable",
                  "server_error"
                ]
              },
              "limit": {
                "$ref": "#/components/schemas/ErrorLimit"
              }
            },
            "required": [
              "message",
              "type",
              "param",
              "code"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "ErrorLimit": {
        "type": "object",
        "description": "Sent with limit_exceeded refusals: the limit that was reached.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The limit's name."
          },
          "unit": {
            "type": "string",
            "description": "The limit's unit, such as usd."
          },
          "api_key_id": {
            "type": "string",
            "description": "The API key the limit belongs to, for a per-key limit."
          },
          "current": {
            "type": "number",
            "description": "Where the account or key is now."
          },
          "requested": {
            "type": "number",
            "description": "What this request would add."
          },
          "maximum": {
            "type": "number",
            "description": "The limit."
          }
        },
        "required": [
          "name",
          "unit",
          "current",
          "requested",
          "maximum"
        ]
      },
      "File": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "A file id.",
            "pattern": "^file-[A-Za-z0-9-]+$"
          },
          "object": {
            "type": "string",
            "const": "file"
          },
          "bytes": {
            "type": "integer",
            "description": "The file's size in bytes."
          },
          "created_at": {
            "type": "integer",
            "description": "When the file was uploaded. Unix seconds."
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When the file is deleted. Unix seconds."
          },
          "filename": {
            "type": "string",
            "description": "The uploaded file's name."
          },
          "purpose": {
            "type": "string",
            "enum": [
              "batch",
              "batch_output",
              "fine-tune",
              "fine-tune-results"
            ],
            "description": "batch and fine-tune files are uploaded; batch_output files are a batch's output and error files; fine-tune-results is a fine-tuning job's step metrics CSV."
          },
          "status": {
            "type": "string",
            "const": "processed"
          },
          "status_details": {
            "type": "null"
          },
          "gridline": {
            "type": "object",
            "description": "Gridline extension, on fine-tune files.",
            "properties": {
              "fine_tune": {
                "type": "object",
                "description": "Statistics of a fine-tune file.",
                "properties": {
                  "rows": {
                    "type": "integer",
                    "description": "Training rows."
                  },
                  "messages": {
                    "type": "integer",
                    "description": "Messages across all rows."
                  },
                  "content_bytes": {
                    "type": "integer",
                    "description": "Bytes of message text."
                  },
                  "trained_content_bytes": {
                    "type": "integer",
                    "description": "Bytes of the text that is trained on."
                  },
                  "content_tokens_upper_bound": {
                    "type": "integer",
                    "description": "An upper bound on the text's tokens."
                  },
                  "alternating_roles": {
                    "type": "boolean",
                    "description": "Whether every row alternates user and assistant turns."
                  }
                }
              },
              "derived_from": {
                "type": "object",
                "description": "For a file made by POST /files/distill or /files/preferences: what it was made from.",
                "additionalProperties": true
              }
            }
          }
        },
        "required": [
          "id",
          "object",
          "bytes",
          "created_at",
          "filename",
          "purpose",
          "status"
        ]
      },
      "FileList": {
        "type": "object",
        "description": "A page of files, newest first.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/File"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "FileDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "A file id.",
            "pattern": "^file-[A-Za-z0-9-]+$"
          },
          "object": {
            "type": "string",
            "const": "file"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "object",
          "deleted"
        ]
      },
      "DistillResult": {
        "type": "object",
        "description": "The fine-tune files made from a batch's requests and results.",
        "properties": {
          "object": {
            "type": "string",
            "const": "gridline.distill"
          },
          "converter": {
            "type": "string",
            "description": "The converter's version."
          },
          "provider": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic"
            ],
            "description": "The format the results were read as."
          },
          "training_file": {
            "$ref": "#/components/schemas/File"
          },
          "validation_file": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/File"
              },
              {
                "type": "null"
              }
            ]
          },
          "results": {
            "type": "integer",
            "description": "Results read."
          },
          "missing_results": {
            "type": "integer",
            "description": "Requests with no result."
          },
          "dropped": {
            "type": "object",
            "description": "Rows left out, by reason.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "train_rows": {
            "type": "integer",
            "description": "Training rows written."
          },
          "eval_rows": {
            "type": "integer",
            "description": "Validation rows written."
          },
          "min_training_rows": {
            "type": "integer",
            "description": "The fewest training rows a fine-tuning job accepts."
          },
          "rows_over_limit": {
            "type": "integer",
            "description": "Rows left out by max_train_rows, when it was sent."
          }
        },
        "required": [
          "object",
          "training_file",
          "validation_file",
          "train_rows",
          "eval_rows"
        ]
      },
      "PreferencesResult": {
        "type": "object",
        "description": "DPO preference files made from a completed eval run.",
        "properties": {
          "object": {
            "type": "string",
            "const": "gridline.preferences"
          },
          "converter": {
            "type": "string",
            "description": "The converter's version."
          },
          "eval_id": {
            "type": "string",
            "description": "The eval."
          },
          "run_id": {
            "type": "string",
            "description": "The eval run."
          },
          "criterion": {
            "type": "object",
            "properties": {
              "index": {
                "type": "integer",
                "description": "The criterion's index."
              },
              "name": {
                "type": "string",
                "description": "Its name."
              }
            }
          },
          "training_file": {
            "$ref": "#/components/schemas/File"
          },
          "validation_file": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/File"
              },
              {
                "type": "null"
              }
            ]
          },
          "candidates": {
            "type": "integer",
            "description": "Graded outputs read."
          },
          "prompts": {
            "type": "integer",
            "description": "Distinct prompts."
          },
          "pairs": {
            "type": "integer",
            "description": "Training preference pairs written."
          },
          "validation_pairs": {
            "type": "integer",
            "description": "Validation preference pairs written."
          },
          "dropped": {
            "type": "object",
            "description": "Rows left out, by reason.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "min_training_rows": {
            "type": "integer",
            "description": "The fewest training rows a fine-tuning job accepts."
          }
        },
        "required": [
          "object",
          "training_file",
          "validation_file",
          "pairs"
        ]
      },
      "BatchUsage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "description": "Input tokens of the delivered results."
          },
          "input_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer",
                "description": "Always 0."
              }
            }
          },
          "output_tokens": {
            "type": "integer",
            "description": "Output tokens of the delivered results."
          },
          "output_tokens_details": {
            "type": "object",
            "properties": {
              "reasoning_tokens": {
                "type": "integer",
                "description": "Always 0."
              }
            }
          },
          "total_tokens": {
            "type": "integer",
            "description": "Input plus output tokens."
          }
        },
        "required": [
          "input_tokens",
          "output_tokens",
          "total_tokens"
        ]
      },
      "Batch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The batch id."
          },
          "object": {
            "type": "string",
            "const": "batch"
          },
          "endpoint": {
            "type": "string",
            "description": "The endpoint every request line calls."
          },
          "errors": {
            "type": [
              "object",
              "null"
            ],
            "description": "Problems found in the input file.",
            "properties": {
              "object": {
                "type": "string",
                "const": "list"
              },
              "data": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "Error code."
                    },
                    "message": {
                      "type": "string",
                      "description": "What went wrong."
                    },
                    "param": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The field."
                    },
                    "line": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "The input line, from 1."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              }
            },
            "required": [
              "object",
              "data"
            ]
          },
          "input_file_id": {
            "type": "string",
            "description": "The input file."
          },
          "completion_window": {
            "type": "string",
            "description": "The window the batch was created with."
          },
          "status": {
            "type": "string",
            "enum": [
              "validating",
              "failed",
              "in_progress",
              "finalizing",
              "completed",
              "expired",
              "cancelling",
              "cancelled"
            ],
            "description": "The batch's state."
          },
          "output_file_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The output file, once there is one."
          },
          "error_file_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The error file, once there is one."
          },
          "created_at": {
            "type": "integer",
            "description": "When the batch was created. Unix seconds."
          },
          "in_progress_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it started. Unix seconds."
          },
          "expires_at": {
            "type": "integer",
            "description": "When its completion window ends. Unix seconds."
          },
          "finalizing_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it began finalizing. Unix seconds."
          },
          "completed_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it completed. Unix seconds."
          },
          "failed_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it failed. Unix seconds."
          },
          "expired_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it expired. Unix seconds."
          },
          "cancelling_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When cancelling began. Unix seconds."
          },
          "cancelled_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it was cancelled. Unix seconds."
          },
          "request_counts": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "Request lines."
              },
              "completed": {
                "type": "integer",
                "description": "Lines with a result."
              },
              "failed": {
                "type": "integer",
                "description": "Lines in the error file."
              }
            },
            "required": [
              "total",
              "completed",
              "failed"
            ]
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            }
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The model the batch runs."
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BatchUsage"
              },
              {
                "type": "null"
              }
            ]
          },
          "gridline": {
            "type": "object",
            "description": "Gridline extension: model, and when available billing (the price, held and charged amounts), progress and the reason a batch is waiting.",
            "additionalProperties": true
          }
        },
        "required": [
          "id",
          "object",
          "endpoint",
          "input_file_id",
          "completion_window",
          "status",
          "created_at"
        ]
      },
      "BatchList": {
        "type": "object",
        "description": "A page of batches, newest first.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Batch"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "Hyperparameters": {
        "type": "object",
        "description": "Send hyperparameters at one level only: top level or under the method.",
        "properties": {
          "n_epochs": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Epochs.",
                "minimum": 1,
                "maximum": 10
              },
              {
                "type": "string",
                "const": "auto"
              }
            ],
            "default": 1
          },
          "batch_size": {
            "anyOf": [
              {
                "type": "integer",
                "description": "Batch size.",
                "minimum": 1,
                "maximum": 64
              },
              {
                "type": "string",
                "const": "auto"
              }
            ],
            "default": 8
          },
          "learning_rate_multiplier": {
            "anyOf": [
              {
                "type": "number",
                "description": "Times the default learning rate (0.0002).",
                "minimum": 0.01,
                "maximum": 10
              },
              {
                "type": "string",
                "const": "auto"
              }
            ],
            "default": 1
          },
          "learning_rate": {
            "type": "number",
            "description": "The learning rate, instead of learning_rate_multiplier. For DPO the range is 5e-8 to 0.01.",
            "minimum": 5e-8,
            "maximum": 0.01
          },
          "lora_rank": {
            "type": "integer",
            "description": "The LoRA rank. Some bases allow less than the maximum (see the docs).",
            "minimum": 1,
            "maximum": 64,
            "default": 16
          },
          "lora_alpha": {
            "type": "integer",
            "description": "The LoRA alpha.",
            "minimum": 1,
            "maximum": 256,
            "default": 32
          },
          "max_seq_length": {
            "type": "integer",
            "description": "The longest training sequence in tokens, up to the base's limit.",
            "minimum": 128,
            "default": 2048
          },
          "beta": {
            "anyOf": [
              {
                "type": "number",
                "description": "DPO only: the beta.",
                "exclusiveMinimum": 0,
                "maximum": 2
              },
              {
                "type": "string",
                "const": "auto"
              }
            ],
            "default": 0.1
          }
        }
      },
      "FineTuningMethod": {
        "description": "The training method. A string picks the adapter for supervised fine-tuning; the object form picks supervised or DPO. method.type \"reinforcement\" is refused with invalid_request. The default adapter depends on the base (see the docs).",
        "oneOf": [
          {
            "type": "string",
            "enum": [
              "lora",
              "qlora"
            ],
            "description": "Supervised fine-tuning with this adapter."
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "supervised",
                  "dpo"
                ],
                "description": "The method."
              },
              "supervised": {
                "type": "object",
                "properties": {
                  "hyperparameters": {
                    "$ref": "#/components/schemas/Hyperparameters"
                  },
                  "adapter": {
                    "type": "string",
                    "enum": [
                      "lora",
                      "qlora"
                    ],
                    "description": "The adapter."
                  }
                }
              },
              "dpo": {
                "type": "object",
                "properties": {
                  "hyperparameters": {
                    "$ref": "#/components/schemas/Hyperparameters"
                  },
                  "adapter": {
                    "type": "string",
                    "enum": [
                      "lora",
                      "qlora"
                    ],
                    "description": "The adapter."
                  }
                }
              }
            },
            "required": [
              "type"
            ]
          }
        ]
      },
      "FineTuningJobCreate": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "description": "A fine-tuning base model id (GET /models, the docs' base model table)."
          },
          "training_file": {
            "type": "string",
            "description": "A file id of an uploaded file.",
            "pattern": "^file-[a-f0-9]{32}$"
          },
          "validation_file": {
            "type": [
              "string",
              "null"
            ],
            "description": "A file id of an uploaded file.",
            "pattern": "^file-[a-f0-9]{32}$"
          },
          "seed": {
            "type": "integer",
            "description": "The random seed.",
            "minimum": 0,
            "maximum": 2147483647,
            "default": 0
          },
          "suffix": {
            "type": [
              "string",
              "null"
            ],
            "description": "Accepted for OpenAI compatibility and ignored; the response warns.",
            "maxLength": 64
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            }
          },
          "integrations": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "description": "Not offered.",
              "additionalProperties": true
            },
            "description": "Must be null or empty."
          },
          "dry_run": {
            "type": "boolean",
            "description": "Return the quote without creating the job.",
            "default": false
          },
          "hyperparameters": {
            "$ref": "#/components/schemas/Hyperparameters"
          },
          "method": {
            "$ref": "#/components/schemas/FineTuningMethod"
          }
        },
        "required": [
          "model",
          "training_file"
        ]
      },
      "FineTuningJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The job id.",
            "pattern": "^ftjob-[a-f0-9]{32}$"
          },
          "object": {
            "type": "string",
            "const": "fine_tuning.job"
          },
          "model": {
            "type": "string",
            "description": "The base model."
          },
          "created_at": {
            "type": "integer",
            "description": "When the job was created. Unix seconds."
          },
          "finished_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it ended. Unix seconds."
          },
          "fine_tuned_model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ft: model, once it can run batches."
          },
          "organization_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The account's organization segment."
          },
          "result_files": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "A file id."
            },
            "description": "Result files, such as the step metrics CSV."
          },
          "status": {
            "type": "string",
            "enum": [
              "validating_files",
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled"
            ],
            "description": "The job's state."
          },
          "validation_file": {
            "type": [
              "string",
              "null"
            ],
            "description": "The validation file."
          },
          "training_file": {
            "type": [
              "string",
              "null"
            ],
            "description": "The training file."
          },
          "hyperparameters": {
            "type": "object",
            "properties": {
              "n_epochs": {
                "type": "number",
                "description": "Epochs."
              },
              "batch_size": {
                "type": "number",
                "description": "Batch size."
              },
              "learning_rate_multiplier": {
                "type": "number",
                "description": "Learning rate multiplier."
              }
            }
          },
          "method": {
            "type": "object",
            "description": "The method and its hyperparameters.",
            "additionalProperties": true
          },
          "trained_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Tokens trained."
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code."
              },
              "message": {
                "type": "string",
                "description": "What went wrong."
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ],
                "description": ""
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "user_provided_suffix": {
            "type": [
              "string",
              "null"
            ],
            "description": "The suffix sent."
          },
          "seed": {
            "type": "integer",
            "description": "The seed."
          },
          "estimated_finish": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The estimated end. Unix seconds."
          },
          "integrations": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Always empty.",
              "additionalProperties": true
            }
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            }
          },
          "gridline": {
            "type": "object",
            "description": "Gridline extension: the adapter, the fine-tuned adapter, the quote, billing, progress and the training result.",
            "additionalProperties": true
          }
        },
        "required": [
          "id",
          "object",
          "model",
          "created_at",
          "status",
          "seed"
        ]
      },
      "FineTuningJobQuote": {
        "type": "object",
        "description": "The answer to a dry_run: nothing was created.",
        "properties": {
          "object": {
            "type": "string",
            "const": "fine_tuning.job.quote"
          },
          "dry_run": {
            "type": "boolean",
            "const": true
          },
          "model": {
            "type": "string",
            "description": "The base model."
          },
          "training_file": {
            "type": "string",
            "description": "The training file."
          },
          "validation_file": {
            "type": [
              "string",
              "null"
            ],
            "description": "The validation file."
          },
          "hyperparameters": {
            "type": "object",
            "description": "The hyperparameters the job would use.",
            "additionalProperties": true
          },
          "method": {
            "type": "object",
            "description": "The method the job would use.",
            "additionalProperties": true
          },
          "seed": {
            "type": "integer",
            "description": "The seed."
          },
          "adapter": {
            "type": "object",
            "description": "The adapter the job would train.",
            "additionalProperties": true
          },
          "quote": {
            "type": "object",
            "description": "Training tokens, epochs, estimated time, and the price: per_token carries the rate, the minimum and max_charge_usd.",
            "additionalProperties": true
          },
          "credit_check": {
            "type": "object",
            "properties": {
              "result": {
                "type": "string",
                "enum": [
                  "sufficient",
                  "insufficient",
                  "unchecked"
                ],
                "description": "The result."
              },
              "required_usd": {
                "type": "string",
                "description": "Credit the job needs. US dollars as a decimal string.",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "available_usd": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Credit available. US dollars as a decimal string.",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "message": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "An explanation."
              }
            },
            "required": [
              "result"
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "description": "Warning code."
                },
                "message": {
                  "type": "string",
                  "description": "The warning."
                }
              }
            }
          },
          "confirm": {
            "type": "string",
            "description": "How to create the job."
          }
        },
        "required": [
          "object",
          "dry_run",
          "model",
          "quote"
        ]
      },
      "FineTuningJobList": {
        "type": "object",
        "description": "A page of fine-tuning jobs, newest first.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FineTuningJob"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "FineTuningJobEvent": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "fine_tuning.job.event"
          },
          "id": {
            "type": "string",
            "description": "The event id."
          },
          "created_at": {
            "type": "integer",
            "description": "When it happened. Unix seconds."
          },
          "level": {
            "type": "string",
            "enum": [
              "info",
              "warn",
              "error"
            ],
            "description": "Severity."
          },
          "message": {
            "type": "string",
            "description": "The event."
          },
          "data": {
            "type": "object",
            "description": "Details, such as metrics.",
            "additionalProperties": true
          },
          "type": {
            "type": "string",
            "enum": [
              "message",
              "metrics"
            ],
            "description": "The event kind."
          }
        },
        "required": [
          "object",
          "id",
          "created_at",
          "level",
          "message",
          "type"
        ]
      },
      "FineTuningJobEventList": {
        "type": "object",
        "description": "A page of events, newest first.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FineTuningJobEvent"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "FineTuningJobCheckpoint": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "fine_tuning.job.checkpoint"
          },
          "id": {
            "type": "string",
            "description": "The checkpoint id."
          },
          "created_at": {
            "type": "integer",
            "description": "When it was saved. Unix seconds."
          },
          "fine_tuned_model_checkpoint": {
            "type": "string",
            "description": "The checkpoint's model id."
          },
          "step_number": {
            "type": "integer",
            "description": "The training step."
          },
          "fine_tuning_job_id": {
            "type": "string",
            "description": "The job."
          },
          "metrics": {
            "type": "object",
            "properties": {
              "step": {
                "type": [
                  "number",
                  "null"
                ],
                "description": ""
              },
              "train_loss": {
                "type": [
                  "number",
                  "null"
                ],
                "description": ""
              },
              "train_mean_token_accuracy": {
                "type": [
                  "number",
                  "null"
                ],
                "description": ""
              },
              "valid_loss": {
                "type": [
                  "number",
                  "null"
                ],
                "description": ""
              },
              "valid_mean_token_accuracy": {
                "type": [
                  "number",
                  "null"
                ],
                "description": ""
              },
              "full_valid_loss": {
                "type": [
                  "number",
                  "null"
                ],
                "description": ""
              },
              "full_valid_mean_token_accuracy": {
                "type": [
                  "number",
                  "null"
                ],
                "description": ""
              }
            }
          }
        },
        "required": [
          "object",
          "id",
          "created_at",
          "fine_tuned_model_checkpoint",
          "step_number"
        ]
      },
      "FineTuningJobCheckpointList": {
        "type": "object",
        "description": "A page of checkpoints.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FineTuningJobCheckpoint"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The model id: a catalog model, or ft:<base>:<org>:<id> for your fine-tuned models."
          },
          "object": {
            "type": "string",
            "const": "model"
          },
          "created": {
            "type": "integer",
            "description": "Unix seconds; 0 for catalog models."
          },
          "owned_by": {
            "type": "string",
            "description": "gridline for catalog models; your organization for ft: models."
          },
          "root": {
            "type": "string",
            "description": "The base model."
          },
          "parent": {
            "type": [
              "string",
              "null"
            ],
            "description": "The base of an ft: model."
          }
        },
        "required": [
          "id",
          "object",
          "created",
          "owned_by"
        ]
      },
      "ModelList": {
        "type": "object",
        "description": "The catalog models and your ft: models.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            }
          }
        },
        "required": [
          "object",
          "data"
        ]
      },
      "ModelDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ft: model."
          },
          "object": {
            "type": "string",
            "const": "model"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "object",
          "deleted"
        ]
      },
      "MergedWeights": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "gridline.merged_weights"
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The export or merge id."
          },
          "model": {
            "type": "string",
            "description": "The ft: model."
          },
          "base": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Base model."
              },
              "revision": {
                "type": "string",
                "description": "Base revision."
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed",
              "cancelled",
              "expired"
            ],
            "description": "The merge's state."
          },
          "merge_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The merge."
          },
          "created_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When the merge started. Unix seconds."
          },
          "finished_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it ended. Unix seconds."
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When the export is deleted. Unix seconds."
          },
          "bytes": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The export's size; an estimate before it succeeds."
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "path": {
                  "type": "string",
                  "description": "File path."
                },
                "bytes": {
                  "type": "integer",
                  "description": "Size."
                },
                "sha256": {
                  "type": "string",
                  "description": "SHA-256 hex."
                }
              },
              "required": [
                "path",
                "bytes",
                "sha256"
              ]
            }
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code."
              }
            },
            "required": [
              "code"
            ]
          }
        },
        "required": [
          "object",
          "model",
          "status",
          "files"
        ]
      },
      "MergedWeightsDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The export or merge."
          },
          "object": {
            "type": "string",
            "const": "gridline.merged_weights"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "object",
          "deleted"
        ]
      },
      "ApiKeyUsageList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "A key id, or \"unattributed\"."
                },
                "object": {
                  "type": "string",
                  "const": "gridline.usage.api_key"
                },
                "api_key_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The key id."
                },
                "key_prefix": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The key's prefix."
                },
                "batches": {
                  "type": "integer",
                  "description": "Batches."
                },
                "fine_tuning_jobs": {
                  "type": "integer",
                  "description": "Fine-tuning jobs."
                },
                "per_token_jobs": {
                  "type": "integer",
                  "description": "Jobs billed per token."
                },
                "tokens": {
                  "type": "object",
                  "description": "input, output and trained tokens as decimal strings.",
                  "additionalProperties": true
                },
                "held": {
                  "type": "object",
                  "description": "Held amount: micros and usd.",
                  "additionalProperties": true
                },
                "charged": {
                  "type": "object",
                  "description": "Charged amount: micros and usd.",
                  "additionalProperties": true
                },
                "limits": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "description": "The key's daily and total spend limits.",
                  "additionalProperties": true
                }
              },
              "required": [
                "id",
                "object"
              ]
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "has_more": {
            "type": "boolean",
            "description": "Always false."
          },
          "gridline": {
            "type": "object",
            "description": "The window (from, to), currency and the calling key's id.",
            "additionalProperties": true
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "ApiKeyJobList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The batch or job id."
                },
                "object": {
                  "type": "string",
                  "const": "gridline.usage.job"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "batch",
                    "fine_tune"
                  ],
                  "description": "The job kind."
                },
                "model": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The model."
                },
                "status": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The status."
                },
                "created_at": {
                  "type": "integer",
                  "description": "When it was created. Unix seconds."
                },
                "ended_at": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "When it ended. Unix seconds."
                },
                "gpu_seconds": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "GPU seconds."
                },
                "tokens": {
                  "type": "object",
                  "description": "input, output and trained tokens.",
                  "additionalProperties": true
                },
                "billing": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "How it is billed."
                },
                "charged_micros": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Charged, in millionths of a dollar."
                },
                "charged_usd": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Charged. US dollars as a decimal string.",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "held_micros": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Held, in millionths of a dollar."
                },
                "settlement": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "charged",
                    "partial",
                    "not_started",
                    "platform_fault"
                  ],
                  "description": "Settlement."
                },
                "receipt_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The receipt."
                },
                "api_key_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The key."
                },
                "key_prefix": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The key's prefix."
                }
              },
              "required": [
                "id",
                "object",
                "type",
                "created_at"
              ]
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more follow."
          },
          "gridline": {
            "type": "object",
            "description": "The window, the key's spend today and in total, and its limits.",
            "additionalProperties": true
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "EvalCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The eval's name.",
            "maxLength": 256
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            }
          },
          "data_source_config": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "custom"
              },
              "item_schema": {
                "type": "object",
                "description": "JSON Schema of each item.",
                "additionalProperties": true
              },
              "include_sample_schema": {
                "type": "boolean",
                "description": "Whether rows also carry a sample.",
                "default": false
              }
            },
            "required": [
              "type",
              "item_schema"
            ]
          },
          "testing_criteria": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A grader: string_check, text_similarity or score_model. label_model and python graders are refused.",
              "additionalProperties": true
            },
            "description": "1 to 8 criteria with unique names."
          }
        },
        "required": [
          "data_source_config",
          "testing_criteria"
        ]
      },
      "EvalUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The eval's name.",
            "maxLength": 256
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            }
          }
        }
      },
      "Eval": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "eval"
          },
          "id": {
            "type": "string",
            "description": "The eval id.",
            "pattern": "^eval_[a-f0-9]{32}$"
          },
          "name": {
            "type": "string",
            "description": "The name."
          },
          "data_source_config": {
            "type": "object",
            "description": "The item shape.",
            "additionalProperties": true
          },
          "testing_criteria": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A grader.",
              "additionalProperties": true
            }
          },
          "created_at": {
            "type": "integer",
            "description": "When it was created. Unix seconds."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata.",
            "additionalProperties": true
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "data_source_config",
          "testing_criteria",
          "created_at"
        ]
      },
      "EvalList": {
        "type": "object",
        "description": "A page of evals.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Eval"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "EvalDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "eval.deleted"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          },
          "eval_id": {
            "type": "string",
            "description": "The eval."
          }
        },
        "required": [
          "object",
          "deleted",
          "eval_id"
        ]
      },
      "EvalRunCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The run's name."
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            }
          },
          "data_source": {
            "type": "object",
            "description": "A jsonl source (rows with item and sample) or a completions source (a model, input_messages and sampling_params); its source is a file_id or file_content.",
            "additionalProperties": true
          },
          "dry_run": {
            "type": "boolean",
            "description": "Return the quote without starting the run.",
            "default": false
          }
        },
        "required": [
          "data_source"
        ]
      },
      "EvalRun": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "eval.run"
          },
          "id": {
            "type": "string",
            "description": "The run id.",
            "pattern": "^evalrun_[a-f0-9]{32}$"
          },
          "eval_id": {
            "type": "string",
            "description": "The eval."
          },
          "report_url": {
            "type": "null"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed",
              "canceled"
            ],
            "description": "The run's state."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The model sampled, for a completions source."
          },
          "name": {
            "type": "string",
            "description": "The name."
          },
          "created_at": {
            "type": "integer",
            "description": "When it was created. Unix seconds."
          },
          "result_counts": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": ""
              },
              "errored": {
                "type": "integer",
                "description": ""
              },
              "failed": {
                "type": "integer",
                "description": ""
              },
              "passed": {
                "type": "integer",
                "description": ""
              }
            }
          },
          "per_model_usage": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "description": "Usage per model.",
              "additionalProperties": true
            }
          },
          "per_testing_criteria_results": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "object",
              "description": "Passed and failed per criterion.",
              "additionalProperties": true
            }
          },
          "data_source": {
            "type": "object",
            "description": "The data source.",
            "additionalProperties": true
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": ""
              },
              "message": {
                "type": "string",
                "description": ""
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "metadata": {
            "type": "object",
            "description": "The metadata.",
            "additionalProperties": true
          },
          "gridline": {
            "type": "object",
            "description": "Gridline extension: the batches, results file, rows and quote.",
            "additionalProperties": true
          }
        },
        "required": [
          "object",
          "id",
          "eval_id",
          "status",
          "created_at"
        ]
      },
      "EvalRunQuote": {
        "type": "object",
        "description": "The answer to a dry_run: nothing was started.",
        "properties": {
          "object": {
            "type": "string",
            "const": "eval.run.quote"
          },
          "eval_id": {
            "type": "string",
            "description": "The eval."
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The model."
          },
          "rows": {
            "type": "integer",
            "description": "Rows to evaluate."
          },
          "skipped": {
            "type": "object",
            "description": "Rows skipped, by reason.",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "quote": {
            "type": "object",
            "description": "max_charge_usd, the batches it runs and the price version.",
            "additionalProperties": true
          },
          "confirm": {
            "type": "string",
            "description": "How to start the run."
          }
        },
        "required": [
          "object",
          "eval_id",
          "rows",
          "quote"
        ]
      },
      "EvalRunList": {
        "type": "object",
        "description": "A page of runs.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvalRun"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "EvalRunDeleted": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "eval.run.deleted"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          },
          "run_id": {
            "type": "string",
            "description": "The run."
          }
        },
        "required": [
          "object",
          "deleted",
          "run_id"
        ]
      },
      "EvalOutputItem": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "eval.run.output_item"
          },
          "id": {
            "type": "string",
            "description": "The output item id."
          },
          "run_id": {
            "type": "string",
            "description": "The run."
          },
          "eval_id": {
            "type": "string",
            "description": "The eval."
          },
          "created_at": {
            "type": "integer",
            "description": "When it was graded. Unix seconds."
          },
          "status": {
            "type": "string",
            "enum": [
              "pass",
              "fail"
            ],
            "description": "The row's result."
          },
          "datasource_item_id": {
            "type": "integer",
            "description": "The row's index."
          },
          "datasource_item": {
            "type": "object",
            "description": "The row's item.",
            "additionalProperties": true
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Criterion."
                },
                "type": {
                  "type": "string",
                  "description": "Grader type."
                },
                "score": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Score."
                },
                "passed": {
                  "type": "boolean",
                  "description": "Passed."
                }
              }
            }
          },
          "sample": {
            "type": [
              "object",
              "null"
            ],
            "description": "The sampled input, output and usage.",
            "additionalProperties": true
          }
        },
        "required": [
          "object",
          "id",
          "run_id",
          "eval_id",
          "status",
          "results"
        ]
      },
      "EvalOutputItemList": {
        "type": "object",
        "description": "A page of graded rows.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EvalOutputItem"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "WebhookEndpointCreate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "An https URL on a public hostname, up to 2,048 characters, with no user info or IP address.",
            "format": "uri",
            "maxLength": 2048
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "batch.completed",
                "batch.failed",
                "batch.cancelled",
                "batch.expired",
                "fine_tuning.job.succeeded",
                "fine_tuning.job.failed",
                "fine_tuning.job.cancelled"
              ],
              "description": "An event type."
            },
            "description": "The events to send. Default: all of them."
          }
        },
        "required": [
          "url"
        ]
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint id.",
            "pattern": "^whep_[a-f0-9]{32}$"
          },
          "object": {
            "type": "string",
            "const": "gridline.webhook_endpoint"
          },
          "url": {
            "type": "string",
            "description": "The URL."
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "An event type."
            }
          },
          "created_at": {
            "type": "integer",
            "description": "When it was created. Unix seconds."
          },
          "secret": {
            "type": "string",
            "description": "The signing secret (whsec_...). Only on create and rotate_secret."
          },
          "previous_secret_expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "While a rotated secret is still accepted: when it stops. Unix seconds."
          }
        },
        "required": [
          "id",
          "object",
          "url",
          "event_types",
          "created_at"
        ]
      },
      "WebhookEndpointList": {
        "type": "object",
        "description": "Your endpoints, oldest first.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "WebhookEndpointDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint."
          },
          "object": {
            "type": "string",
            "const": "gridline.webhook_endpoint"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "id",
          "object",
          "deleted"
        ]
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The delivery id."
          },
          "object": {
            "type": "string",
            "const": "gridline.webhook_delivery"
          },
          "event_id": {
            "type": "string",
            "description": "The event."
          },
          "type": {
            "type": "string",
            "description": "The event type."
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The batch or job the event is about."
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "delivering",
              "delivered",
              "failed"
            ],
            "description": "Delivery state."
          },
          "attempts": {
            "type": "integer",
            "description": "Attempts so far."
          },
          "last_status_code": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The last HTTP status your endpoint answered."
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last error."
          },
          "next_attempt_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The next attempt. Unix seconds."
          },
          "delivered_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it was delivered. Unix seconds."
          },
          "created_at": {
            "type": "integer",
            "description": "When it was created. Unix seconds."
          }
        },
        "required": [
          "id",
          "object",
          "event_id",
          "type",
          "status",
          "attempts",
          "created_at"
        ]
      },
      "WebhookDeliveryList": {
        "type": "object",
        "description": "The most recent deliveries, newest first.",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            }
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first item's id."
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last item's id; pass it as after for the next page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether more items follow."
          }
        },
        "required": [
          "object",
          "data",
          "has_more"
        ]
      },
      "DistillationJobCreate": {
        "type": "object",
        "properties": {
          "teacher": {
            "type": "string",
            "description": "The teacher: a chat model GET /models lists."
          },
          "student": {
            "type": "string",
            "description": "The student: a fine-tuning base model."
          },
          "prompts_file": {
            "type": "string",
            "description": "A file id of an uploaded file.",
            "pattern": "^file-[a-f0-9]{32}$"
          },
          "n_epochs": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Epochs.",
            "minimum": 1,
            "maximum": 10
          },
          "method": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "lora",
              "qlora"
            ],
            "description": "The adapter."
          },
          "lora_rank": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The LoRA rank.",
            "minimum": 1,
            "maximum": 64
          },
          "max_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Teacher answer length.",
            "minimum": 1
          },
          "temperature": {
            "type": [
              "number",
              "null"
            ],
            "description": "Teacher temperature.",
            "minimum": 0,
            "maximum": 2
          },
          "validation_split": {
            "type": "number",
            "description": "Share held out for validation.",
            "minimum": 0,
            "exclusiveMaximum": 1,
            "default": 0.1
          },
          "run_student_batch": {
            "type": "boolean",
            "description": "Run the fine-tuned student on the held-out prompts.",
            "default": true
          },
          "keep_truncated": {
            "type": "boolean",
            "description": "Keep teacher answers cut off by max_tokens.",
            "default": false
          },
          "student_system": {
            "type": [
              "string",
              "null"
            ],
            "description": "A system message for the student's training rows."
          },
          "spend_cap_usd": {
            "type": [
              "number",
              "null"
            ],
            "description": "The most the job may spend.",
            "exclusiveMinimum": 0,
            "maximum": 10000
          },
          "dry_run": {
            "type": "boolean",
            "description": "Return the quote without creating the job.",
            "default": false
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            }
          }
        },
        "required": [
          "teacher",
          "student",
          "prompts_file"
        ]
      },
      "DistillationJob": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "distillation.job"
          },
          "id": {
            "type": "string",
            "description": "The job id.",
            "pattern": "^distjob-[a-f0-9]{32}$"
          },
          "created_at": {
            "type": "integer",
            "description": "When it was created. Unix seconds."
          },
          "finished_at": {
            "type": [
              "integer",
              "null"
            ],
            "description": "When it ended. Unix seconds."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "cancelling",
              "succeeded",
              "failed",
              "cancelled"
            ],
            "description": "The job's state."
          },
          "stage": {
            "type": "string",
            "enum": [
              "teacher_batch",
              "distill",
              "fine_tune",
              "student_batch"
            ],
            "description": "The step running or last run."
          },
          "teacher": {
            "type": "string",
            "description": "The teacher."
          },
          "student": {
            "type": "string",
            "description": "The student."
          },
          "prompts_file": {
            "type": "string",
            "description": "The prompts file."
          },
          "fine_tuned_model": {
            "type": [
              "string",
              "null"
            ],
            "description": "The ft: model, once trained."
          },
          "options": {
            "type": "object",
            "description": "The options the job runs with.",
            "additionalProperties": true
          },
          "spend_cap_usd": {
            "type": [
              "string",
              "null"
            ],
            "description": "The spend cap. US dollars as a decimal string.",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "stages": {
            "type": "object",
            "description": "Each step's ids, status and charge.",
            "additionalProperties": true
          },
          "costs": {
            "type": "object",
            "description": "Each step's cost and the total.",
            "additionalProperties": true
          },
          "quote": {
            "type": "object",
            "description": "The quote at create.",
            "additionalProperties": true
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": ""
              },
              "message": {
                "type": "string",
                "description": ""
              }
            },
            "required": [
              "code",
              "message"
            ]
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Up to 16 key-value pairs. Keys are 1 to 64 characters and may not start with gridline_; values are strings of up to 512 characters.",
            "maxProperties": 16,
            "additionalProperties": {
              "type": "string",
              "maxLength": 512
            }
          }
        },
        "required": [
          "object",
          "id",
          "created_at",
          "status",
          "stage",
          "teacher",
          "student"
        ]
      },
      "DistillationQuote": {
        "type": "object",
        "description": "The answer to a dry_run: nothing was created.",
        "properties": {
          "object": {
            "type": "string",
            "const": "distillation.quote"
          },
          "dry_run": {
            "type": "boolean",
            "const": true
          },
          "teacher": {
            "type": "string",
            "description": "The teacher."
          },
          "student": {
            "type": "string",
            "description": "The student."
          },
          "teacher_batch": {
            "type": "object",
            "description": "The teacher batch's tokens and price.",
            "additionalProperties": true
          },
          "fine_tune": {
            "type": "object",
            "description": "The fine-tune's tokens and price.",
            "additionalProperties": true
          },
          "student_batch": {
            "type": [
              "object",
              "null"
            ],
            "description": "The student batch's tokens and price.",
            "additionalProperties": true
          },
          "max_total_usd": {
            "type": "string",
            "description": "The most the job can cost. US dollars as a decimal string.",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "spend_cap_usd": {
            "type": [
              "string",
              "null"
            ],
            "description": "The spend cap. US dollars as a decimal string.",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "within_cap": {
            "type": "boolean",
            "description": "Whether the quote fits the cap."
          }
        },
        "required": [
          "object",
          "dry_run",
          "max_total_usd"
        ]
      }
    }
  },
  "x-api-lifecycle": {
    "current_major_version": "v1",
    "deprecation_policy_url": "https://gridlinegpu.com/docs/openai-migration#versioning"
  }
}
