{
  "openapi": "3.1.0",
  "info": {
    "title": "Oppermind Developer API",
    "version": "2026-10-02",
    "summary": "Text, document, image and video generation with Oppermind Lato 1.",
    "description": "The Oppermind Developer API exposes Oppermind Lato 1 over a stable, versioned HTTP contract.\n\n- **Base URL:** `https://www.oppermind.com/api/v1`\n- **Auth:** bearer API key (`Authorization: Bearer opmd_sk_...`). Create keys at https://www.oppermind.com/developers/dashboard.\n- **Text endpoints:** `POST /api/v1/messages` (alias `POST /api/v1/chat`) takes a Chat Completions style request and returns the Oppermind native response. `POST /api/v1/chat/completions` takes and returns the Chat Completions format, so existing Chat Completions client libraries work by changing the base URL and model. `POST /api/v1/responses` takes and returns the Responses API format and is stateless.\n- **Inputs:** text, images (JPEG, PNG, GIF or WebP as a base64 data URL, or JPEG or PNG as an https URL) and documents (PDF including scanned PDFs, Word (DOCX, DOCM, DOC), Excel (XLSX, XLSM, XLS), PowerPoint (PPTX, PPTM, PPT), OpenDocument (ODT, ODS, ODP), project schedules (Microsoft Project MPP and XML, Primavera P6 XER and XML, MPX), CSV, TXT, MD, JSON and code files) as `file` parts. Upload documents once with the Files API and reference them by `file_id`, or send them inline as base64 `file_data`.\n- **Tools:** client function calling plus the built-in tools `web_search`, `x_search`, `code_interpreter` and `mcp` (remote MCP servers). A tool or option the current model version cannot use returns 400 `OPMD_CAPABILITY_001` with a message that names it.\n- **Limits:** request bodies up to 31 MB, up to 2000 messages per request, output up to 128000 tokens (default 16384, reasoning tokens count as output), 120 requests per minute per API key unless your key has a different limit. Send `stream: true` for server-sent events.\n- **Billing:** prepaid AUD credit. Rates are Oppermind's own AUD rates per million input, cached input and output tokens, per built-in tool call, per image and per second of video. Rates can change. Read the current rates from `GET /api/v1/pricing` or the developer dashboard. Every text response reports its exact charge in `billing.charged_aud`. Requests the model rejects are not charged. Replies with no answer (`OPMD_EMPTY_001`) are not charged unless built-in tools already ran or more than 20 requests in the past hour returned no answer.\n- **Idempotency:** every `POST` endpoint accepts an `Idempotency-Key` request header. A retry with the same key returns the original response.\n- **Rate limits:** responses carry the standard `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` headers.\n- **Errors:** `/api/v1/messages`, `/api/v1/images` and `/api/v1/videos` return `{ \"error\": { \"type\", \"code\", \"message\" } }`. `/api/v1/chat/completions`, `/api/v1/responses` and `/api/v1/files` return `{ \"error\": { \"message\", \"type\", \"code\", \"param\" } }`. Authentication and rate-limit errors use the first shape on every endpoint. Branch on `error.code`.\n- **Versioning:** URL-prefixed (`/api/v1/`). The dated `info.version` and the `X-API-Version` response header identify the contract build. Deprecated endpoints emit `Deprecation` and `Sunset` headers. The policy is at `/api/v1/changelog`.\n\nModel identifiers are `oppermind-lato-1` (text), `oppermind-lato-1-vision` (images) and `oppermind-lato-1-video` (video). Any `model` value in a request is accepted and the response always reports the Oppermind identifier.",
    "contact": {
      "name": "Oppermind Developer Support",
      "email": "enquiry@oppermind.com",
      "url": "https://www.oppermind.com/developers/dashboard"
    },
    "license": {
      "name": "Proprietary - (c) Oppermind Pty Ltd",
      "url": "https://www.oppermind.com/terms"
    }
  },
  "servers": [
    {
      "url": "https://www.oppermind.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Text",
      "description": "Text generation with documents, images and tools."
    },
    {
      "name": "Files",
      "description": "Upload documents and images once and reference them by file_id."
    },
    {
      "name": "Images",
      "description": "Image generation."
    },
    {
      "name": "Video",
      "description": "Synchronous video generation."
    },
    {
      "name": "Account",
      "description": "Pricing, the contract and the changelog."
    }
  ],
  "paths": {
    "/api/v1/messages": {
      "post": {
        "tags": [
          "Text"
        ],
        "operationId": "createMessage",
        "summary": "Create a message (Oppermind native response)",
        "description": "Accepts a Chat Completions style request body (`messages`, `tools`, `response_format` and the other options in `ChatRequest`) and returns the Oppermind native message body. `POST /api/v1/chat` is an alias of this endpoint.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              },
              "example": {
                "model": "oppermind-lato-1",
                "max_tokens": 1024,
                "messages": [
                  {
                    "role": "user",
                    "content": "Write a haiku about Perth."
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message produced.",
            "headers": {
              "X-Request-ID": {
                "$ref": "#/components/headers/XRequestId"
              },
              "X-API-Version": {
                "$ref": "#/components/headers/XApiVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-sent events when stream is true. See the Streaming section of https://www.oppermind.com/developers/docs"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/chat": {
      "post": {
        "tags": [
          "Text"
        ],
        "operationId": "createChat",
        "summary": "Alias of POST /api/v1/messages",
        "description": "Same request, response and errors as `POST /api/v1/messages`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message produced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-sent events when stream is true. See the Streaming section of https://www.oppermind.com/developers/docs"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          }
        }
      }
    },
    "/api/v1/chat/completions": {
      "post": {
        "tags": [
          "Text"
        ],
        "operationId": "createChatCompletion",
        "summary": "Create a chat completion (Chat Completions format)",
        "description": "Chat Completions compatible request and response. Point an existing Chat Completions client library at `https://www.oppermind.com/api/v1` with model `oppermind-lato-1`. Only `n = 1` is supported. `logprobs`, `logit_bias`, the legacy `functions` / `function_call` fields and non-text output modalities return 400 `OPMD_MODEL_001`. Errors use the `{ message, type, code, param }` envelope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              },
              "example": {
                "model": "oppermind-lato-1",
                "messages": [
                  {
                    "role": "system",
                    "content": "Answer in one sentence."
                  },
                  {
                    "role": "user",
                    "content": "What is the capital of Western Australia?"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completion produced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletion"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-sent events when stream is true. See the Streaming section of https://www.oppermind.com/developers/docs"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/responses": {
      "post": {
        "tags": [
          "Text"
        ],
        "operationId": "createResponse",
        "summary": "Create a response (Responses API format, stateless)",
        "description": "Responses API compatible request and response. The endpoint is stateless: send the whole conversation in `input` every time. `previous_response_id`, `conversation`, stored `prompt` templates, `store: true` and `background: true` return 400 `OPMD_MODEL_001`. `seed` and `stop` are read on the Chat Completions endpoints only. Errors use the `{ message, type, code, param }` envelope.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              },
              "example": {
                "model": "oppermind-lato-1",
                "instructions": "Answer in one sentence.",
                "input": "What is the capital of Western Australia?"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Response produced. `status` is `incomplete` when the output token limit or a content filter stopped the reply.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseObject"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "Server-sent events when stream is true. See the Streaming section of https://www.oppermind.com/developers/docs"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/files": {
      "post": {
        "tags": [
          "Files"
        ],
        "operationId": "uploadFile",
        "summary": "Upload a file",
        "description": "Send the raw file bytes as the body (any non-JSON Content-Type, for example `application/octet-stream`) with the filename in the `X-Filename` header (URL-encoded) or the `filename` query parameter, or send JSON `{ \"filename\", \"data\", \"mime_type\"?, \"purpose\"? }` where `data` is base64 or a base64 data URL, or multipart/form-data with the file in a field named `file` and an optional `purpose` field. Up to 31 MB per request (base64 in JSON adds about a third, so a JSON upload carries about 23 MB of file). An account keeps up to 1000 files and 10 GiB in total. The file type is detected from the file's bytes where possible. Keys with `read` permission cannot upload.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "X-Filename",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Raw uploads: the filename, URL-encoded with encodeURIComponent."
          },
          {
            "name": "filename",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Raw uploads: the filename, when X-Filename is not sent."
          },
          {
            "name": "X-Purpose",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$"
            },
            "description": "Raw uploads: an optional label. Defaults to user_data."
          },
          {
            "name": "purpose",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,64}$"
            },
            "description": "Raw uploads: an optional label, when X-Purpose is not sent."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileUploadJson"
              },
              "example": {
                "filename": "report.pdf",
                "data": "data:application/pdf;base64,JVBERi0xLjcK..."
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file. One file per request."
                  },
                  "purpose": {
                    "type": "string"
                  },
                  "filename": {
                    "type": "string",
                    "description": "Overrides the part filename."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileObject"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "listFiles",
        "summary": "List files",
        "description": "Your stored files, newest first.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A file id from a previous page (`last_id`). Returns the files after it."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of files.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/files/{file_id}": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "getFile",
        "summary": "Get a file's details",
        "parameters": [
          {
            "$ref": "#/components/parameters/FileId"
          }
        ],
        "responses": {
          "200": {
            "description": "File details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileObject"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Files"
        ],
        "operationId": "deleteFile",
        "summary": "Delete a file",
        "description": "Removes the file and its stored bytes. Keys with `read` permission cannot delete.",
        "parameters": [
          {
            "$ref": "#/components/parameters/FileId"
          }
        ],
        "responses": {
          "200": {
            "description": "File deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/files/{file_id}/content": {
      "get": {
        "tags": [
          "Files"
        ],
        "operationId": "getFileContent",
        "summary": "Download a file's bytes",
        "parameters": [
          {
            "$ref": "#/components/parameters/FileId"
          }
        ],
        "responses": {
          "200": {
            "description": "The file bytes as an attachment.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/pricing": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getPricing",
        "summary": "Current rates in AUD",
        "description": "The current Oppermind Lato 1 rates in AUD. Rates can change. Each text response reports its exact charge in `billing.charged_aud`.",
        "responses": {
          "200": {
            "description": "Current rates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pricing"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          }
        }
      }
    },
    "/api/v1/images": {
      "post": {
        "tags": [
          "Images"
        ],
        "operationId": "createImage",
        "summary": "Generate images",
        "description": "Generates 1 to 4 images from a prompt of up to 8 KB. Some options (quality, size, aspect_ratio, resolution, response_format) may not apply on every model version. Image URLs are proxy paths you fetch with the same bearer key. Keys with `text` or `read` permission cannot generate images. When the current setup has no image model the endpoint returns 400 `OPMD_CAPABILITY_001`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageRequest"
              },
              "example": {
                "prompt": "A red dragon over the Swan River at dusk",
                "n": 1,
                "response_format": "url"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Images generated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/images/proxy": {
      "get": {
        "tags": [
          "Images"
        ],
        "operationId": "getImageBytes",
        "summary": "Download a generated image",
        "description": "The `url` values returned by `POST /api/v1/images` point here. Only the key's own account can fetch its images.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes.",
            "content": {
              "image/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Missing token."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Token expired or invalid."
          }
        }
      }
    },
    "/api/v1/videos": {
      "post": {
        "tags": [
          "Video"
        ],
        "operationId": "createVideo",
        "summary": "Generate a video synchronously",
        "description": "Generates a video and returns `200` with the finished video `url`. Generation can take minutes, so allow a generous client timeout. Durations are 1 to 15 seconds (values outside that range are clamped). The `url` is a proxy path you fetch with the same bearer key. Requires a key with `full` permission. There is no job to poll.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoRequest"
              },
              "example": {
                "prompt": "Timelapse of the Perth city skyline",
                "duration_seconds": 10,
                "resolution": "1080p"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Video generated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/ServerError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/v1/videos/proxy": {
      "get": {
        "tags": [
          "Video"
        ],
        "operationId": "getVideoBytes",
        "summary": "Download a generated video",
        "description": "The `url` returned by `POST /api/v1/videos` points here. Only the key's own account can fetch its videos.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video bytes.",
            "content": {
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Missing token."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Token expired or invalid."
          }
        }
      }
    },
    "/api/v1/videos/{id}": {
      "get": {
        "tags": [
          "Video"
        ],
        "operationId": "getVideo",
        "summary": "Confirm a video (no polling needed)",
        "description": "Videos are generated synchronously, so the finished video `url` is in the `POST /api/v1/videos` response. This endpoint returns a confirmation message only.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Request id from the create response."
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmation that generation is synchronous.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getOpenApi",
        "summary": "This specification (machine-readable). Public: no API key needed.",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document."
          }
        }
      }
    },
    "/api/v1/changelog": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getChangelog",
        "summary": "Machine-readable changelog and deprecation policy. Requires a valid API key.",
        "responses": {
          "200": {
            "description": "Changelog document."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opmd_sk_*",
        "description": "API key issued at /developers. Send as `Authorization: Bearer opmd_sk_...`."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{8,255}$"
        },
        "description": "Unique key (for example a UUID). Retrying a POST with the same key returns the original response instead of performing the action twice. Scoped per API key, retained 24 hours. Only successful responses are stored, so a failed request can be retried with the same key."
      },
      "FileId": {
        "name": "file_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^file-[0-9a-f]{32}$"
        },
        "description": "A file id returned by POST /api/v1/files."
      }
    },
    "headers": {
      "XRequestId": {
        "description": "Unique request id. Quote it to support.",
        "schema": {
          "type": "string",
          "example": "req_0123456789abcdef01234567"
        }
      },
      "XApiVersion": {
        "description": "Dated contract build.",
        "schema": {
          "type": "string",
          "example": "2026-10-02"
        }
      },
      "RateLimitLimit": {
        "description": "Requests allowed per minute for this key.",
        "schema": {
          "type": "integer",
          "example": 120
        }
      },
      "RateLimitRemaining": {
        "description": "Requests left in the current window.",
        "schema": {
          "type": "integer"
        }
      },
      "RateLimitReset": {
        "description": "Seconds until the window resets.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "schemas": {
      "TextPart": {
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "input_text",
              "output_text"
            ]
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ImageUrlPart": {
        "type": "object",
        "required": [
          "type",
          "image_url"
        ],
        "description": "An image as an https URL or a base64 data URL (JPEG, PNG, GIF or WebP). A PDF sent as a data URL here is read as a document.",
        "properties": {
          "type": {
            "type": "string",
            "const": "image_url"
          },
          "image_url": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "https URL or data:<mime>;base64,<data>"
                  },
                  "detail": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "low",
                      "high"
                    ]
                  }
                }
              }
            ]
          }
        }
      },
      "InputImagePart": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "Responses format image part. Send image_url (https URL or base64 data URL) or file_id.",
        "properties": {
          "type": {
            "type": "string",
            "const": "input_image"
          },
          "image_url": {
            "type": "string"
          },
          "file_id": {
            "type": "string"
          },
          "detail": {
            "type": "string",
            "enum": [
              "auto",
              "low",
              "high"
            ]
          }
        }
      },
      "FileRef": {
        "type": "object",
        "description": "Send one of file_id, file_data or file_url. Documents can be PDF (including scanned PDFs), Word (DOCX, DOCM, DOC), Excel (XLSX, XLSM, XLS), PowerPoint (PPTX, PPTM, PPT), OpenDocument (ODT, ODS, ODP), project schedules (Microsoft Project MPP and XML, Primavera P6 XER and XML, MPX), CSV, TXT, MD, JSON or code files. Scanned PDFs are read page by page. A file that cannot be read returns 422 OPMD_FILE_002. Text beyond 1,000,000 characters per document is cut off with a note.",
        "properties": {
          "file_id": {
            "type": "string",
            "description": "An id from POST /api/v1/files."
          },
          "file_data": {
            "type": "string",
            "description": "A base64 data URL (data:<mime>;base64,<data>) or bare base64. With bare base64, the filename extension sets the type."
          },
          "file_url": {
            "type": "string",
            "format": "uri",
            "description": "An https URL to the document. Not every model version can read documents by URL. When it cannot, the request returns 400 OPMD_CAPABILITY_001. Prefer file_id or file_data."
          },
          "filename": {
            "type": "string"
          }
        }
      },
      "FilePart": {
        "type": "object",
        "required": [
          "type",
          "file"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "file"
          },
          "file": {
            "$ref": "#/components/schemas/FileRef"
          }
        }
      },
      "InputFilePart": {
        "description": "Responses format document part: type input_file with the FileRef fields at the top level.",
        "allOf": [
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "input_file"
              }
            }
          },
          {
            "$ref": "#/components/schemas/FileRef"
          }
        ]
      },
      "ContentPart": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/TextPart"
          },
          {
            "$ref": "#/components/schemas/ImageUrlPart"
          },
          {
            "$ref": "#/components/schemas/InputImagePart"
          },
          {
            "$ref": "#/components/schemas/FilePart"
          },
          {
            "$ref": "#/components/schemas/InputFilePart"
          }
        ]
      },
      "MessageContent": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContentPart"
            }
          }
        ]
      },
      "ToolCall": {
        "type": "object",
        "required": [
          "id",
          "type",
          "function"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "const": "function"
          },
          "function": {
            "type": "object",
            "required": [
              "name",
              "arguments"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "arguments": {
                "type": "string",
                "description": "JSON-encoded arguments."
              }
            }
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "required": [
          "role"
        ],
        "description": "system and developer messages are text only and are joined into the system instructions. user messages carry text, images and documents. assistant messages carry text and/or tool_calls. tool messages return a function result and need the tool_call_id of an earlier assistant tool call.",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "developer",
              "user",
              "assistant",
              "tool"
            ]
          },
          "content": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MessageContent"
              },
              {
                "type": "null"
              }
            ]
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolCall"
            }
          },
          "tool_call_id": {
            "type": "string"
          }
        }
      },
      "FunctionTool": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "A function your code runs. Chat Completions format nests the definition under `function`. Responses format puts `name`, `description`, `parameters` and `strict` at the top level. Both shapes work on every text endpoint.",
        "properties": {
          "type": {
            "type": "string",
            "const": "function"
          },
          "function": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "description": {
                "type": "string"
              },
              "parameters": {
                "type": "object",
                "description": "JSON Schema for the arguments."
              },
              "strict": {
                "type": "boolean"
              }
            }
          },
          "name": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "description": {
            "type": "string"
          },
          "parameters": {
            "type": "object"
          },
          "strict": {
            "type": "boolean"
          }
        }
      },
      "WebSearchTool": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "Built-in web search. Limit it to allowed domains or away from excluded domains, not both. Citations come back in the response.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "web_search",
              "web_search_preview"
            ]
          },
          "filters": {
            "type": "object",
            "properties": {
              "allowed_domains": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "excluded_domains": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "max_uses": {
            "type": "integer",
            "minimum": 1,
            "description": "Caps the number of searches. Returns 400 OPMD_CAPABILITY_001 on model versions that cannot enforce a cap."
          }
        }
      },
      "XSearchTool": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "Built-in search of posts on X. Limit it to allowed handles or away from excluded handles, not both.",
        "properties": {
          "type": {
            "type": "string",
            "const": "x_search"
          },
          "allowed_x_handles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "excluded_x_handles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "from_date": {
            "type": "string",
            "format": "date"
          },
          "to_date": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "CodeInterpreterTool": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "Built-in code execution in a sandbox.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "code_interpreter",
              "code_execution"
            ]
          }
        }
      },
      "McpTool": {
        "type": "object",
        "required": [
          "type",
          "server_url",
          "server_label"
        ],
        "description": "A remote MCP server the model can call during the request.",
        "properties": {
          "type": {
            "type": "string",
            "const": "mcp"
          },
          "server_url": {
            "type": "string",
            "format": "uri",
            "description": "https only."
          },
          "server_label": {
            "type": "string"
          },
          "server_description": {
            "type": "string"
          },
          "allowed_tools": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "object",
                "properties": {
                  "tool_names": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            ]
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "authorization": {
            "type": "string"
          }
        }
      },
      "Tool": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/FunctionTool"
          },
          {
            "$ref": "#/components/schemas/WebSearchTool"
          },
          {
            "$ref": "#/components/schemas/XSearchTool"
          },
          {
            "$ref": "#/components/schemas/CodeInterpreterTool"
          },
          {
            "$ref": "#/components/schemas/McpTool"
          }
        ]
      },
      "ToolChoice": {
        "oneOf": [
          {
            "type": "string",
            "enum": [
              "auto",
              "none",
              "required"
            ]
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "function"
              },
              "name": {
                "type": "string"
              },
              "function": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ]
      },
      "ResponseFormat": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "json_object",
              "json_schema"
            ]
          },
          "json_schema": {
            "type": "object",
            "required": [
              "schema"
            ],
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              "schema": {
                "type": "object"
              },
              "strict": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "ReasoningEffort": {
        "type": "string",
        "enum": [
          "none",
          "minimal",
          "low",
          "medium",
          "high",
          "xhigh"
        ]
      },
      "ChatRequest": {
        "type": "object",
        "required": [
          "messages"
        ],
        "properties": {
          "model": {
            "type": "string",
            "default": "oppermind-lato-1"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            },
            "minItems": 1,
            "maxItems": 2000,
            "description": "Must include at least one user message. More than 2000 entries returns 400 OPMD_MODEL_002."
          },
          "system": {
            "type": "string",
            "description": "Optional system instructions, joined with any system or developer messages."
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            }
          },
          "tool_choice": {
            "$ref": "#/components/schemas/ToolChoice"
          },
          "parallel_tool_calls": {
            "type": "boolean"
          },
          "web_search_options": {
            "type": "object",
            "description": "Any object here adds the web_search tool."
          },
          "response_format": {
            "$ref": "#/components/schemas/ResponseFormat"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "Output token limit. Default 16384. Values above 128000 are lowered to 128000. Reasoning tokens count as output."
          },
          "max_completion_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "Same as max_tokens. It wins when both are sent."
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "description": "Model default when omitted."
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "seed": {
            "type": "integer"
          },
          "stop": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "Some model versions do not support stop sequences and return 400 OPMD_CAPABILITY_001."
          },
          "reasoning_effort": {
            "$ref": "#/components/schemas/ReasoningEffort"
          },
          "prompt_cache_key": {
            "type": "string",
            "description": "Optional. Caching is automatic: a repeated opening (system text, tools, documents) is served from cache, billed at the lower cached input rate and reported as cached tokens in usage. The same key on related requests raises the cache hit rate. Only input is cached."
          },
          "user": {
            "type": "string",
            "description": "Your id for the end user."
          },
          "safety_identifier": {
            "type": "string",
            "description": "Alias of user."
          },
          "stream": {
            "type": "boolean",
            "description": "true sends the reply as server-sent events (text/event-stream), about 100 tokens behind the model."
          },
          "stream_options": {
            "type": "object",
            "properties": {
              "include_usage": {
                "type": "boolean",
                "description": "With stream: true, also send usage in a final chunk with empty choices (/chat/completions)."
              }
            }
          }
        }
      },
      "ResponsesMessageItem": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "message"
          },
          "role": {
            "type": "string",
            "enum": [
              "system",
              "developer",
              "user",
              "assistant"
            ]
          },
          "content": {
            "$ref": "#/components/schemas/MessageContent"
          }
        }
      },
      "ResponsesFunctionCallItem": {
        "type": "object",
        "required": [
          "type",
          "call_id",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "function_call"
          },
          "call_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "arguments": {
            "type": "string"
          }
        }
      },
      "ResponsesFunctionCallOutputItem": {
        "type": "object",
        "required": [
          "type",
          "call_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "function_call_output"
          },
          "call_id": {
            "type": "string",
            "description": "Must match an earlier function_call item."
          },
          "output": {
            "$ref": "#/components/schemas/MessageContent"
          }
        }
      },
      "ResponsesReasoningItem": {
        "type": "object",
        "required": [
          "type"
        ],
        "description": "Accepted and ignored, so you can send back the output of a previous response unchanged.",
        "properties": {
          "type": {
            "type": "string",
            "const": "reasoning"
          }
        }
      },
      "ResponsesInputItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ResponsesMessageItem"
          },
          {
            "$ref": "#/components/schemas/ResponsesFunctionCallItem"
          },
          {
            "$ref": "#/components/schemas/ResponsesFunctionCallOutputItem"
          },
          {
            "$ref": "#/components/schemas/ResponsesReasoningItem"
          }
        ]
      },
      "ResponsesRequest": {
        "type": "object",
        "required": [
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "default": "oppermind-lato-1"
          },
          "instructions": {
            "type": "string"
          },
          "input": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ResponsesInputItem"
                },
                "minItems": 1,
                "maxItems": 2000
              }
            ],
            "description": "Must include at least one user message. More than 2000 items returns 400 OPMD_MODEL_002."
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            }
          },
          "tool_choice": {
            "$ref": "#/components/schemas/ToolChoice"
          },
          "parallel_tool_calls": {
            "type": "boolean"
          },
          "text": {
            "type": "object",
            "properties": {
              "format": {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "json_object",
                      "json_schema"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "schema": {
                    "type": "object"
                  },
                  "strict": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "max_output_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "Output token limit. Default 16384. Values above 128000 are lowered to 128000. Reasoning tokens count as output."
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2,
            "description": "Model default when omitted."
          },
          "top_p": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "reasoning": {
            "type": "object",
            "properties": {
              "effort": {
                "$ref": "#/components/schemas/ReasoningEffort"
              }
            }
          },
          "prompt_cache_key": {
            "type": "string",
            "description": "Optional. Caching is automatic: a repeated opening (system text, tools, documents) is served from cache and billed at the lower cached input rate. The same key on related requests raises the cache hit rate. Only input is cached."
          },
          "include": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "user": {
            "type": "string"
          },
          "safety_identifier": {
            "type": "string"
          },
          "stream": {
            "type": "boolean",
            "description": "true sends the reply as server-sent events (text/event-stream), ending with response.completed."
          },
          "store": {
            "type": "boolean",
            "const": false,
            "description": "Responses are not stored. store: true returns 400."
          },
          "background": {
            "type": "boolean",
            "const": false,
            "description": "background: true returns 400."
          }
        }
      },
      "Billing": {
        "type": "object",
        "required": [
          "charged_aud"
        ],
        "properties": {
          "charged_aud": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$",
            "example": "0.004213",
            "description": "The exact amount charged for this request, in AUD."
          }
        }
      },
      "ToolUsage": {
        "type": "object",
        "description": "Counts of built-in tool use for this request, for example web_search_calls, x_search_calls, code_execution_calls and mcp_calls. Only non-zero counts appear.",
        "additionalProperties": {
          "type": "integer"
        }
      },
      "Citation": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "MessageResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "req_0123456789abcdef01234567"
          },
          "model": {
            "type": "string",
            "const": "oppermind-lato-1"
          },
          "type": {
            "type": "string",
            "const": "message"
          },
          "content": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "text"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "tool_use"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "input": {
                      "description": "Parsed function arguments."
                    }
                  }
                }
              ]
            }
          },
          "citations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Citation"
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "output_tokens": {
                "type": "integer",
                "description": "Includes reasoning tokens."
              },
              "cache_read_input_tokens": {
                "type": "integer",
                "description": "Input tokens served from cache, billed at the cached input rate."
              },
              "cache_creation_input_tokens": {
                "type": "integer"
              },
              "reasoning_tokens": {
                "type": "integer"
              }
            }
          },
          "stop_reason": {
            "type": "string",
            "enum": [
              "end_turn",
              "max_tokens",
              "tool_use",
              "refusal"
            ]
          },
          "tool_usage": {
            "$ref": "#/components/schemas/ToolUsage"
          },
          "billing": {
            "$ref": "#/components/schemas/Billing"
          }
        }
      },
      "ChatCompletion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "chat.completion"
          },
          "created": {
            "type": "integer"
          },
          "model": {
            "type": "string",
            "const": "oppermind-lato-1"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string",
                      "const": "assistant"
                    },
                    "content": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tool_calls": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ToolCall"
                      }
                    },
                    "annotations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "url_citation"
                          },
                          "url_citation": {
                            "$ref": "#/components/schemas/Citation"
                          }
                        }
                      }
                    }
                  }
                },
                "finish_reason": {
                  "type": "string",
                  "enum": [
                    "stop",
                    "length",
                    "tool_calls",
                    "content_filter"
                  ]
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "prompt_tokens": {
                "type": "integer"
              },
              "completion_tokens": {
                "type": "integer",
                "description": "Includes reasoning tokens."
              },
              "total_tokens": {
                "type": "integer"
              },
              "prompt_tokens_details": {
                "type": "object",
                "properties": {
                  "cached_tokens": {
                    "type": "integer"
                  }
                }
              },
              "completion_tokens_details": {
                "type": "object",
                "properties": {
                  "reasoning_tokens": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "citations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Citation"
            }
          },
          "tool_usage": {
            "$ref": "#/components/schemas/ToolUsage"
          },
          "billing": {
            "$ref": "#/components/schemas/Billing"
          }
        }
      },
      "ResponseObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "resp_0123456789abcdef01234567"
          },
          "object": {
            "type": "string",
            "const": "response"
          },
          "created_at": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "incomplete"
            ]
          },
          "incomplete_details": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "enum": [
                  "max_output_tokens",
                  "content_filter"
                ]
              }
            }
          },
          "model": {
            "type": "string",
            "const": "oppermind-lato-1"
          },
          "output": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "message"
                    },
                    "id": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "const": "assistant"
                    },
                    "status": {
                      "type": "string"
                    },
                    "content": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "output_text"
                          },
                          "text": {
                            "type": "string"
                          },
                          "annotations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "url_citation"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "function_call"
                    },
                    "id": {
                      "type": "string"
                    },
                    "call_id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "arguments": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              ]
            }
          },
          "output_text": {
            "type": "string"
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "integer"
              },
              "input_tokens_details": {
                "type": "object",
                "properties": {
                  "cached_tokens": {
                    "type": "integer"
                  }
                }
              },
              "output_tokens": {
                "type": "integer",
                "description": "Includes reasoning tokens."
              },
              "output_tokens_details": {
                "type": "object",
                "properties": {
                  "reasoning_tokens": {
                    "type": "integer"
                  }
                }
              },
              "total_tokens": {
                "type": "integer"
              }
            }
          },
          "tool_usage": {
            "$ref": "#/components/schemas/ToolUsage"
          },
          "billing": {
            "$ref": "#/components/schemas/Billing"
          }
        }
      },
      "FileUploadJson": {
        "type": "object",
        "required": [
          "filename",
          "data"
        ],
        "properties": {
          "filename": {
            "type": "string"
          },
          "data": {
            "type": "string",
            "description": "base64, or a base64 data URL (data:<mime>;base64,<data>)."
          },
          "mime_type": {
            "type": "string"
          },
          "purpose": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$",
            "default": "user_data"
          }
        }
      },
      "FileObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "file-0123456789abcdef0123456789abcdef"
          },
          "object": {
            "type": "string",
            "const": "file"
          },
          "bytes": {
            "type": "integer"
          },
          "created_at": {
            "type": "integer"
          },
          "filename": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          }
        }
      },
      "FileList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileObject"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FileDeleted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string",
            "const": "file"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "Pricing": {
        "type": "object",
        "description": "All amounts are AUD. Rates can change.",
        "properties": {
          "object": {
            "type": "string",
            "const": "pricing"
          },
          "currency": {
            "type": "string",
            "const": "AUD"
          },
          "model": {
            "type": "string",
            "const": "oppermind-lato-1"
          },
          "text": {
            "type": "object",
            "properties": {
              "input_per_million_tokens": {
                "type": "number"
              },
              "cached_input_per_million_tokens": {
                "type": "number"
              },
              "output_per_million_tokens": {
                "type": "number"
              },
              "long_context": {
                "type": "object",
                "description": "Present when prompts above a size are billed at different rates.",
                "properties": {
                  "applies_when_prompt_tokens_at_least": {
                    "type": "integer"
                  },
                  "input_per_million_tokens": {
                    "type": "number"
                  },
                  "cached_input_per_million_tokens": {
                    "type": "number"
                  },
                  "output_per_million_tokens": {
                    "type": "number"
                  }
                }
              }
            }
          },
          "tools": {
            "type": "object",
            "description": "AUD per call or item for built-in tools, for example web_search_call, x_search_post, x_search_profile and code_execution_call. Tools not listed are billed through tokens.",
            "additionalProperties": {
              "type": "number"
            }
          },
          "image": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "per_image": {
                    "type": "number"
                  }
                }
              }
            ],
            "description": "null when image generation is not available."
          },
          "video": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "properties": {
                  "per_second_720p": {
                    "type": "number"
                  },
                  "per_second_1080p": {
                    "type": "number"
                  }
                }
              }
            ],
            "description": "null when video generation is not available."
          },
          "notes": {
            "type": "string"
          }
        }
      },
      "ImageRequest": {
        "type": "object",
        "required": [
          "prompt"
        ],
        "properties": {
          "model": {
            "type": "string",
            "default": "oppermind-lato-1-vision"
          },
          "prompt": {
            "type": "string",
            "description": "Up to 8 KB of UTF-8. Longer prompts return 400 OPMD_MODEL_003."
          },
          "n": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4,
            "default": 1,
            "description": "Values outside 1 to 4 are clamped."
          },
          "quality": {
            "type": "string",
            "enum": [
              "standard",
              "hd"
            ],
            "default": "standard"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "url",
              "b64_json"
            ],
            "default": "url"
          },
          "aspect_ratio": {
            "type": "string",
            "example": "16:9"
          },
          "resolution": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "example": "1024x1024"
          }
        }
      },
      "ImageResponse": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "const": "oppermind-lato-1-vision"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "Proxy path (/api/v1/images/proxy?token=...). Fetch it with the same bearer key."
                },
                "b64_json": {
                  "type": "string"
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "images_generated": {
                "type": "integer"
              }
            }
          }
        }
      },
      "VideoRequest": {
        "type": "object",
        "required": [
          "prompt"
        ],
        "properties": {
          "prompt": {
            "type": "string"
          },
          "duration_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 15,
            "default": 10,
            "description": "Values outside 1 to 15 are clamped."
          },
          "resolution": {
            "type": "string",
            "enum": [
              "720p",
              "1080p",
              "1080x1920",
              "9:16"
            ],
            "default": "1080p",
            "description": "1080x1920 or 9:16 requests a portrait video."
          },
          "fps": {
            "type": "integer",
            "description": "Accepted for compatibility. The model version sets the frame rate."
          }
        }
      },
      "VideoResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "type": "string",
            "example": "oppermind-lato-1-video"
          },
          "status": {
            "type": "string",
            "enum": [
              "succeeded"
            ],
            "description": "Always succeeded. Failures come back as error responses."
          },
          "url": {
            "type": "string",
            "description": "Proxy path (/api/v1/videos/proxy?token=...). Fetch it with the same bearer key."
          },
          "duration_seconds": {
            "type": "integer",
            "description": "Delivered duration in seconds. Billing uses this value."
          },
          "resolution": {
            "type": "string",
            "example": "1080p"
          },
          "message": {
            "type": "string",
            "description": "Present on GET /api/v1/videos/{id}."
          }
        }
      },
      "ErrorCode": {
        "type": "string",
        "description": "Stable machine code. OPMD_MODEL_001: invalid request. OPMD_MODEL_002: more than 2000 messages or input items. OPMD_MODEL_003: request body over 31 MB, or an image prompt over 8 KB. OPMD_MODEL_005: streaming is not available for this request. OPMD_CAPABILITY_001: the current model version cannot use this tool, option or content type (the message says which). OPMD_UPSTREAM_400: the model rejected the request, for example an unreadable image. The message gives the reason and the request is not charged. OPMD_EMPTY_001: the model returned no answer, for example it ran out of output tokens. The request is not charged unless built-in tools already ran or more than 20 requests in the past hour returned no answer; the message says when it was charged. OPMD_FILE_001: no file with that id. OPMD_FILE_002: the file is empty, too large, unreadable, not a supported file type, sent as multipart, or over the account's file or storage limit. OPMD_FILE_003: the file did not pass our file safety checks (for example a PDF with embedded scripts or a hidden executable). OPMD_AUTH_001: missing or invalid API key. OPMD_AUTH_002: the key lacks permission for this endpoint, or the account is suspended. OPMD_AUTH_003: the caller's IP is not in the key's allowlist. OPMD_BILLING_001: not enough credit. OPMD_POLICY_001: the request breaks the usage policy. OPMD_MODERATION_001: an image or video prompt was blocked by content moderation. OPMD_RATE_001: this key sent more than its per-minute request limit. OPMD_RATE_002: the model is busy, retry shortly. OPMD_IDEMP_001: malformed Idempotency-Key. OPMD_IDEMP_002: a request with this Idempotency-Key is still running. OPMD_PROVIDER_001: the service for this capability is not available right now. OPMD_GW_001: gateway error, retry with backoff. OPMD_GW_002: the IP allowlist check is unavailable, retry. OPMD_ROUTE_404: unknown endpoint.",
        "enum": [
          "OPMD_MODEL_001",
          "OPMD_MODEL_002",
          "OPMD_MODEL_003",
          "OPMD_MODEL_005",
          "OPMD_CAPABILITY_001",
          "OPMD_UPSTREAM_400",
          "OPMD_EMPTY_001",
          "OPMD_FILE_001",
          "OPMD_FILE_002",
          "OPMD_FILE_003",
          "OPMD_AUTH_001",
          "OPMD_AUTH_002",
          "OPMD_AUTH_003",
          "OPMD_BILLING_001",
          "OPMD_POLICY_001",
          "OPMD_MODERATION_001",
          "OPMD_RATE_001",
          "OPMD_RATE_002",
          "OPMD_IDEMP_001",
          "OPMD_IDEMP_002",
          "OPMD_PROVIDER_001",
          "OPMD_GW_001",
          "OPMD_GW_002",
          "OPMD_ROUTE_404"
        ]
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "description": "Native endpoints send type, code and message. Chat Completions, Responses and Files endpoints also send param (the offending request field, or null).",
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "code",
              "message"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "capability_error",
                  "file_error",
                  "authentication_error",
                  "permission_error",
                  "billing_error",
                  "policy_violation",
                  "idempotency_conflict",
                  "rate_limit_error",
                  "provider_error",
                  "api_error",
                  "invalid_request_error",
                  "not_found_error",
                  "insufficient_quota",
                  "server_error"
                ]
              },
              "code": {
                "$ref": "#/components/schemas/ErrorCode"
              },
              "message": {
                "type": "string",
                "description": "Human-readable and safe to show to end users."
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "responses": {
      "InvalidRequest": {
        "description": "The request is invalid (OPMD_MODEL_001, OPMD_MODEL_002, OPMD_MODEL_003 for image prompts, OPMD_MODEL_005, OPMD_CAPABILITY_001, OPMD_UPSTREAM_400, OPMD_FILE_002, OPMD_IDEMP_001). Not charged.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "invalid_request",
                "code": "OPMD_MODEL_001",
                "message": "messages must be a non-empty array."
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "authentication_error",
                "code": "OPMD_AUTH_001",
                "message": "Invalid or missing API key"
              }
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Not enough credit for this request.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "billing_error",
                "code": "OPMD_BILLING_001",
                "message": "Insufficient credits. Add credits at oppermind.com/developers"
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key lacks permission, the IP is not allowlisted, or the request breaks the usage policy (OPMD_AUTH_002, OPMD_AUTH_003, OPMD_POLICY_001, OPMD_MODERATION_001).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "permission_error",
                "code": "OPMD_AUTH_002",
                "message": "Key lacks text-generation permission"
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "File or endpoint not found (OPMD_FILE_001, OPMD_ROUTE_404).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "A request with this Idempotency-Key is still running (OPMD_IDEMP_002), the request was already processed (OPMD_MODEL_001), or the account's file limit is reached (OPMD_FILE_002).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "idempotency_conflict",
                "code": "OPMD_IDEMP_002",
                "message": "A request with this Idempotency-Key is still being processed."
              }
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The request body is over 31 MB (OPMD_MODEL_003) or the file is too large (OPMD_FILE_002).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "The upload format could not be used (OPMD_FILE_002).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "A document could not be read, for example a file with no readable content (OPMD_FILE_002), a file failed our file safety checks (OPMD_FILE_003), or the model rejected the request (OPMD_UPSTREAM_400). Not charged.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit reached (OPMD_RATE_001 for the per-key limit, OPMD_RATE_002 when the model is busy). Wait for RateLimit-Reset and retry with jitter.",
        "headers": {
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "rate_limit_error",
                "code": "OPMD_RATE_001",
                "message": "Too many requests for this API key. Slow down."
              }
            }
          }
        }
      },
      "ServerError": {
        "description": "Gateway error (OPMD_GW_001).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "api_error",
                "code": "OPMD_GW_001",
                "message": "The gateway could not complete the request. Please retry."
              }
            }
          }
        }
      },
      "BadGateway": {
        "description": "Gateway error (OPMD_GW_001), or the model returned no answer (OPMD_EMPTY_001, not charged unless built-in tools already ran).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "type": "api_error",
                "code": "OPMD_EMPTY_001",
                "message": "The model replied with no answer: it reached the output token limit before writing an answer (raise max_tokens / max_output_tokens). You were not charged for this request."
              }
            }
          }
        }
      },
      "Unavailable": {
        "description": "Temporarily unavailable (OPMD_PROVIDER_001, OPMD_GW_001, OPMD_GW_002). Retry with backoff.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
