openapi: 3.1.0
info:
  title: beatra API
  version: 0.1.0
paths:
  /v1/models:
    get:
      tags:
      - catalog
      summary: List models (OpenAI-compatible)
      description: Returns OpenAI-compatible model objects available to the caller.
      operationId: list_models_openai_compat_v1_models_get
      parameters:
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIModelList'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/catalog/models:
    get:
      tags:
      - catalog
      summary: List catalog models
      description: Returns the same model list as `/v1/models`, namespaced under the
        beatra catalog.
      operationId: list_catalog_models_v1_catalog_models_get
      parameters:
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIModelList'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/catalog/capabilities:
    get:
      tags:
      - catalog
      summary: List capabilities
      operationId: list_capabilities_v1_catalog_capabilities_get
      parameters:
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapabilityList'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/chat/completions:
    post:
      tags:
      - chat
      summary: Create chat completion (OpenAI-compatible)
      description: Creates a chat completion using an OpenAI-compatible request and
        response shape. Set `stream=true` to receive Server-Sent Events with `chat.completion.chunk`
        payloads. Use `model="auto"` to let beatra choose a capable model, or pass
        a specific model id returned by `/v1/models`.
      operationId: chat_completions_v1_chat_completions_post
      parameters:
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
        description: Optional idempotency key for safe retries of mutating requests.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
      responses:
        '200':
          description: Sync completion or streaming chat completion chunks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
            text/event-stream:
              schema:
                type: string
                description: 'Server-Sent Events: `data: <ChatCompletionChunk>` events
                  followed by `data: [DONE]`.'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '402':
          description: Account balance too low
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '502':
          description: Model request failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '503':
          description: Model temporarily unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/images/generations:
    post:
      tags:
      - images
      summary: Generate images from a text prompt
      operationId: images_generations_v1_images_generations_post
      parameters:
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
        description: Optional idempotency key for safe retries of mutating requests.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToImageRequest'
      responses:
        '202':
          description: Task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskEnvelope'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/images/image-to-image:
    post:
      tags:
      - images
      summary: Generate images from a reference image
      operationId: images_i2i_v1_images_image_to_image_post
      parameters:
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
        description: Optional idempotency key for safe retries of mutating requests.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageToImageRequest'
      responses:
        '202':
          description: Task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskEnvelope'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/music/text-to-music:
    post:
      tags:
      - music
      summary: Generate music from a prompt and/or lyrics
      operationId: text_to_music_v1_music_text_to_music_post
      parameters:
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
        description: Optional idempotency key for safe retries of mutating requests.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextToMusicRequest'
      responses:
        '202':
          description: Task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskEnvelope'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/music/reference-audio-to-music:
    post:
      tags:
      - music
      summary: Generate music from a reference audio
      operationId: ref_audio_to_music_v1_music_reference_audio_to_music_post
      parameters:
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
        description: Optional idempotency key for safe retries of mutating requests.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReferenceAudioToMusicRequest'
      responses:
        '202':
          description: Task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskEnvelope'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/uploads:
    post:
      tags:
      - uploads
      summary: "Single-shot upload (\u2264100MB)"
      operationId: upload_v1_uploads_post
      parameters:
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
        description: Optional idempotency key for safe retries of mutating requests.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_v1_uploads_post'
      responses:
        '201':
          description: Upload accepted; artifact created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '200':
          description: Content already exists; returns existing artifact
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Request Entity Too Large
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/tasks:
    get:
      tags:
      - tasks
      summary: List the caller's tasks
      description: Returns TaskSummary by default. Use `?expand=output,usage,billing,callback,input`
        or `?expand=all` to return full TaskEnvelope items.
      operationId: list_tasks_v1_tasks_get
      parameters:
      - name: status
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          title: Status
      - name: capability
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          title: Capability
      - name: created_after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created After
      - name: created_before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created Before
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          default: 20
          title: Limit
      - name: cursor
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Cursor
      - name: order
        in: query
        required: false
        schema:
          enum:
          - asc
          - desc
          type: string
          default: desc
          title: Order
      - name: expand
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: 'Comma-separated fields to include: output,usage,billing,callback,input,all'
          title: Expand
        description: 'Comma-separated fields to include: output,usage,billing,callback,input,all'
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app__api__v1__schemas__tasks__TaskListResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/tasks/{task_id}:
    get:
      tags:
      - tasks
      summary: Get a task by id
      operationId: get_task_v1_tasks__task_id__get
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskEnvelope'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/tasks/{task_id}/cancel:
    post:
      tags:
      - tasks
      summary: Cancel a task (best-effort)
      operationId: cancel_task_v1_tasks__task_id__cancel_post
      parameters:
      - name: task_id
        in: path
        required: true
        schema:
          type: string
          title: Task Id
      - name: Authorization
        in: header
        required: true
        schema:
          type: string
        description: Bearer API key.
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
      - name: Idempotency-Key
        in: header
        required: false
        schema:
          type: string
        description: Optional idempotency key for safe retries of mutating requests.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/TaskCancelRequest'
              - type: 'null'
              title: Req
      responses:
        '200':
          description: Already terminal; returns final state (idempotent)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskEnvelope'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '202':
          description: Cancel requested; final state via callback / GET
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
  /v1/health:
    get:
      tags:
      - health
      summary: Health
      description: "Cheap self-check \u2014 does NOT depend on external stores."
      operationId: health_v1_health_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Health V1 Health Get
          headers:
            X-Request-Id:
              description: Request id for support correlation.
              schema:
                type: string
      parameters:
      - name: X-Request-Id
        in: header
        required: false
        schema:
          type: string
        description: Optional client request id echoed in the response.
components:
  schemas:
    AssistantAudio:
      properties:
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
        data:
          anyOf:
          - type: string
          - type: 'null'
          title: Data
        expires_at:
          anyOf:
          - type: integer
          - type: 'null'
          title: Expires At
        transcript:
          anyOf:
          - type: string
          - type: 'null'
          title: Transcript
      type: object
      title: AssistantAudio
    AssistantMessage:
      properties:
        role:
          type: string
          const: assistant
          title: Role
        content:
          anyOf:
          - type: string
          - items:
              $ref: '#/components/schemas/TextContentPart'
            type: array
          - type: 'null'
          title: Content
        refusal:
          anyOf:
          - type: string
          - type: 'null'
          title: Refusal
        reasoning_content:
          anyOf:
          - type: string
          - type: 'null'
          title: Reasoning Content
          description: Chain-of-thought from thinking models (DeepSeek-Reasoner /
            GLM-Z1 / Kimi K2-thinking / Hunyuan-T1 / Doubao-thinking / OpenAI o-series).
            Normalized by beatra. Clients should NOT echo back next turn.
        tool_calls:
          anyOf:
          - items:
              $ref: '#/components/schemas/ToolCall'
            type: array
          - type: 'null'
          title: Tool Calls
        audio:
          anyOf:
          - $ref: '#/components/schemas/AssistantAudio'
          - type: 'null'
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
      type: object
      required:
      - role
      title: AssistantMessage
    AudioOutputConfig:
      properties:
        voice:
          type: string
          title: Voice
        format:
          type: string
          enum:
          - wav
          - mp3
          - flac
          - opus
          - pcm16
          title: Format
      type: object
      required:
      - voice
      - format
      title: AudioOutputConfig
    Body_upload_v1_uploads_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
        purpose:
          type: string
          enum:
          - media_input
          - reference_audio
          - transcription_input
          - voice_clone_source
          title: Purpose
          default: media_input
        media_type:
          anyOf:
          - type: string
            enum:
            - image
            - video
            - audio
            - text
            - binary
          - type: 'null'
          title: Media Type
        metadata:
          anyOf:
          - type: string
          - type: 'null'
          title: Metadata
      type: object
      required:
      - file
      title: Body_upload_v1_uploads_post
    CapabilityList:
      properties:
        object:
          type: string
          const: list
          title: Object
          default: list
        data:
          items:
            $ref: '#/components/schemas/CapabilityListItem'
          type: array
          title: Data
      type: object
      required:
      - data
      title: CapabilityList
    CapabilityListItem:
      properties:
        capability:
          type: string
          title: Capability
        endpoint:
          type: string
          title: Endpoint
        input_modality:
          type: string
          title: Input Modality
        output_modality:
          type: string
          title: Output Modality
        execution_mode:
          type: string
          title: Execution Mode
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        model_count:
          type: integer
          title: Model Count
      type: object
      required:
      - capability
      - endpoint
      - input_modality
      - output_modality
      - execution_mode
      - model_count
      title: CapabilityListItem
    ChatChoice:
      properties:
        index:
          type: integer
          title: Index
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          anyOf:
          - type: string
            enum:
            - stop
            - length
            - tool_calls
            - content_filter
            - function_call
          - type: 'null'
          title: Finish Reason
        logprobs:
          anyOf:
          - $ref: '#/components/schemas/Logprobs'
          - type: 'null'
      type: object
      required:
      - index
      - message
      - finish_reason
      title: ChatChoice
    ChatCompletionRequest:
      properties:
        model:
          type: string
          title: Model
          description: Model name (e.g. 'gpt-4o-mini', 'qwen-max', 'auto')
        messages:
          items:
            oneOf:
            - $ref: '#/components/schemas/SystemMessage'
            - $ref: '#/components/schemas/UserMessage'
            - $ref: '#/components/schemas/AssistantMessage'
            - $ref: '#/components/schemas/ToolMessage'
            discriminator:
              propertyName: role
              mapping:
                assistant: '#/components/schemas/AssistantMessage'
                developer: '#/components/schemas/SystemMessage'
                system: '#/components/schemas/SystemMessage'
                tool: '#/components/schemas/ToolMessage'
                user: '#/components/schemas/UserMessage'
          type: array
          title: Messages
        temperature:
          anyOf:
          - type: number
            maximum: 2.0
            minimum: 0.0
          - type: 'null'
          title: Temperature
        top_p:
          anyOf:
          - type: number
            maximum: 1.0
            minimum: 0.0
          - type: 'null'
          title: Top P
        max_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Max Tokens
          description: Legacy; reasoning models reject this. beatra maps to max_completion_tokens.
        max_completion_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Max Completion Tokens
        n:
          anyOf:
          - type: integer
            maximum: 10.0
            minimum: 1.0
          - type: 'null'
          title: N
        seed:
          anyOf:
          - type: integer
          - type: 'null'
          title: Seed
        stop:
          anyOf:
          - type: string
          - items:
              type: string
            type: array
          - type: 'null'
          title: Stop
        stream:
          type: boolean
          title: Stream
          default: false
        stream_options:
          anyOf:
          - $ref: '#/components/schemas/StreamOptions'
          - type: 'null'
        frequency_penalty:
          anyOf:
          - type: number
            maximum: 2.0
            minimum: -2.0
          - type: 'null'
          title: Frequency Penalty
        presence_penalty:
          anyOf:
          - type: number
            maximum: 2.0
            minimum: -2.0
          - type: 'null'
          title: Presence Penalty
        logit_bias:
          anyOf:
          - additionalProperties:
              type: number
            type: object
          - type: 'null'
          title: Logit Bias
        logprobs:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Logprobs
        top_logprobs:
          anyOf:
          - type: integer
            maximum: 20.0
            minimum: 0.0
          - type: 'null'
          title: Top Logprobs
        tools:
          anyOf:
          - items:
              $ref: '#/components/schemas/Tool'
            type: array
          - type: 'null'
          title: Tools
        tool_choice:
          anyOf:
          - type: string
          - $ref: '#/components/schemas/NamedFunctionChoice'
          - type: 'null'
          title: Tool Choice
        parallel_tool_calls:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Parallel Tool Calls
        response_format:
          anyOf:
          - oneOf:
            - $ref: '#/components/schemas/ResponseFormatText'
            - $ref: '#/components/schemas/ResponseFormatJsonObject'
            - $ref: '#/components/schemas/ResponseFormatJsonSchema'
            discriminator:
              propertyName: type
              mapping:
                json_object: '#/components/schemas/ResponseFormatJsonObject'
                json_schema: '#/components/schemas/ResponseFormatJsonSchema'
                text: '#/components/schemas/ResponseFormatText'
          - type: 'null'
          title: Response Format
        reasoning_effort:
          anyOf:
          - type: string
            enum:
            - minimal
            - low
            - medium
            - high
          - type: 'null'
          title: Reasoning Effort
        audio:
          anyOf:
          - $ref: '#/components/schemas/AudioOutputConfig'
          - type: 'null'
        modalities:
          anyOf:
          - items:
              type: string
              enum:
              - text
              - audio
            type: array
          - type: 'null'
          title: Modalities
        metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Metadata
        store:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Store
        service_tier:
          anyOf:
          - type: string
          - type: 'null'
          title: Service Tier
        safety_identifier:
          anyOf:
          - type: string
          - type: 'null'
          title: Safety Identifier
        prompt_cache_key:
          anyOf:
          - type: string
          - type: 'null'
          title: Prompt Cache Key
        user:
          anyOf:
          - type: string
          - type: 'null'
          title: User
          description: Deprecated; use safety_identifier
        model_options:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Model Options
          description: beatra extension; per-model passthrough
      additionalProperties: true
      type: object
      required:
      - model
      - messages
      title: ChatCompletionRequest
      description: "Request body for POST /v1/chat/completions.\n\nOpenAI-compatible\
        \ request. beatra-specific extensions:\n- `model_options` \u2014 per-model\
        \ passthrough"
    ChatCompletionResponse:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: chat.completion
          title: Object
          default: chat.completion
        created:
          type: integer
          title: Created
        model:
          type: string
          title: Model
          description: Resolved model snapshot (OpenAI convention)
        system_fingerprint:
          anyOf:
          - type: string
          - type: 'null'
          title: System Fingerprint
        service_tier:
          anyOf:
          - type: string
          - type: 'null'
          title: Service Tier
        choices:
          items:
            $ref: '#/components/schemas/ChatChoice'
          type: array
          title: Choices
        usage:
          $ref: '#/components/schemas/ChatUsage'
      type: object
      required:
      - id
      - created
      - model
      - choices
      - usage
      title: ChatCompletionResponse
      description: Standard OpenAI ChatCompletion response + credits / credits_usd_reference
        extensions in usage.
    ChatUsage:
      properties:
        prompt_tokens:
          type: integer
          title: Prompt Tokens
        completion_tokens:
          type: integer
          title: Completion Tokens
        total_tokens:
          type: integer
          title: Total Tokens
        prompt_tokens_details:
          anyOf:
          - $ref: '#/components/schemas/PromptTokensDetails'
          - type: 'null'
        completion_tokens_details:
          anyOf:
          - $ref: '#/components/schemas/CompletionTokensDetails'
          - type: 'null'
        credits:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Credits
          description: Credits charged for this call. Populated by PR-2.
        credits_usd_reference:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Credits Usd Reference
          description: USD reference value computed from credits at current credits_per_usd_rate.
            Display only; non-committal. See docs/design/billing-model.md.
      type: object
      required:
      - prompt_tokens
      - completion_tokens
      - total_tokens
      title: ChatUsage
    CompletionTokensDetails:
      properties:
        reasoning_tokens:
          type: integer
          title: Reasoning Tokens
          default: 0
        audio_tokens:
          type: integer
          title: Audio Tokens
          default: 0
        accepted_prediction_tokens:
          type: integer
          title: Accepted Prediction Tokens
          default: 0
        rejected_prediction_tokens:
          type: integer
          title: Rejected Prediction Tokens
          default: 0
      type: object
      title: CompletionTokensDetails
    ErrorBody:
      properties:
        code:
          type: string
          title: Code
          description: Stable public error code
        message:
          type: string
          title: Message
          description: Human-readable explanation
        retryable:
          type: boolean
          title: Retryable
          description: If true, retrying the exact same request may succeed
        details:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Details
          description: Code-specific structured info
        request_id:
          type: string
          title: Request Id
          description: Echo of X-Request-Id for support correlation
        param:
          anyOf:
          - type: string
          - type: 'null'
          title: Param
          description: JSON Pointer to offending field, if applicable
      type: object
      required:
      - code
      - message
      - retryable
      - request_id
      title: ErrorBody
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
      - error
      title: ErrorResponse
    FileContentPart:
      properties:
        type:
          type: string
          const: file
          title: Type
        file:
          $ref: '#/components/schemas/FileData'
      type: object
      required:
      - type
      - file
      title: FileContentPart
    FileData:
      properties:
        file_id:
          anyOf:
          - type: string
          - type: 'null'
          title: File Id
        file_data:
          anyOf:
          - type: string
          - type: 'null'
          title: File Data
        filename:
          anyOf:
          - type: string
          - type: 'null'
          title: Filename
      type: object
      title: FileData
    FunctionDefinition:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        parameters:
          additionalProperties: true
          type: object
          title: Parameters
          description: JSON Schema
        strict:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Strict
      type: object
      required:
      - name
      title: FunctionDefinition
    ImageToImageRequest:
      properties:
        model:
          type: string
          enum:
          - auto
          - gpt-image-2
          title: Model
        prompt:
          type: string
          maxLength: 4000
          minLength: 1
          title: Prompt
        quality:
          type: string
          enum:
          - standard
          - hd
          title: Quality
          default: standard
        aspect_ratio:
          type: string
          enum:
          - auto
          - '1:1'
          - '16:9'
          - '9:16'
          - '4:3'
          - '3:4'
          - '2:1'
          title: Aspect Ratio
          default: auto
        output_format:
          type: string
          enum:
          - png
          - jpeg
          - webp
          title: Output Format
          default: png
        n:
          type: integer
          maximum: 4.0
          minimum: 1.0
          title: N
          default: 1
        image:
          oneOf:
          - $ref: '#/components/schemas/MediaInputUrl'
          - $ref: '#/components/schemas/MediaInputArtifact'
          - $ref: '#/components/schemas/MediaInputDataUri'
          title: Image
          discriminator:
            propertyName: type
            mapping:
              artifact: '#/components/schemas/MediaInputArtifact'
              data_uri: '#/components/schemas/MediaInputDataUri'
              url: '#/components/schemas/MediaInputUrl'
        extra_images:
          anyOf:
          - items:
              oneOf:
              - $ref: '#/components/schemas/MediaInputUrl'
              - $ref: '#/components/schemas/MediaInputArtifact'
              - $ref: '#/components/schemas/MediaInputDataUri'
              discriminator:
                propertyName: type
                mapping:
                  artifact: '#/components/schemas/MediaInputArtifact'
                  data_uri: '#/components/schemas/MediaInputDataUri'
                  url: '#/components/schemas/MediaInputUrl'
            type: array
            maxItems: 15
          - type: 'null'
          title: Extra Images
          description: 0..15 additional input images. With `image`, total 1..16.
      additionalProperties: false
      type: object
      required:
      - model
      - prompt
      - image
      title: ImageToImageRequest
      description: Generate images from one or more input images and a prompt.
    ImageUrlContentPart:
      properties:
        type:
          type: string
          const: image_url
          title: Type
        image_url:
          $ref: '#/components/schemas/ImageUrlData'
      type: object
      required:
      - type
      - image_url
      title: ImageUrlContentPart
    ImageUrlData:
      properties:
        url:
          type: string
          title: Url
        detail:
          anyOf:
          - type: string
            enum:
            - auto
            - low
            - high
          - type: 'null'
          title: Detail
          default: auto
      type: object
      required:
      - url
      title: ImageUrlData
    InputAudioContentPart:
      properties:
        type:
          type: string
          const: input_audio
          title: Type
        input_audio:
          $ref: '#/components/schemas/InputAudioData'
      type: object
      required:
      - type
      - input_audio
      title: InputAudioContentPart
    InputAudioData:
      properties:
        data:
          type: string
          title: Data
          description: base64-encoded audio bytes
        format:
          type: string
          enum:
          - wav
          - mp3
          title: Format
      type: object
      required:
      - data
      - format
      title: InputAudioData
    JsonSchemaDef:
      properties:
        name:
          type: string
          title: Name
          description: 'Required by OpenAI: identifier for the schema'
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        schema:
          additionalProperties: true
          type: object
          title: Schema
          description: JSON Schema
        strict:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Strict
      type: object
      required:
      - name
      - schema
      title: JsonSchemaDef
    LogprobToken:
      properties:
        token:
          type: string
          title: Token
        logprob:
          type: number
          title: Logprob
        bytes:
          anyOf:
          - items:
              type: integer
            type: array
          - type: 'null'
          title: Bytes
        top_logprobs:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Top Logprobs
      type: object
      required:
      - token
      - logprob
      title: LogprobToken
    Logprobs:
      properties:
        content:
          anyOf:
          - items:
              $ref: '#/components/schemas/LogprobToken'
            type: array
          - type: 'null'
          title: Content
        refusal:
          anyOf:
          - items:
              $ref: '#/components/schemas/LogprobToken'
            type: array
          - type: 'null'
          title: Refusal
      type: object
      title: Logprobs
    MediaInputArtifact:
      properties:
        type:
          type: string
          const: artifact
          title: Type
        artifact_id:
          type: string
          title: Artifact Id
          description: ULID of a previously-uploaded artifact
      type: object
      required:
      - type
      - artifact_id
      title: MediaInputArtifact
    MediaInputDataUri:
      properties:
        type:
          type: string
          const: data_uri
          title: Type
        data:
          type: string
          title: Data
          description: "Data URI (e.g. data:image/png;base64,...) \u2014 max 256KB\
            \ encoded"
      type: object
      required:
      - type
      - data
      title: MediaInputDataUri
    MediaInputUrl:
      properties:
        type:
          type: string
          const: url
          title: Type
        url:
          type: string
          title: Url
          description: HTTPS URL. External URLs are downloaded and re-hosted to beatra
            CDN.
      type: object
      required:
      - type
      - url
      title: MediaInputUrl
    MusicModelOptions:
      properties:
        suno:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Suno
        minimax:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Minimax
      additionalProperties: false
      type: object
      title: MusicModelOptions
      description: Model-family scoped public options for music generation.
    NamedFunctionChoice:
      properties:
        type:
          type: string
          const: function
          title: Type
        function:
          additionalProperties: true
          type: object
          title: Function
          description: '{name: str}'
      type: object
      required:
      - type
      - function
      title: NamedFunctionChoice
    OpenAIModel:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: model
          title: Object
          default: model
        created:
          type: integer
          title: Created
          description: Unix seconds
        owned_by:
          type: string
          title: Owned By
          default: beatra
      type: object
      required:
      - id
      - created
      title: OpenAIModel
    OpenAIModelList:
      properties:
        object:
          type: string
          const: list
          title: Object
          default: list
        data:
          items:
            $ref: '#/components/schemas/OpenAIModel'
          type: array
          title: Data
      type: object
      required:
      - data
      title: OpenAIModelList
    PromptTokensDetails:
      properties:
        cached_tokens:
          type: integer
          title: Cached Tokens
          default: 0
        audio_tokens:
          type: integer
          title: Audio Tokens
          default: 0
      type: object
      title: PromptTokensDetails
    ReferenceAudioToMusicRequest:
      properties:
        model:
          type: string
          enum:
          - auto
          - minimax-music-2.6
          - suno-5.5
          title: Model
        prompt:
          type: string
          minLength: 1
          title: Prompt
          description: Music concept, style, mood, genre, or instrumentation prompt.
        lyrics:
          anyOf:
          - type: string
          - type: 'null'
          title: Lyrics
          description: Optional lyrics text. Must be omitted for instrumental music.
        instrumental:
          type: boolean
          title: Instrumental
          description: When true, generate instrumental music without vocals.
          default: false
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Metadata
          description: Caller-supplied metadata; limited by task creation policy.
        model_options:
          anyOf:
          - $ref: '#/components/schemas/MusicModelOptions'
          - type: 'null'
          description: Options grouped by public music model family.
        reference_audio:
          oneOf:
          - $ref: '#/components/schemas/MediaInputUrl'
          - $ref: '#/components/schemas/MediaInputArtifact'
          - $ref: '#/components/schemas/MediaInputDataUri'
          title: Reference Audio
          discriminator:
            propertyName: type
            mapping:
              artifact: '#/components/schemas/MediaInputArtifact'
              data_uri: '#/components/schemas/MediaInputDataUri'
              url: '#/components/schemas/MediaInputUrl'
      additionalProperties: false
      type: object
      required:
      - model
      - prompt
      - reference_audio
      title: ReferenceAudioToMusicRequest
      description: Generate music from a prompt, optional lyrics, and reference audio.
    ResponseFormatJsonObject:
      properties:
        type:
          type: string
          const: json_object
          title: Type
          default: json_object
      type: object
      title: ResponseFormatJsonObject
    ResponseFormatJsonSchema:
      properties:
        type:
          type: string
          const: json_schema
          title: Type
          default: json_schema
        json_schema:
          $ref: '#/components/schemas/JsonSchemaDef'
      type: object
      required:
      - json_schema
      title: ResponseFormatJsonSchema
    ResponseFormatText:
      properties:
        type:
          type: string
          const: text
          title: Type
          default: text
      type: object
      title: ResponseFormatText
    StreamOptions:
      properties:
        include_usage:
          type: boolean
          title: Include Usage
          default: false
      type: object
      title: StreamOptions
    SystemMessage:
      properties:
        role:
          type: string
          enum:
          - system
          - developer
          title: Role
        content:
          anyOf:
          - type: string
          - items:
              $ref: '#/components/schemas/TextContentPart'
            type: array
          title: Content
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
      type: object
      required:
      - role
      - content
      title: SystemMessage
    TaskBilling:
      properties:
        charged_credits:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Charged Credits
          description: Credits charged to wallet for this Task. Populated by PR-2/3.
        refunded_credits:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Refunded Credits
          description: Credits refunded for this Task. Populated by PR-3.
        charged_credits_usd_reference:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Charged Credits Usd Reference
          description: USD reference for `charged_credits` at current rate. Display
            only.
        refunded_credits_usd_reference:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Refunded Credits Usd Reference
          description: USD reference for `refunded_credits` at current rate. Display
            only.
        currency:
          type: string
          const: USD
          title: Currency
          default: USD
      type: object
      title: TaskBilling
    TaskCallback:
      properties:
        url:
          type: string
          title: Url
        status:
          type: string
          enum:
          - pending
          - delivered
          - retrying
          - failed
          title: Status
        attempt_count:
          type: integer
          title: Attempt Count
        delivered_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Delivered At
        last_error:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Error
          description: "Last HTTP body/error (\u2264512 chars, truncated)"
      type: object
      required:
      - url
      - status
      - attempt_count
      title: TaskCallback
    TaskCancelRequest:
      properties:
        reason:
          anyOf:
          - type: string
            maxLength: 512
          - type: 'null'
          title: Reason
      type: object
      title: TaskCancelRequest
    TaskEnvelope:
      properties:
        object:
          type: string
          const: task
          title: Object
          default: task
        task_id:
          type: string
          title: Task Id
        status:
          type: string
          enum:
          - queued
          - running
          - succeeded
          - failed
          - canceled
          title: Status
        capability:
          type: string
          title: Capability
        model:
          type: string
          title: Model
          description: Caller-requested model verbatim (may be 'auto')
        resolved_model:
          anyOf:
          - type: string
          - type: 'null'
          title: Resolved Model
          description: Actual model that ran (null until execution starts; equals
            model for explicit-model calls)
        metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Metadata
        input:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Input
        progress:
          anyOf:
          - $ref: '#/components/schemas/app__api__v1__schemas__common__TaskProgress'
          - type: 'null'
        output:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Output
        warnings:
          items:
            $ref: '#/components/schemas/TaskWarning'
          type: array
          title: Warnings
        error:
          anyOf:
          - $ref: '#/components/schemas/app__api__v1__schemas__common__TaskError'
          - type: 'null'
        usage:
          anyOf:
          - $ref: '#/components/schemas/UsageObject'
          - type: 'null'
        billing:
          anyOf:
          - $ref: '#/components/schemas/TaskBilling'
          - type: 'null'
        callback:
          anyOf:
          - $ref: '#/components/schemas/TaskCallback'
          - type: 'null'
        created_at:
          type: string
          format: date-time
          title: Created At
        started_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Started At
        completed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Completed At
        cancel_requested_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Cancel Requested At
        links:
          $ref: '#/components/schemas/TaskLinks'
      type: object
      required:
      - task_id
      - status
      - capability
      - model
      - created_at
      - links
      title: TaskEnvelope
      description: 'Standard Task envelope.


        Returned by every async-creation endpoint, GET /v1/tasks/{id}, and

        the body of customer callback POSTs.'
    TaskLinks:
      properties:
        self:
          type: string
          title: Self
        cancel:
          anyOf:
          - type: string
          - type: 'null'
          title: Cancel
      type: object
      required:
      - self
      title: TaskLinks
    TaskWarning:
      properties:
        code:
          type: string
          title: Code
          description: e.g. option_clamped / auto_routed
        message:
          type: string
          title: Message
        field:
          anyOf:
          - type: string
          - type: 'null'
          title: Field
      type: object
      required:
      - code
      - message
      title: TaskWarning
    TextContentPart:
      properties:
        type:
          type: string
          const: text
          title: Type
        text:
          type: string
          title: Text
      type: object
      required:
      - type
      - text
      title: TextContentPart
    TextToImageRequest:
      properties:
        model:
          type: string
          enum:
          - auto
          - gpt-image-2
          title: Model
        prompt:
          type: string
          maxLength: 4000
          minLength: 1
          title: Prompt
        quality:
          type: string
          enum:
          - standard
          - hd
          title: Quality
          default: standard
        aspect_ratio:
          type: string
          enum:
          - auto
          - '1:1'
          - '16:9'
          - '9:16'
          - '4:3'
          - '3:4'
          - '2:1'
          title: Aspect Ratio
          default: auto
        output_format:
          type: string
          enum:
          - png
          - jpeg
          - webp
          title: Output Format
          default: png
        n:
          type: integer
          maximum: 4.0
          minimum: 1.0
          title: N
          default: 1
      additionalProperties: false
      type: object
      required:
      - model
      - prompt
      title: TextToImageRequest
      description: Generate images from a prompt.
    TextToMusicRequest:
      properties:
        model:
          type: string
          enum:
          - auto
          - minimax-music-2.6
          - suno-5.5
          title: Model
        prompt:
          type: string
          minLength: 1
          title: Prompt
          description: Music concept, style, mood, genre, or instrumentation prompt.
        lyrics:
          anyOf:
          - type: string
          - type: 'null'
          title: Lyrics
          description: Optional lyrics text. Must be omitted for instrumental music.
        instrumental:
          type: boolean
          title: Instrumental
          description: When true, generate instrumental music without vocals.
          default: false
        title:
          anyOf:
          - type: string
          - type: 'null'
          title: Title
        metadata:
          anyOf:
          - additionalProperties:
              type: string
            type: object
          - type: 'null'
          title: Metadata
          description: Caller-supplied metadata; limited by task creation policy.
        model_options:
          anyOf:
          - $ref: '#/components/schemas/MusicModelOptions'
          - type: 'null'
          description: Options grouped by public music model family.
      additionalProperties: false
      type: object
      required:
      - model
      - prompt
      title: TextToMusicRequest
      description: Generate music from a prompt and optional lyrics.
    Tool:
      properties:
        type:
          type: string
          const: function
          title: Type
          default: function
        function:
          $ref: '#/components/schemas/FunctionDefinition'
      type: object
      required:
      - function
      title: Tool
    ToolCall:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: function
          title: Type
          default: function
        function:
          $ref: '#/components/schemas/ToolCallFunction'
      type: object
      required:
      - id
      - function
      title: ToolCall
    ToolCallFunction:
      properties:
        name:
          type: string
          title: Name
        arguments:
          type: string
          title: Arguments
          description: JSON-stringified arguments
      type: object
      required:
      - name
      - arguments
      title: ToolCallFunction
    ToolMessage:
      properties:
        role:
          type: string
          const: tool
          title: Role
        content:
          anyOf:
          - type: string
          - items:
              $ref: '#/components/schemas/TextContentPart'
            type: array
          title: Content
        tool_call_id:
          type: string
          title: Tool Call Id
      type: object
      required:
      - role
      - content
      - tool_call_id
      title: ToolMessage
    UploadResponse:
      properties:
        object:
          type: string
          const: upload
          title: Object
          default: upload
        artifact_id:
          type: string
          title: Artifact Id
        cdn_url:
          type: string
          title: Cdn Url
        mime_type:
          type: string
          title: Mime Type
        media_type:
          type: string
          enum:
          - image
          - video
          - audio
          - text
          - binary
          title: Media Type
        size_bytes:
          type: integer
          title: Size Bytes
        width:
          anyOf:
          - type: integer
          - type: 'null'
          title: Width
        height:
          anyOf:
          - type: integer
          - type: 'null'
          title: Height
        duration_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Duration Ms
        checksum_sha256:
          type: string
          title: Checksum Sha256
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - artifact_id
      - cdn_url
      - mime_type
      - media_type
      - size_bytes
      - checksum_sha256
      - created_at
      title: UploadResponse
      description: Returned by both /v1/uploads (201) and de-dup hit (200).
    UsageLine:
      properties:
        meter:
          type: string
          title: Meter
          description: e.g. input_token / output_token / image_count / video_second
        quantity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
          description: "Decimal \u2014 number of meter units consumed"
        unit:
          type: string
          title: Unit
          description: Display unit, e.g. 'token' / 'image' / 'second'
        billed_amount_credits:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Billed Amount Credits
          description: Credits charged for this usage line. Populated by PR-2/3.
        billed_amount_credits_usd_reference:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Billed Amount Credits Usd Reference
          description: USD reference for `billed_amount_credits` at current credits_per_usd_rate.
            Display only; non-committal. See docs/design/billing-model.md.
      type: object
      required:
      - meter
      - quantity
      - unit
      title: UsageLine
    UsageObject:
      properties:
        input_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Input Tokens
        output_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Output Tokens
        cache_read_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Cache Read Tokens
        cache_creation_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Cache Creation Tokens
        reasoning_tokens:
          anyOf:
          - type: integer
          - type: 'null'
          title: Reasoning Tokens
        image_count:
          anyOf:
          - type: integer
          - type: 'null'
          title: Image Count
        image_pixels:
          anyOf:
          - type: integer
          - type: 'null'
          title: Image Pixels
        video_seconds:
          anyOf:
          - type: number
          - type: 'null'
          title: Video Seconds
        audio_seconds:
          anyOf:
          - type: number
          - type: 'null'
          title: Audio Seconds
        characters:
          anyOf:
          - type: integer
          - type: 'null'
          title: Characters
        lines:
          items:
            $ref: '#/components/schemas/UsageLine'
          type: array
          title: Lines
        credits:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Credits
          description: Credits charged for this Task. Populated by PR-2 / PR-3.
        credits_usd_reference:
          anyOf:
          - type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          - type: 'null'
          title: Credits Usd Reference
          description: USD reference value computed from credits at current credits_per_usd_rate.
            Display only; non-committal. See docs/design/billing-model.md.
      type: object
      title: UsageObject
    UserMessage:
      properties:
        role:
          type: string
          const: user
          title: Role
        content:
          anyOf:
          - type: string
          - items:
              oneOf:
              - $ref: '#/components/schemas/TextContentPart'
              - $ref: '#/components/schemas/ImageUrlContentPart'
              - $ref: '#/components/schemas/InputAudioContentPart'
              - $ref: '#/components/schemas/FileContentPart'
              discriminator:
                propertyName: type
                mapping:
                  file: '#/components/schemas/FileContentPart'
                  image_url: '#/components/schemas/ImageUrlContentPart'
                  input_audio: '#/components/schemas/InputAudioContentPart'
                  text: '#/components/schemas/TextContentPart'
            type: array
          title: Content
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
      type: object
      required:
      - role
      - content
      title: UserMessage
    app__api__v1__schemas__common__TaskError:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        retryable:
          type: boolean
          title: Retryable
      type: object
      required:
      - code
      - message
      - retryable
      title: TaskError
    app__api__v1__schemas__common__TaskProgress:
      properties:
        percent:
          anyOf:
          - type: integer
            maximum: 100.0
            minimum: 0.0
          - type: 'null'
          title: Percent
        stage:
          anyOf:
          - type: string
          - type: 'null'
          title: Stage
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
      type: object
      title: TaskProgress
    app__api__v1__schemas__tasks__TaskListResponse:
      properties:
        object:
          type: string
          const: list
          title: Object
          default: list
        data:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Data
          description: TaskSummary[] by default; TaskEnvelope[] with expand
        next_cursor:
          anyOf:
          - type: string
          - type: 'null'
          title: Next Cursor
        has_more:
          type: boolean
          title: Has More
          default: false
      type: object
      required:
      - data
      title: TaskListResponse
      description: 'List response wrapper. Uses TaskSummary by default.


        Clients can opt-in to richer detail via `?expand=output,usage,billing,callback,input`

        or `?expand=all`. When expand is in effect, items become full TaskEnvelope.'

