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

# Generate an image

> Generates an image from a text prompt via the image generation router



## OpenAPI

````yaml /openapi.json post /images
openapi: 3.1.0
info:
  title: Nemonist API
  version: 1.0.0
  description: >-
    OpenRouter-compatible API with durable per-workspace memory. Point any
    OpenRouter client at https://nemonist.com/api/v1 with a Nemonist key
    (sk-nm-...). Chat completions, Responses and Messages requests from a
    workspace carrying a .nemonist/key get its memory; every other request is
    answered as OpenRouter would.
  contact:
    name: Nemonist
    url: https://nemonist.com
servers:
  - url: https://nemonist.com/api/v1
    description: Production
security:
  - apiKey: []
tags:
  - description: API key management endpoints
    name: API Keys
  - description: Analytics and usage endpoints
    name: Analytics
  - description: Anthropic Messages endpoints
    name: Anthropic Messages
  - description: BYOK endpoints
    name: BYOK
  - description: Benchmarks endpoints
    name: Benchmarks
  - description: Chat completion endpoints
    name: Chat
  - description: Credit management endpoints
    name: Credits
  - description: >-
      Public OpenRouter usage datasets. Data returned by these endpoints is
      licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/):
      reuse and republish it, including commercially, with attribution to
      OpenRouter.
    name: Datasets
  - description: Text embedding endpoints
    name: Embeddings
  - description: Endpoint information
    name: Endpoints
  - name: Folders
    description: >-
      Your memory folders, over your account's API key: read, export, upload,
      and manage keys.
  - description: Generation history endpoints
    name: Generations
  - description: Guardrails endpoints
    name: Guardrails
  - description: Images endpoints
    name: Images
  - name: Memory
    description: Nemonist's per-workspace memory.
  - name: Model runs
    description: Run models (physics and others) on inputs; one contract for every model
  - description: Model information endpoints
    name: Models
  - description: OAuth authentication endpoints
    name: OAuth
  - description: Organization endpoints
    name: Organization
  - description: Private Endpoints endpoints
    name: Private Endpoints
  - description: Provider information endpoints
    name: Providers
  - description: Rerank endpoints
    name: Rerank
  - description: OpenAI-compatible Responses API endpoints
    name: Responses
  - description: Speech-to-text endpoints
    name: STT
    x-displayName: Transcriptions
  - description: >-
      System One endpoints for models such as Jev, compatible with the TypeSafe
      SDKs. See https://openrouter.ai/docs/guides/community/typesafe-sdk.
    name: SystemOne
    x-displayName: System One
  - description: Text-to-speech endpoints
    name: TTS
    x-displayName: Speech
  - description: Video Generation endpoints
    name: Video Generation
  - description: Workspaces endpoints
    name: Workspaces
  - name: beta.responses
    description: >-
      Deprecated alias of responses. Use responses instead; scheduled for
      removal (sunset date TBD).
paths:
  /images:
    parameters:
      - $ref: '#/components/parameters/AppIdentifier'
      - $ref: '#/components/parameters/AppDisplayName'
      - $ref: '#/components/parameters/AppCategories'
    post:
      tags:
        - Images
      summary: Generate an image
      description: Generates an image from a text prompt via the image generation router
      operationId: createImages
      requestBody:
        content:
          application/json:
            example:
              model: bytedance-seed/seedream-4.5
              prompt: a red panda astronaut floating in space, studio lighting
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                created: 1748372400
                data:
                  - b64_json: <base64-encoded-image>
                usage:
                  completion_tokens: 4175
                  cost: 0.04
                  prompt_tokens: 0
                  total_tokens: 4175
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
            text/event-stream:
              example:
                data:
                  b64_json: <base64-encoded-partial-image>
                  partial_image_index: 0
                  type: image_generation.partial_image
              schema:
                $ref: '#/components/schemas/ImageStreamingResponse'
              x-speakeasy-sse-sentinel: '[DONE]'
          description: Image generation response
        '400':
          content:
            application/json:
              example:
                error:
                  code: 400
                  message: Invalid request parameters
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
          description: Bad Request - Invalid request parameters or malformed input
        '401':
          content:
            application/json:
              example:
                error:
                  code: 401
                  message: Missing Authentication header
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized - Authentication required or invalid credentials
        '402':
          content:
            application/json:
              example:
                error:
                  code: 402
                  message: >-
                    Insufficient credits. Add more using
                    https://openrouter.ai/credits
              schema:
                $ref: '#/components/schemas/PaymentRequiredResponse'
          description: >-
            Payment Required - Insufficient credits or quota to complete
            request. Nemonist: over a spending cap, or out of credits.
        '403':
          content:
            application/json:
              example:
                error:
                  code: 403
                  message: Only management keys can perform this operation
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
          description: Forbidden - Authentication successful but insufficient permissions
        '404':
          content:
            application/json:
              example:
                error:
                  code: 404
                  message: Resource not found
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
          description: Not Found - Resource does not exist
        '413':
          content:
            application/json:
              example:
                error:
                  code: 413
                  message: Request payload too large
              schema:
                $ref: '#/components/schemas/PayloadTooLargeResponse'
          description: Payload Too Large - Request payload exceeds size limits
        '429':
          content:
            application/json:
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
          description: >-
            Too Many Requests - Rate limit exceeded. Nemonist: admission limit
            reached; retry after the Retry-After header's seconds.
        '500':
          content:
            application/json:
              example:
                error:
                  code: 500
                  message: Internal Server Error
              schema:
                $ref: '#/components/schemas/InternalServerResponse'
          description: Internal Server Error - Unexpected server error
        '502':
          content:
            application/json:
              example:
                error:
                  code: 502
                  message: Provider returned error
              schema:
                $ref: '#/components/schemas/BadGatewayResponse'
          description: Bad Gateway - Provider/upstream API failure
        '503':
          description: 'Nemonist: the account service is temporarily unavailable; retry.'
          content:
            application/json:
              example:
                error:
                  code: 500
                  message: Internal Server Error
              schema:
                $ref: '#/components/schemas/InternalServerResponse'
        '524':
          content:
            application/json:
              example:
                error:
                  code: 524
                  message: Request timed out. Please try again later.
              schema:
                $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
          description: Infrastructure Timeout - Provider request timed out at edge network
        '529':
          content:
            application/json:
              example:
                error:
                  code: 529
                  message: Provider returned error
              schema:
                $ref: '#/components/schemas/ProviderOverloadedResponse'
          description: Provider Overloaded - Provider is temporarily overloaded
components:
  parameters:
    AppIdentifier:
      name: HTTP-Referer
      in: header
      schema:
        type: string
      description: >
        The app identifier should be your app's URL and is used as the primary
        identifier for rankings.

        This is used to track API usage per application.
    AppDisplayName:
      name: X-OpenRouter-Title
      in: header
      x-speakeasy-name-override: appTitle
      schema:
        type: string
      description: >
        The app display name allows you to customize how your app appears in
        OpenRouter's dashboard.
    AppCategories:
      name: X-OpenRouter-Categories
      in: header
      x-speakeasy-name-override: appCategories
      schema:
        type: string
      description: >
        Comma-separated list of app categories (e.g. "cli-agent,cloud-agent").
        Used for marketplace rankings.
  schemas:
    ImageGenerationRequest:
      description: Image generation request input
      example:
        model: bytedance-seed/seedream-4.5
        prompt: a red panda astronaut floating in space, studio lighting
      properties:
        aspect_ratio:
          description: >-
            Normalized aspect ratio of the generated image. Providers clamp to
            their supported subset.
          enum:
            - '1:1'
            - '1:2'
            - '1:4'
            - '1:8'
            - '2:1'
            - '2:3'
            - 2.35:1
            - '3:2'
            - '3:4'
            - '4:1'
            - '4:3'
            - '4:5'
            - '5:2'
            - '5:4'
            - '5:7'
            - '7:5'
            - '8:1'
            - '9:16'
            - '16:9'
            - '9:19.5'
            - 19.5:9
            - '9:20'
            - '20:9'
            - '9:21'
            - '21:9'
            - auto
          example: '16:9'
          type: string
          x-speakeasy-unknown-values: allow
        background:
          description: >-
            Background treatment. `transparent` requires an output_format that
            supports alpha (png or webp).
          enum:
            - auto
            - transparent
            - opaque
          example: auto
          type: string
          x-speakeasy-unknown-values: allow
        input_references:
          description: >-
            Reference images to guide image-to-image generation, as base64 data
            URLs or HTTP(S) URLs.
          items:
            $ref: '#/components/schemas/ContentPartImage'
          maxItems: 16
          type: array
        model:
          description: The image generation model to use
          example: bytedance-seed/seedream-4.5
          type: string
        'n':
          description: >-
            Upper bound on the number of images to generate (1-10). Providers
            may return fewer images, and providers that only support
            single-image generation reject n > 1.
          example: 1
          type: integer
        output_compression:
          description: >-
            Compression level (0-100) for jpeg/webp output. Ignored by providers
            without a compression knob; providers that honor it may reject it
            with other output formats (e.g. OpenAI requires output_format "jpeg"
            or "webp").
          example: 100
          type: integer
        output_format:
          description: >-
            Encoding of the returned image bytes. Most models produce raster
            formats (png, jpeg, webp). SVG is supported by vectorization models
            (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in
            `b64_json`.
          enum:
            - png
            - jpeg
            - webp
            - svg
          example: png
          type: string
          x-speakeasy-unknown-values: allow
        prompt:
          description: Text description of the desired image
          example: a red panda astronaut floating in space, studio lighting
          minLength: 1
          type: string
        provider:
          $ref: '#/components/schemas/ImageGenerationProviderPreferences'
        quality:
          description: Rendering quality. Providers without a quality knob ignore this.
          enum:
            - auto
            - low
            - medium
            - high
            - xhigh
            - max
          example: high
          type: string
          x-speakeasy-unknown-values: allow
        resolution:
          description: >-
            Normalized resolution tier of the generated image. Concrete pixel
            dimensions are derived per-provider.
          enum:
            - '512'
            - '768'
            - 1K
            - 1.5K
            - 2K
            - 4K
          example: 2K
          type: string
          x-speakeasy-unknown-values: allow
        seed:
          description: >-
            If specified, the generation will sample deterministically, such
            that repeated requests with the same seed and parameters should
            return the same result. Determinism is not guaranteed for all
            providers.
          type: integer
        session_id:
          description: >-
            A unique identifier for grouping related requests (e.g., a
            conversation or agent workflow). Used for observability grouping in
            Broadcast and private logging; never sent to the provider. If
            provided in both the request body and the x-session-id header, the
            body value takes precedence. Maximum of 256 characters.
          example: session-1234
          maxLength: 256
          type: string
        size:
          description: >-
            Optional. A convenience shorthand for output dimensions — pass a
            tier ("2K", "4K") or explicit pixels ("2048x2048"). A tier size is
            equivalent to setting `resolution` and combines with `aspect_ratio`.
            Explicit pixel sizes are provider-dependent: providers that accept
            them treat the value as authoritative and reject a mismatched
            `resolution` or `aspect_ratio` alongside it with a 400. xAI and
            Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and
            `aspect_ratio` there); Sourceful V2.6 supports them within its
            dimension limits and does not allow combining them with `resolution`
            or `aspect_ratio`.
          example: 2K
          type: string
        stream:
          description: >-
            If true, partial images are streamed as SSE events as they become
            available. Only supported by providers with native streaming
            (currently OpenAI). Non-streaming providers ignore this flag and
            return a buffered response.
          type: boolean
        trace:
          $ref: '#/components/schemas/TraceConfig'
        user:
          description: >-
            A stable identifier for your end-users. Used to help detect and
            prevent abuse. Never sent to providers verbatim: for providers whose
            data policy requires user IDs, it is folded into a hashed,
            per-account upstream user identifier.
          example: end-user-abc123
          maxLength: 256
          type: string
      required:
        - model
        - prompt
      type: object
    ImageGenerationResponse:
      description: Image generation response
      example:
        created: 1748372400
        data:
          - b64_json: <base64-encoded-image>
        usage:
          completion_tokens: 4175
          cost: 0.04
          prompt_tokens: 0
          total_tokens: 4175
      properties:
        created:
          description: Unix timestamp (seconds) when the image was generated
          example: 1748372400
          type: integer
        data:
          description: Generated images
          items:
            properties:
              b64_json:
                description: Base64-encoded image bytes
                type: string
              media_type:
                description: >-
                  Media type (MIME type) of the image, e.g. `image/png`,
                  `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if
                  the format could not be determined.
                example: image/png
                type: string
            required:
              - b64_json
            type: object
          type: array
        usage:
          $ref: '#/components/schemas/ImageGenerationUsage'
      required:
        - created
        - data
      type: object
    ImageStreamingResponse:
      example:
        data:
          b64_json: <base64-encoded-partial-image>
          partial_image_index: 0
          type: image_generation.partial_image
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/ImageGenPartialImageEvent'
            - $ref: '#/components/schemas/ImageGenTextChunkEvent'
            - $ref: '#/components/schemas/ImageGenCompletedEvent'
            - $ref: '#/components/schemas/ImageGenStreamErrorEvent'
          description: >-
            One streamed image event: a partial image, a text chunk, the
            completed image, or an error.
      required:
        - data
      type: object
    BadRequestResponse:
      description: Bad Request - Invalid request parameters or malformed input
      example:
        error:
          code: 400
          message: Invalid request parameters
      properties:
        error:
          $ref: '#/components/schemas/BadRequestResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    UnauthorizedResponse:
      description: Unauthorized - Authentication required or invalid credentials
      example:
        error:
          code: 401
          message: Missing Authentication header
      properties:
        error:
          $ref: '#/components/schemas/UnauthorizedResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    PaymentRequiredResponse:
      description: Payment Required - Insufficient credits or quota to complete request
      example:
        error:
          code: 402
          message: Insufficient credits. Add more using https://openrouter.ai/credits
      properties:
        error:
          $ref: '#/components/schemas/PaymentRequiredResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    ForbiddenResponse:
      description: Forbidden - Authentication successful but insufficient permissions
      example:
        error:
          code: 403
          message: Only management keys can perform this operation
      properties:
        error:
          $ref: '#/components/schemas/ForbiddenResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    NotFoundResponse:
      description: Not Found - Resource does not exist
      example:
        error:
          code: 404
          message: Resource not found
      properties:
        error:
          $ref: '#/components/schemas/NotFoundResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    PayloadTooLargeResponse:
      description: Payload Too Large - Request payload exceeds size limits
      example:
        error:
          code: 413
          message: Request payload too large
      properties:
        error:
          $ref: '#/components/schemas/PayloadTooLargeResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    TooManyRequestsResponse:
      description: Too Many Requests - Rate limit exceeded
      example:
        error:
          code: 429
          message: Rate limit exceeded
      properties:
        error:
          $ref: '#/components/schemas/TooManyRequestsResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    InternalServerResponse:
      description: Internal Server Error - Unexpected server error
      example:
        error:
          code: 500
          message: Internal Server Error
      properties:
        error:
          $ref: '#/components/schemas/InternalServerResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    BadGatewayResponse:
      description: Bad Gateway - Provider/upstream API failure
      example:
        error:
          code: 502
          message: Provider returned error
      properties:
        error:
          $ref: '#/components/schemas/BadGatewayResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    EdgeNetworkTimeoutResponse:
      description: Infrastructure Timeout - Provider request timed out at edge network
      example:
        error:
          code: 524
          message: Request timed out. Please try again later.
      properties:
        error:
          $ref: '#/components/schemas/EdgeNetworkTimeoutResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    ProviderOverloadedResponse:
      description: Provider Overloaded - Provider is temporarily overloaded
      example:
        error:
          code: 529
          message: Provider returned error
      properties:
        error:
          $ref: '#/components/schemas/ProviderOverloadedResponseErrorData'
        openrouter_metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: OpenRouter's routing detail for the failed request.
        user_id:
          type:
            - string
            - 'null'
          description: Id of the user who made the request.
      required:
        - error
      type: object
    ContentPartImage:
      example:
        image_url:
          url: https://example.com/image.png
        type: image_url
      properties:
        image_url:
          properties:
            url:
              type: string
              description: The image's URL or base64 data URL.
          required:
            - url
          type: object
          description: >-
            The image: an object whose url is the image's URL or base64 data
            URL.
        type:
          enum:
            - image_url
          type: string
          description: One of "image_url".
      required:
        - type
        - image_url
      type: object
    ImageGenerationProviderPreferences:
      description: >-
        Provider routing preferences and provider-specific passthrough
        configuration.
      example:
        allow_fallbacks: false
        only:
          - google-ai-studio
      properties:
        allow_fallbacks:
          description: >
            Whether to allow backup providers to serve requests

            - true: (default) when the primary provider (or your custom
            providers in "order") is unavailable, use the next best provider.

            - false: use only the primary/custom provider, and return the
            upstream error if it's unavailable.
          type:
            - boolean
            - 'null'
        ignore:
          description: >-
            List of provider slugs to ignore. If provided, this list is merged
            with your account-wide ignored provider settings for this request.
          example:
            - openai
            - anthropic
          items:
            anyOf:
              - $ref: '#/components/schemas/ProviderName'
              - type: string
          type:
            - array
            - 'null'
        only:
          description: >-
            List of provider slugs to allow. If provided, this list is merged
            with your account-wide allowed provider settings for this request.
          example:
            - openai
            - anthropic
          items:
            anyOf:
              - $ref: '#/components/schemas/ProviderName'
              - type: string
          type:
            - array
            - 'null'
        options:
          allOf:
            - $ref: '#/components/schemas/ProviderOptions'
            - example:
                black-forest-labs:
                  guidance: 3
                  steps: 40
          description: >-
            Options sent only to one provider, keyed by provider slug, e.g.
            {"black-forest-labs": {"steps": 40}}.
        order:
          description: >-
            An ordered list of provider slugs. The router will attempt to use
            the first provider in the subset of this list that supports your
            requested model, and fall back to the next if it is unavailable. If
            no providers are available, the request will fail with an error
            message.
          example:
            - openai
            - anthropic
          items:
            anyOf:
              - $ref: '#/components/schemas/ProviderName'
              - type: string
          type:
            - array
            - 'null'
        sort:
          anyOf:
            - $ref: '#/components/schemas/ProviderSort'
            - $ref: '#/components/schemas/ProviderSortConfig'
            - type: 'null'
          description: >-
            The sorting strategy to use for this request, if "order" is not
            specified. When set, no load balancing is performed.
          example: price
      type: object
    TraceConfig:
      additionalProperties: {}
      description: >-
        Metadata for observability and tracing. Known keys (trace_id,
        trace_name, span_name, generation_name, parent_span_id) have special
        handling. Additional keys are passed through as custom metadata to
        configured broadcast destinations.
      example:
        trace_id: trace-abc123
        trace_name: my-app-trace
      properties:
        generation_name:
          type: string
          description: Name of this generation in your traces.
        parent_span_id:
          type: string
          description: Span this generation nests under in your traces.
        span_name:
          type: string
          description: Name of this span in your traces.
        trace_id:
          type: string
          description: Id of the trace this request belongs to.
        trace_name:
          type: string
          description: Name of the trace in your traces.
      type: object
    ImageGenerationUsage:
      description: Token and cost usage for the image generation request, when available
      example:
        completion_tokens: 4175
        cost: 0.04
        prompt_tokens: 0
        total_tokens: 4175
      properties:
        cache_creation:
          $ref: '#/components/schemas/AnthropicCacheCreation'
        completion_tokens:
          description: The tokens generated
          type: integer
        completion_tokens_details:
          properties:
            audio_tokens:
              description: Tokens generated by the model for audio output.
              type:
                - integer
                - 'null'
            image_tokens:
              description: Tokens generated by the model for image output.
              type:
                - integer
                - 'null'
            reasoning_tokens:
              description: Tokens generated by the model for reasoning.
              type:
                - integer
                - 'null'
          type:
            - object
            - 'null'
          description: 'Output tokens split by kind: image, audio and reasoning.'
        cost:
          description: Cost of the completion
          format: double
          type:
            - number
            - 'null'
        cost_details:
          $ref: '#/components/schemas/CostDetails'
        is_byok:
          description: Whether a request was made using a Bring Your Own Key configuration
          type: boolean
        iterations:
          items:
            $ref: '#/components/schemas/AnthropicUsageIteration'
          type:
            - array
            - 'null'
          description: Usage of each model call the image generation made, or null.
        prompt_tokens:
          description: Including images, input audio, and tools if any
          type: integer
        prompt_tokens_details:
          description: Breakdown of tokens used in the prompt.
          properties:
            audio_tokens:
              description: Tokens used for input audio.
              type:
                - integer
                - 'null'
            cache_write_tokens:
              description: >-
                Tokens written to cache. Only returned for models with explicit
                caching and cache write pricing.
              type:
                - integer
                - 'null'
            cached_tokens:
              description: Tokens cached by the endpoint.
              type:
                - integer
                - 'null'
            file_tokens:
              description: Tokens used for input files/documents.
              type:
                - integer
                - 'null'
            video_tokens:
              description: Tokens used for input video.
              type:
                - integer
                - 'null'
          type:
            - object
            - 'null'
        server_tool_use:
          description: Usage for server-side tool execution (e.g., web search)
          properties:
            tool_calls_executed:
              description: >-
                Number of OpenRouter server tool calls that executed and
                produced a result.
              type:
                - integer
                - 'null'
            tool_calls_requested:
              description: >-
                Total number of OpenRouter server-orchestrated tool calls the
                model requested, across all tool types. Provider-native tools
                (e.g. native web search) are not counted here.
              type:
                - integer
                - 'null'
            web_search_requests:
              description: >-
                Number of web searches performed by server-side tools. For
                server-orchestrated tool calls a web search is also counted in
                tool_calls_requested; provider-native web search may report
                web_search_requests only. Do not sum the two.
              type:
                - integer
                - 'null'
          type:
            - object
            - 'null'
        service_tier:
          description: The service tier used by the upstream provider for this request
          type:
            - string
            - 'null'
        speed:
          $ref: '#/components/schemas/AnthropicSpeed'
        total_tokens:
          description: Sum of the above two fields
          type: integer
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      type: object
    ImageGenPartialImageEvent:
      description: >-
        Emitted when a partial image becomes available during streaming
        generation
      example:
        b64_json: <base64-encoded-partial-image>
        partial_image_index: 0
        type: image_generation.partial_image
      properties:
        b64_json:
          description: Base64-encoded partial image data
          type: string
        partial_image_index:
          description: 0-based index indicating which partial image this is in the sequence
          type: integer
        type:
          description: The event type
          enum:
            - image_generation.partial_image
          type: string
      required:
        - type
        - partial_image_index
        - b64_json
      type: object
    ImageGenTextChunkEvent:
      description: >-
        Emitted when a text chunk becomes available during streaming generation
        of text-based formats (e.g. SVG)
      example:
        phase: content
        text: <svg xmlns="http://www.w3.org/2000/svg">
        type: image_generation.text_chunk
      properties:
        phase:
          description: >-
            The generation phase this chunk belongs to. `content` is the
            renderable output; `reasoning` and `draft` are intermediate provider
            phases.
          enum:
            - content
            - reasoning
            - draft
          type: string
          x-speakeasy-unknown-values: allow
        text:
          description: >-
            A text fragment of the image being generated (e.g. partial SVG
            markup)
          type: string
        type:
          description: The event type
          enum:
            - image_generation.text_chunk
          type: string
      required:
        - type
        - text
        - phase
      type: object
    ImageGenCompletedEvent:
      description: Emitted when generation completes and the final image is available
      example:
        b64_json: <base64-encoded-final-image>
        created: 1748372400
        type: image_generation.completed
        usage:
          completion_tokens: 4175
          cost: 0.04
          prompt_tokens: 0
          total_tokens: 4175
      properties:
        b64_json:
          description: Base64-encoded final image data
          type: string
        created:
          description: Unix timestamp (seconds) when the image was generated
          type: integer
        media_type:
          description: >-
            Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`,
            `image/webp`, `image/svg+xml`. May be omitted if the format could
            not be determined.
          example: image/png
          type: string
        type:
          description: The event type
          enum:
            - image_generation.completed
          type: string
        usage:
          $ref: '#/components/schemas/ImageGenerationUsage'
      required:
        - type
        - b64_json
        - created
      type: object
    ImageGenStreamErrorEvent:
      description: Emitted when streaming generation fails after the SSE response starts
      example:
        error:
          code: upstream_error
          message: The upstream provider returned an error
          param: null
          type: provider_error
        type: error
      properties:
        error:
          description: Provider error details
          properties:
            code:
              description: Provider error code, when supplied
              type:
                - string
                - 'null'
            message:
              description: Provider error message
              type: string
            param:
              description: Request parameter associated with the error, when supplied
              type:
                - string
                - 'null'
            type:
              description: Provider error type, when supplied
              type:
                - string
                - 'null'
          required:
            - message
          type: object
        type:
          description: The event type
          enum:
            - error
          type: string
      required:
        - type
        - error
      type: object
    BadRequestResponseErrorData:
      description: Error data for BadRequestResponse
      example:
        code: 400
        message: Invalid request parameters
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 400.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    UnauthorizedResponseErrorData:
      description: Error data for UnauthorizedResponse
      example:
        code: 401
        message: Missing Authentication header
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 401.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    PaymentRequiredResponseErrorData:
      description: Error data for PaymentRequiredResponse
      example:
        code: 402
        message: Insufficient credits. Add more using https://openrouter.ai/credits
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 402.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    ForbiddenResponseErrorData:
      description: Error data for ForbiddenResponse
      example:
        code: 403
        message: Only management keys can perform this operation
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 403.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    NotFoundResponseErrorData:
      description: Error data for NotFoundResponse
      example:
        code: 404
        message: Resource not found
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 404.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    PayloadTooLargeResponseErrorData:
      description: Error data for PayloadTooLargeResponse
      example:
        code: 413
        message: Request payload too large
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 413.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    TooManyRequestsResponseErrorData:
      description: Error data for TooManyRequestsResponse
      example:
        code: 429
        message: Rate limit exceeded
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 429.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    InternalServerResponseErrorData:
      description: Error data for InternalServerResponse
      example:
        code: 500
        message: Internal Server Error
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 500.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    BadGatewayResponseErrorData:
      description: Error data for BadGatewayResponse
      example:
        code: 502
        message: Provider returned error
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 502.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    EdgeNetworkTimeoutResponseErrorData:
      description: Error data for EdgeNetworkTimeoutResponse
      example:
        code: 524
        message: Request timed out. Please try again later.
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 524.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    ProviderOverloadedResponseErrorData:
      description: Error data for ProviderOverloadedResponse
      example:
        code: 529
        message: Provider returned error
      properties:
        code:
          type: integer
          description: 'HTTP status of the error, the same as the response''s: 529.'
        message:
          type: string
          description: >-
            What went wrong, in words for a person; do not parse it, branch on
            code instead.
        metadata:
          additionalProperties: {}
          type:
            - object
            - 'null'
          description: Extra detail about the error.
      required:
        - code
        - message
      type: object
    ProviderName:
      enum:
        - Modal
        - AkashML
        - AI21
        - AionLabs
        - Alibaba
        - Ambient
        - Ant Digital
        - Baidu
        - Amazon Bedrock
        - Amazon Nova
        - Anthropic
        - Arcee AI
        - AssemblyAI
        - AtlasCloud
        - Avian
        - Azure
        - BaseTen
        - BytePlus
        - Black Forest Labs
        - Cerebras
        - Chutes
        - Cirrascale
        - Claude Platform on AWS
        - Clarifai
        - Cloudflare
        - Cohere
        - CoreWeave
        - Cosine
        - Crucible
        - Crusoe
        - Darkbloom
        - Databricks
        - Decart
        - Deepgram
        - DeepInfra
        - DeepSeek
        - DekaLLM
        - DigitalOcean
        - ElevenLabs
        - Featherless
        - Fireworks
        - Fish Audio
        - Friendli
        - GMICloud
        - Google
        - Google AI Studio
        - Groq
        - HeyGen
        - Inception
        - Inceptron
        - InferenceNet
        - Ionstream
        - Infermatic
        - Io Net
        - Inferact vLLM
        - Inflection
        - KT
        - Liquid
        - Makora
        - Mara
        - Mancer 2
        - Meta
        - Minimax
        - ModelRun
        - Mistral
        - Modular
        - Moonshot AI
        - Morph
        - VoyageAI by MongoDB
        - TypeSafe
        - Near AI
        - Nebius
        - Nex AGI
        - NextBit
        - Novita
        - Nvidia
        - Ollama
        - OpenAI
        - OpenInference
        - Parallel
        - Parasail
        - ParetoAlpha
        - Particle AI
        - Pearl Research
        - Poolside
        - PrimaLabs
        - PrimeIntellect
        - Perceptron
        - Perplexity
        - Phala
        - Recraft
        - Recursive
        - Reka
        - Relace
        - Respan
        - Sail Research
        - Sakana AI
        - SambaNova
        - ScaleDown
        - Seed
        - SiliconFlow
        - Sourceful
        - StepFun
        - Stealth
        - StreamLake
        - Switchpoint
        - Tencent
        - Tenstorrent
        - Thinking Machines
        - Together
        - Unbiased
        - Upstage
        - Venice
        - Wafer
        - WandB
        - Quiver
        - Krea
        - Runway
        - Xiaomi
        - xAI
        - Z.AI
        - FakeProvider
      example: OpenAI
      type: string
      x-speakeasy-unknown-values: allow
      description: >-
        The display name of the provider serving the endpoint, such as "OpenAI",
        "Anthropic", "Google Vertex" or "Azure". New providers appear over time,
        so accept names not listed here.
    ProviderOptions:
      description: >-
        Provider-specific options keyed by provider slug. The provider segment
        is case-insensitive; an endpoint tag after `/` must match the endpoint
        slug exactly. Only options for the matched provider are forwarded; the
        rest are ignored. Unrecognized keys are silently dropped.
      example:
        openai:
          max_tokens: 1000
      properties:
        01ai:
          additionalProperties: {}
          type: object
          description: Options sent only to the 01ai provider.
        ai21:
          additionalProperties: {}
          type: object
          description: Options sent only to the ai21 provider.
        aion-labs:
          additionalProperties: {}
          type: object
          description: Options sent only to the aion-labs provider.
        akashml:
          additionalProperties: {}
          type: object
          description: Options sent only to the akashml provider.
        alibaba:
          additionalProperties: {}
          type: object
          description: Options sent only to the alibaba provider.
        amazon-bedrock:
          additionalProperties: {}
          type: object
          description: Options sent only to the amazon-bedrock provider.
        amazon-bedrock/claude-on-aws:
          additionalProperties: {}
          type: object
          description: Options sent only to the amazon-bedrock/claude-on-aws provider.
        amazon-nova:
          additionalProperties: {}
          type: object
          description: Options sent only to the amazon-nova provider.
        ambient:
          additionalProperties: {}
          type: object
          description: Options sent only to the ambient provider.
        antdigital:
          additionalProperties: {}
          type: object
          description: Options sent only to the antdigital provider.
        anthropic:
          additionalProperties: {}
          type: object
          description: Options sent only to the anthropic provider.
        anthropic/2:
          additionalProperties: {}
          type: object
          description: Options sent only to the anthropic/2 provider.
        anyscale:
          additionalProperties: {}
          type: object
          description: Options sent only to the anyscale provider.
        arcee-ai:
          additionalProperties: {}
          type: object
          description: Options sent only to the arcee-ai provider.
        assemblyai:
          additionalProperties: {}
          type: object
          description: Options sent only to the assemblyai provider.
        atlas-cloud:
          additionalProperties: {}
          type: object
          description: Options sent only to the atlas-cloud provider.
        atoma:
          additionalProperties: {}
          type: object
          description: Options sent only to the atoma provider.
        avian:
          additionalProperties: {}
          type: object
          description: Options sent only to the avian provider.
        azure:
          additionalProperties: {}
          type: object
          description: Options sent only to the azure provider.
        baidu:
          additionalProperties: {}
          type: object
          description: Options sent only to the baidu provider.
        baseten:
          additionalProperties: {}
          type: object
          description: Options sent only to the baseten provider.
        black-forest-labs:
          additionalProperties: {}
          type: object
          description: Options sent only to the black-forest-labs provider.
        byteplus:
          additionalProperties: {}
          type: object
          description: Options sent only to the byteplus provider.
        centml:
          additionalProperties: {}
          type: object
          description: Options sent only to the centml provider.
        cerebras:
          additionalProperties: {}
          type: object
          description: Options sent only to the cerebras provider.
        chutes:
          additionalProperties: {}
          type: object
          description: Options sent only to the chutes provider.
        cirrascale:
          additionalProperties: {}
          type: object
          description: Options sent only to the cirrascale provider.
        clarifai:
          additionalProperties: {}
          type: object
          description: Options sent only to the clarifai provider.
        claude-on-aws:
          additionalProperties: {}
          type: object
          description: Options sent only to the claude-on-aws provider.
        cloudflare:
          additionalProperties: {}
          type: object
          description: Options sent only to the cloudflare provider.
        cohere:
          additionalProperties: {}
          type: object
          description: Options sent only to the cohere provider.
        coreweave:
          additionalProperties: {}
          type: object
          description: Options sent only to the coreweave provider.
        cosine:
          additionalProperties: {}
          type: object
          description: Options sent only to the cosine provider.
        crofai:
          additionalProperties: {}
          type: object
          description: Options sent only to the crofai provider.
        crucible:
          additionalProperties: {}
          type: object
          description: Options sent only to the crucible provider.
        crusoe:
          additionalProperties: {}
          type: object
          description: Options sent only to the crusoe provider.
        darkbloom:
          additionalProperties: {}
          type: object
          description: Options sent only to the darkbloom provider.
        databricks:
          additionalProperties: {}
          type: object
          description: Options sent only to the databricks provider.
        decart:
          additionalProperties: {}
          type: object
          description: Options sent only to the decart provider.
        deepgram:
          additionalProperties: {}
          type: object
          description: Options sent only to the deepgram provider.
        deepinfra:
          additionalProperties: {}
          type: object
          description: Options sent only to the deepinfra provider.
        deepseek:
          additionalProperties: {}
          type: object
          description: Options sent only to the deepseek provider.
        dekallm:
          additionalProperties: {}
          type: object
          description: Options sent only to the dekallm provider.
        digitalocean:
          additionalProperties: {}
          type: object
          description: Options sent only to the digitalocean provider.
        elevenlabs:
          additionalProperties: {}
          type: object
          description: Options sent only to the elevenlabs provider.
        enfer:
          additionalProperties: {}
          type: object
          description: Options sent only to the enfer provider.
        fake-provider:
          additionalProperties: {}
          type: object
          description: Options sent only to the fake-provider provider.
        featherless:
          additionalProperties: {}
          type: object
          description: Options sent only to the featherless provider.
        fireworks:
          additionalProperties: {}
          type: object
          description: Options sent only to the fireworks provider.
        fish-audio:
          additionalProperties: {}
          type: object
          description: Options sent only to the fish-audio provider.
        friendli:
          additionalProperties: {}
          type: object
          description: Options sent only to the friendli provider.
        gmicloud:
          additionalProperties: {}
          type: object
          description: Options sent only to the gmicloud provider.
        google-ai-studio:
          additionalProperties: {}
          type: object
          description: Options sent only to the google-ai-studio provider.
        google-vertex:
          additionalProperties: {}
          type: object
          description: Options sent only to the google-vertex provider.
        gopomelo:
          additionalProperties: {}
          type: object
          description: Options sent only to the gopomelo provider.
        groq:
          additionalProperties: {}
          type: object
          description: Options sent only to the groq provider.
        heygen:
          additionalProperties: {}
          type: object
          description: Options sent only to the heygen provider.
        huggingface:
          additionalProperties: {}
          type: object
          description: Options sent only to the huggingface provider.
        hyperbolic:
          additionalProperties: {}
          type: object
          description: Options sent only to the hyperbolic provider.
        hyperbolic-quantized:
          additionalProperties: {}
          type: object
          description: Options sent only to the hyperbolic-quantized provider.
        inception:
          additionalProperties: {}
          type: object
          description: Options sent only to the inception provider.
        inceptron:
          additionalProperties: {}
          type: object
          description: Options sent only to the inceptron provider.
        inferact-vllm:
          additionalProperties: {}
          type: object
          description: Options sent only to the inferact-vllm provider.
        inference-net:
          additionalProperties: {}
          type: object
          description: Options sent only to the inference-net provider.
        infermatic:
          additionalProperties: {}
          type: object
          description: Options sent only to the infermatic provider.
        inflection:
          additionalProperties: {}
          type: object
          description: Options sent only to the inflection provider.
        inocloud:
          additionalProperties: {}
          type: object
          description: Options sent only to the inocloud provider.
        io-net:
          additionalProperties: {}
          type: object
          description: Options sent only to the io-net provider.
        ionstream:
          additionalProperties: {}
          type: object
          description: Options sent only to the ionstream provider.
        klusterai:
          additionalProperties: {}
          type: object
          description: Options sent only to the klusterai provider.
        krea:
          additionalProperties: {}
          type: object
          description: Options sent only to the krea provider.
        kt:
          additionalProperties: {}
          type: object
          description: Options sent only to the kt provider.
        lambda:
          additionalProperties: {}
          type: object
          description: Options sent only to the lambda provider.
        lepton:
          additionalProperties: {}
          type: object
          description: Options sent only to the lepton provider.
        liquid:
          additionalProperties: {}
          type: object
          description: Options sent only to the liquid provider.
        lynn:
          additionalProperties: {}
          type: object
          description: Options sent only to the lynn provider.
        lynn-private:
          additionalProperties: {}
          type: object
          description: Options sent only to the lynn-private provider.
        makora:
          additionalProperties: {}
          type: object
          description: Options sent only to the makora provider.
        mancer:
          additionalProperties: {}
          type: object
          description: Options sent only to the mancer provider.
        mancer-old:
          additionalProperties: {}
          type: object
          description: Options sent only to the mancer-old provider.
        mara:
          additionalProperties: {}
          type: object
          description: Options sent only to the mara provider.
        meta:
          additionalProperties: {}
          type: object
          description: Options sent only to the meta provider.
        minimax:
          additionalProperties: {}
          type: object
          description: Options sent only to the minimax provider.
        mistral:
          additionalProperties: {}
          type: object
          description: Options sent only to the mistral provider.
        modal:
          additionalProperties: {}
          type: object
          description: Options sent only to the modal provider.
        modelrun:
          additionalProperties: {}
          type: object
          description: Options sent only to the modelrun provider.
        modular:
          additionalProperties: {}
          type: object
          description: Options sent only to the modular provider.
        moonshotai:
          additionalProperties: {}
          type: object
          description: Options sent only to the moonshotai provider.
        morph:
          additionalProperties: {}
          type: object
          description: Options sent only to the morph provider.
        ncompass:
          additionalProperties: {}
          type: object
          description: Options sent only to the ncompass provider.
        near-ai:
          additionalProperties: {}
          type: object
          description: Options sent only to the near-ai provider.
        nebius:
          additionalProperties: {}
          type: object
          description: Options sent only to the nebius provider.
        nex-agi:
          additionalProperties: {}
          type: object
          description: Options sent only to the nex-agi provider.
        nextbit:
          additionalProperties: {}
          type: object
          description: Options sent only to the nextbit provider.
        nineteen:
          additionalProperties: {}
          type: object
          description: Options sent only to the nineteen provider.
        novita:
          additionalProperties: {}
          type: object
          description: Options sent only to the novita provider.
        nvidia:
          additionalProperties: {}
          type: object
          description: Options sent only to the nvidia provider.
        octoai:
          additionalProperties: {}
          type: object
          description: Options sent only to the octoai provider.
        ollama:
          additionalProperties: {}
          type: object
          description: Options sent only to the ollama provider.
        open-inference:
          additionalProperties: {}
          type: object
          description: Options sent only to the open-inference provider.
        openai:
          additionalProperties: {}
          type: object
          description: Options sent only to the openai provider.
        parallel:
          additionalProperties: {}
          type: object
          description: Options sent only to the parallel provider.
        parasail:
          additionalProperties: {}
          type: object
          description: Options sent only to the parasail provider.
        pareto-alpha:
          additionalProperties: {}
          type: object
          description: Options sent only to the pareto-alpha provider.
        particle-ai:
          additionalProperties: {}
          type: object
          description: Options sent only to the particle-ai provider.
        pearl-research:
          additionalProperties: {}
          type: object
          description: Options sent only to the pearl-research provider.
        perceptron:
          additionalProperties: {}
          type: object
          description: Options sent only to the perceptron provider.
        perplexity:
          additionalProperties: {}
          type: object
          description: Options sent only to the perplexity provider.
        phala:
          additionalProperties: {}
          type: object
          description: Options sent only to the phala provider.
        poolside:
          additionalProperties: {}
          type: object
          description: Options sent only to the poolside provider.
        primalabs:
          additionalProperties: {}
          type: object
          description: Options sent only to the primalabs provider.
        primeintellect:
          additionalProperties: {}
          type: object
          description: Options sent only to the primeintellect provider.
        quiver:
          additionalProperties: {}
          type: object
          description: Options sent only to the quiver provider.
        recraft:
          additionalProperties: {}
          type: object
          description: Options sent only to the recraft provider.
        recursal:
          additionalProperties: {}
          type: object
          description: Options sent only to the recursal provider.
        recursive:
          additionalProperties: {}
          type: object
          description: Options sent only to the recursive provider.
        reflection:
          additionalProperties: {}
          type: object
          description: Options sent only to the reflection provider.
        reka:
          additionalProperties: {}
          type: object
          description: Options sent only to the reka provider.
        relace:
          additionalProperties: {}
          type: object
          description: Options sent only to the relace provider.
        replicate:
          additionalProperties: {}
          type: object
          description: Options sent only to the replicate provider.
        respan:
          additionalProperties: {}
          type: object
          description: Options sent only to the respan provider.
        runway:
          additionalProperties: {}
          type: object
          description: Options sent only to the runway provider.
        sail-research:
          additionalProperties: {}
          type: object
          description: Options sent only to the sail-research provider.
        sakana:
          additionalProperties: {}
          type: object
          description: Options sent only to the sakana provider.
        sakana-ai:
          additionalProperties: {}
          type: object
          description: Options sent only to the sakana-ai provider.
        sambanova:
          additionalProperties: {}
          type: object
          description: Options sent only to the sambanova provider.
        sambanova-cloaked:
          additionalProperties: {}
          type: object
          description: Options sent only to the sambanova-cloaked provider.
        scaledown:
          additionalProperties: {}
          type: object
          description: Options sent only to the scaledown provider.
        seed:
          additionalProperties: {}
          type: object
          description: Options sent only to the seed provider.
        sf-compute:
          additionalProperties: {}
          type: object
          description: Options sent only to the sf-compute provider.
        siliconflow:
          additionalProperties: {}
          type: object
          description: Options sent only to the siliconflow provider.
        sourceful:
          additionalProperties: {}
          type: object
          description: Options sent only to the sourceful provider.
        stealth:
          additionalProperties: {}
          type: object
          description: Options sent only to the stealth provider.
        stepfun:
          additionalProperties: {}
          type: object
          description: Options sent only to the stepfun provider.
        streamlake:
          additionalProperties: {}
          type: object
          description: Options sent only to the streamlake provider.
        switchpoint:
          additionalProperties: {}
          type: object
          description: Options sent only to the switchpoint provider.
        targon:
          additionalProperties: {}
          type: object
          description: Options sent only to the targon provider.
        tencent:
          additionalProperties: {}
          type: object
          description: Options sent only to the tencent provider.
        tenstorrent:
          additionalProperties: {}
          type: object
          description: Options sent only to the tenstorrent provider.
        thinkingmachines:
          additionalProperties: {}
          type: object
          description: Options sent only to the thinkingmachines provider.
        together:
          additionalProperties: {}
          type: object
          description: Options sent only to the together provider.
        together-lite:
          additionalProperties: {}
          type: object
          description: Options sent only to the together-lite provider.
        typesafe:
          additionalProperties: {}
          type: object
          description: Options sent only to the typesafe provider.
        ubicloud:
          additionalProperties: {}
          type: object
          description: Options sent only to the ubicloud provider.
        unbiased:
          additionalProperties: {}
          type: object
          description: Options sent only to the unbiased provider.
        upstage:
          additionalProperties: {}
          type: object
          description: Options sent only to the upstage provider.
        venice:
          additionalProperties: {}
          type: object
          description: Options sent only to the venice provider.
        voyageai:
          additionalProperties: {}
          type: object
          description: Options sent only to the voyageai provider.
        wafer:
          additionalProperties: {}
          type: object
          description: Options sent only to the wafer provider.
        wandb:
          additionalProperties: {}
          type: object
          description: Options sent only to the wandb provider.
        wandb-legacy:
          additionalProperties: {}
          type: object
          description: Options sent only to the wandb-legacy provider.
        xai:
          additionalProperties: {}
          type: object
          description: Options sent only to the xai provider.
        xiaomi:
          additionalProperties: {}
          type: object
          description: Options sent only to the xiaomi provider.
        z-ai:
          additionalProperties: {}
          type: object
          description: Options sent only to the z-ai provider.
      type: object
    ProviderSort:
      description: The provider sorting strategy (price, throughput, latency)
      enum:
        - price
        - throughput
        - latency
        - exacto
      example: price
      type: string
      x-speakeasy-unknown-values: allow
    ProviderSortConfig:
      description: The provider sorting strategy (price, throughput, latency)
      example:
        by: price
        partition: model
      properties:
        by:
          description: The provider sorting strategy (price, throughput, latency)
          enum:
            - price
            - throughput
            - latency
            - exacto
            - null
          example: price
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
        partition:
          description: >-
            Partitioning strategy for sorting: "model" (default) groups
            endpoints by model before sorting (fallback models remain
            fallbacks), "none" sorts all endpoints together regardless of model.
          enum:
            - model
            - none
            - null
          example: model
          type:
            - string
            - 'null'
          x-speakeasy-unknown-values: allow
      type: object
    AnthropicCacheCreation:
      example:
        ephemeral_1h_input_tokens: 0
        ephemeral_5m_input_tokens: 100
      properties:
        ephemeral_1h_input_tokens:
          type: integer
          description: Input tokens written to the 1-hour prompt cache.
        ephemeral_5m_input_tokens:
          type: integer
          description: Input tokens written to the 5-minute prompt cache.
      required:
        - ephemeral_5m_input_tokens
        - ephemeral_1h_input_tokens
      type:
        - object
        - 'null'
      description: >-
        Input tokens written to the prompt cache, split by cache lifetime
        (5-minute and 1-hour).
    CostDetails:
      description: Breakdown of upstream inference costs
      example:
        upstream_inference_completions_cost: 0.0004
        upstream_inference_cost: null
        upstream_inference_prompt_cost: 0.0008
      properties:
        server_tool_cost:
          description: >-
            Metered server-tool execution cost (for example, shell sandbox time)
            billed for this request, in USD. Matches the billed checkpoint and
            settlement amounts exactly. 0 when a metered server tool ran but
            settled at zero dollars; absent when no metered server tool ran.
          format: double
          type:
            - number
            - 'null'
        upstream_inference_completions_cost:
          format: double
          type: number
          description: What the provider charged for output, in US dollars.
        upstream_inference_cost:
          format: double
          type:
            - number
            - 'null'
          description: >-
            What the provider charged for the request, in US dollars; null when
            not known.
        upstream_inference_prompt_cost:
          format: double
          type: number
          description: What the provider charged for input, in US dollars.
      required:
        - upstream_inference_prompt_cost
        - upstream_inference_completions_cost
      type:
        - object
        - 'null'
    AnthropicUsageIteration:
      anyOf:
        - $ref: '#/components/schemas/AnthropicCompactionUsageIteration'
        - $ref: '#/components/schemas/AnthropicMessageUsageIteration'
        - $ref: '#/components/schemas/AnthropicAdvisorMessageUsageIteration'
        - $ref: '#/components/schemas/AnthropicUnknownUsageIteration'
      example:
        cache_creation: null
        cache_creation_input_tokens: 0
        cache_read_input_tokens: 0
        input_tokens: 100
        output_tokens: 50
        type: message
    AnthropicSpeed:
      enum:
        - fast
        - standard
        - null
      example: standard
      type:
        - string
        - 'null'
      x-speakeasy-unknown-values: allow
      description: >-
        The output speed mode that served the request: "fast" (higher-speed
        inference, priced higher) or "standard"; null when not reported.
    AnthropicCompactionUsageIteration:
      allOf:
        - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
        - properties:
            type:
              enum:
                - compaction
              type: string
              description: One of "compaction".
          required:
            - type
          type: object
      example:
        cache_creation: null
        cache_creation_input_tokens: 0
        cache_read_input_tokens: 0
        input_tokens: 50
        output_tokens: 25
        type: compaction
    AnthropicMessageUsageIteration:
      allOf:
        - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
        - properties:
            model:
              type: string
              description: Model that ran this iteration of the message.
            type:
              enum:
                - message
              type: string
              description: One of "message".
          required:
            - type
          type: object
      example:
        cache_creation: null
        cache_creation_input_tokens: 0
        cache_read_input_tokens: 0
        input_tokens: 100
        output_tokens: 50
        type: message
    AnthropicAdvisorMessageUsageIteration:
      allOf:
        - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
        - properties:
            model:
              type: string
              description: Model the advisor used for this iteration.
            type:
              enum:
                - advisor_message
              type: string
              description: One of "advisor_message".
          required:
            - type
            - model
          type: object
      example:
        cache_creation: null
        cache_creation_input_tokens: 0
        cache_read_input_tokens: 0
        input_tokens: 823
        model: claude-opus-4-6
        output_tokens: 1612
        type: advisor_message
    AnthropicUnknownUsageIteration:
      allOf:
        - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
        - properties:
            type:
              type: string
              description: Kind of usage iteration, one this spec does not list.
          required:
            - type
          type: object
      example:
        cache_creation: null
        cache_creation_input_tokens: 0
        cache_read_input_tokens: 0
        input_tokens: 100
        output_tokens: 50
        type: unknown
    AnthropicBaseUsageIteration:
      example:
        cache_creation: null
        cache_creation_input_tokens: 0
        cache_read_input_tokens: 0
        input_tokens: 100
        output_tokens: 50
      properties:
        cache_creation:
          $ref: '#/components/schemas/AnthropicIterationCacheCreation'
        cache_creation_input_tokens:
          type: integer
          description: Input tokens written to the prompt cache.
        cache_read_input_tokens:
          type: integer
          description: Input tokens read from the prompt cache.
        input_tokens:
          type: integer
          description: >-
            Input tokens this model call used, not counting cache reads or
            writes.
        output_tokens:
          type: integer
          description: Output tokens this model call generated.
      type: object
    AnthropicIterationCacheCreation:
      default: null
      example:
        ephemeral_1h_input_tokens: 0
        ephemeral_5m_input_tokens: 0
      properties:
        ephemeral_1h_input_tokens:
          type: integer
          description: Input tokens written to the 1-hour prompt cache.
        ephemeral_5m_input_tokens:
          type: integer
          description: Input tokens written to the 5-minute prompt cache.
      type:
        - object
        - 'null'
      description: >-
        Input tokens this iteration wrote to the prompt cache, split by cache
        lifetime (5-minute and 1-hour).
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        A Nemonist key (sk-nm-...) as a bearer token in the Authorization
        header.

````

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