openapi: '3.1.0'
info:
  title: Artificial Analysis API
  version: '2.0'
  description: |
    Use the Artificial Analysis dataset inside your own products, research, analysis, and monitoring systems. The API provides structured model metadata, benchmark results, pricing, and performance data across language, image, video, music, and speech.

    ## License and usage

    Use of the API requires attribution across all tiers. When you display or share API data, credit [Artificial Analysis](https://artificialanalysis.ai/) as the source. A visible byline or footer link is sufficient.

    Use of the API is also subject to our [Terms of Use](https://artificialanalysis.ai/docs/legal/Terms-of-Use.pdf). For redistribution rights or bespoke contract terms, [contact the team](https://artificialanalysis.ai/data-api#contact).

    ## Authentication

    All endpoints require an API key in the `x-api-key` header.

    ```
    curl -H "x-api-key: YOUR_API_KEY" https://artificialanalysis.ai/api/v2/language/models
    ```

    Create or copy a key from [API key management](https://artificialanalysis.ai/api-key-management-redirect). For Commercial access, [contact the team](https://artificialanalysis.ai/data-api#contact).

    ## Tiers

    | Tier | Access | Notes |
    | --- | --- | --- |
    | **Free** | The `/free` model-list endpoints — `/api/v2/language/models/free` and the 11 `/api/v2/media/.../models/free` siblings — return a Free-shape response with the public subset of fields | Standard non-`/free` routes are Pro+ and return `403` for Free API keys. Use the `/free` sibling instead |
    | **Pro** | Full access to the standard V2 endpoint set documented here, including LLM detail, provider data, pricing, richer performance data, and the Pro-shape model-list responses | This is the main paid tier for the new V2 API |
    | **Commercial** | Everything in Pro, plus expanded data access negotiated on a per-organization basis. Examples include raw provider measurements, hardware data, or other ad-hoc additions | Commercial access is provisioned separately. [Contact the team](https://artificialanalysis.ai/data-api#contact) to discuss scope |

    ## Rate limits

    | Tier | Requests per day |
    | --- | --- |
    | Free | 25 |
    | Pro | 100 |
    | Commercial | Custom. [Contact the team](https://artificialanalysis.ai/data-api#contact) |

    ## Response headers

    Every authenticated response carries:

    - `X-AA-Tier` — the subscription tier that served the request (`free`, `pro`, or `commercial`). Mirrors the `tier` field in the response body.
    - `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` — current rate-limit state.
    - `Retry-After` — included on `429` responses; seconds until the quota resets.

    ## Data conventions

    - Dates use **ISO 8601** format (for example, `2025-06-15` or `2025-06-15T14:30:00.000Z`)
    - Country codes use lowercased **ISO 3166-1 alpha-2** values (for example, `us`, `cn`, `gb`)
    - End-to-end response times assume **500 answer tokens** unless a field name states otherwise
    - Nulls mean "not measured" or "not applicable"; they never mean zero

    ## Intelligence Index versioning

    `artificial_analysis_intelligence_index` is a composite score, and what goes into it evolves. We version the index so you can interpret a score in context.

    **Current version: v4.0.** Full composition and version history on the [Intelligence Index methodology page](https://artificialanalysis.ai/methodology/intelligence-benchmarking).

    **How versions change:**

    - **Major version bumps** change the set of contributing benchmarks. Scores are not comparable across major versions.
    - **Minor version bumps** change weightings, scoring adjustments, or evaluation refreshes within the same benchmark set. Scores may shift.

    **Currently included** (v4.0, 10 evaluations): GDPval-AA, τ²-Bench Telecom, Terminal-Bench Hard, SciCode, AA-LCR, AA-Omniscience, IFBench, HLE, GPQA Diamond, CritPt.

    `artificial_analysis_coding_index` and `artificial_analysis_agentic_index` are derived from subsets of these evaluations and are not separately versioned.

servers:
  - url: https://artificialanalysis.ai
    description: Production

security:
  - ApiKeyAuth: []

tags:
  - name: Language Models
    description: Evaluations, pricing, performance, and metadata for language models
  - name: Language Model Providers
    description: Capabilities, pricing, and performance for language model API providers
  - name: Media - Image Arena
    description: Image generation arena rankings for text-to-image and image-editing models
  - name: Media - Video Arena
    description: Video generation arena rankings for text-to-video, image-to-video, and audio-enabled video models
  - name: Media - Speech
    description: Speech arena rankings, speech-to-speech data, and speech-to-text model data
  - name: Media - Music
    description: Music generation arena rankings for instrumental and vocal models
  - name: Language Model Measurements
    description: |
      Raw measurement-level data for LLM performance benchmarking.

      **Commercial only** — this endpoint requires a Commercial API key with explicit provider-level grants.
      [Contact us](https://artificialanalysis.ai/data-api#contact) to discuss Commercial access.
  - name: CritPt Evaluation
    description: |
      Submit code solutions for grading against the CritPt benchmark.

      Unlike the other endpoints in this API, this is **not** a data retrieval endpoint. It is a
      code evaluation service. You submit generated code for specific CritPt problems and receive
      grading results from the CritPt evaluation server.

      Rate limited to **10 requests per day** per user. Rate limit headers (`X-RateLimit-Limit`,
      `X-RateLimit-Remaining`, `X-RateLimit-Reset`, `Retry-After`) are included in every response.

paths:
  # ─── Language Model Endpoints ───────────────────────────────────────

  /api/v2/language/models/free:
    get:
      operationId: getLanguageModelsFree
      summary: Get language models (Free tier)
      description: |
        Free-tier sibling of `/api/v2/language/models`. Returns the Free-shape language model
        response: the public subset of fields. Includes headline indices, median performance,
        and input/output pricing. Excludes Pro-only fields such as the full evaluation set,
        token counts, blended pricing, performance percentiles, context window, parameters,
        modalities, licensing, and provider detail.

        Accepts any valid API key (Free, Pro, or Commercial). Pro and Commercial keys also
        receive the Free-shape body when calling this URL; the `tier` field reflects the
        caller's actual tier.
      tags: [Language Models]
      parameters:
        - $ref: '#/components/parameters/page'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/language/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/language/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/language/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMModelsFreeResponse'
              examples:
                free_tier:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    intelligence_index_version: 4
                    pagination: { page: 1, page_size: 200, total_pages: 2, has_more: true }
                    data:
                      - id: '36f73aaf-d38a-4b56-a2b3-d04d17186910'
                        name: 'gpt-oss-20B (high)'
                        slug: 'gpt-oss-20b'
                        release_date: '2025-08-05'
                        model_creator:
                          id: 'e67e56e3-15cd-43db-b679-da4660a69f41'
                          name: 'OpenAI'
                        evaluations:
                          artificial_analysis_intelligence_index: 24.5
                          artificial_analysis_coding_index: 18.5
                          artificial_analysis_agentic_index: 27.6
                        artificial_analysis_intelligence_index_cost:
                          total_cost: 20.69
                        pricing:
                          price_1m_input_tokens: 0.06
                          price_1m_output_tokens: 0.2
                          price_1m_cache_hit_tokens: 0.015
                          price_1m_cache_write_tokens: 0.075
                        performance:
                          median_output_tokens_per_second: 296.47
                          median_time_to_first_token_seconds: 0.65
                          median_time_to_first_answer_token_seconds: 7.4
                          median_end_to_end_response_time_seconds: 9.09
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/language/models:
    get:
      operationId: getLanguageModels
      summary: Get all language models
      description: |
        Returns language model data including evaluations, pricing, and performance metrics.
        Detail-only fields (evaluation token counts, omniscience/openness breakdowns, providers)
        are available on `/api/v2/language/models/{slug}`.

        **Pro+ only.** Free integrations should use [`/api/v2/language/models/free`](#getLanguageModelsFree) instead.
      tags: [Language Models]
      parameters:
        - $ref: '#/components/parameters/prompt_type'
        - $ref: '#/components/parameters/page'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/language/models" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/language/models",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/language/models",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMModelsResponse'
              examples:
                pro_tier:
                  summary: Pro tier example response
                  value:
                    tier: pro
                    intelligence_index_version: 4
                    pagination: { page: 1, page_size: 200, total_pages: 2, has_more: true }
                    data:
                      - id: '36f73aaf-d38a-4b56-a2b3-d04d17186910'
                        name: 'gpt-oss-20B (high)'
                        slug: 'gpt-oss-20b'
                        release_date: '2025-08-05'
                        model_creator:
                          id: 'e67e56e3-15cd-43db-b679-da4660a69f41'
                          name: 'OpenAI'
                          country: 'us'
                        reasoning_model: true
                        evaluations:
                          artificial_analysis_intelligence_index: 24.5
                          artificial_analysis_coding_index: 18.5
                          artificial_analysis_agentic_index: 27.6
                          tau2_telecom: 0.6
                          terminalbench_hard: 0.11
                          scicode: 0.34
                          aa_lcr: 0.31
                          aa_omniscience_index: -63.92
                          aa_omniscience_accuracy: 0.16
                          aa_omniscience_non_hallucination_rate: 0.06
                          ifbench: 0.65
                          hle: 0.1
                          gpqa_diamond: 0.69
                          critpt: 0.01
                          gdpval_aa_elo: 681
                          gdpval_aa_normalized: 0.09
                          mmmu_pro: null
                          artificial_analysis_openness_index: 38.9
                          artificial_analysis_multilingual_index: 0.8
                        artificial_analysis_intelligence_index_cost:
                          total_cost: 20.69
                          input_cost: 8.42
                          reasoning_cost: 11.66
                          answer_cost: 0.6
                        artificial_analysis_intelligence_index_token_counts:
                          input_tokens: 140318252
                          answer_tokens: 3023621
                          output_tokens: 61344686
                          reasoning_tokens: 58321064
                        pricing:
                          price_1m_blended_3_to_1: 0.09
                          price_1m_blended_7_to_2_to_1: 0.04
                          price_1m_input_tokens: 0.06
                          price_1m_output_tokens: 0.2
                          price_1m_cache_hit_tokens: 0.015
                          price_1m_cache_write_tokens: 0.075
                        performance:
                          percentile_05_output_tokens_per_second: 74.74
                          quartile_25_output_tokens_per_second: 164.57
                          median_output_tokens_per_second: 296.47
                          quartile_75_output_tokens_per_second: 405.84
                          percentile_95_output_tokens_per_second: 858.3
                          percentile_05_time_to_first_token_seconds: 0.28
                          quartile_25_time_to_first_token_seconds: 0.4
                          median_time_to_first_token_seconds: 0.65
                          quartile_75_time_to_first_token_seconds: 0.97
                          percentile_95_time_to_first_token_seconds: 16.22
                          median_time_to_first_answer_token_seconds: 7.4
                          median_end_to_end_response_time_seconds: 9.09
                        context_window_tokens: 131072
                        parameters:
                          total: 21
                          active: 4
                        modalities:
                          input: { text: true, image: false, video: false, speech: false }
                          output: { text: true, image: false, video: false, speech: false }
                        licensing:
                          is_open_weights: true
                        huggingface_url: 'https://huggingface.co/openai/gpt-oss-20b'
                        openrouter_api_id: 'openai/gpt-oss-20b'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/language/models/{slug}:
    get:
      operationId: getLanguageModelBySlug
      summary: Get a single language model by slug
      description: |
        Returns data for a single language model identified by its slug.
        Includes all pro tier list fields plus detail-only fields:
        evaluation token counts, omniscience/openness breakdowns, and per-provider data.

        Pro and Commercial only. Free tier requests return a `403` subscription error.
      tags: [Language Models]
      parameters:
        - name: slug
          in: path
          required: true
          description: The model slug (e.g. "gemini-3-pro", "claude-opus-4-6", "deepseek-v3").
          schema:
            type: string
        - $ref: '#/components/parameters/prompt_type'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/language/models/claude-sonnet-4?prompt_type=medium" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/language/models/claude-sonnet-4",
                headers={"x-api-key": "YOUR_API_KEY"},
                params={"prompt_type": "medium"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/language/models/claude-sonnet-4?prompt_type=medium",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMModelItemResponse'
              examples:
                pro_tier:
                  summary: Pro tier detail example response
                  value:
                    tier: pro
                    intelligence_index_version: 4
                    data:
                      id: '36f73aaf-d38a-4b56-a2b3-d04d17186910'
                      name: 'gpt-oss-20B (high)'
                      slug: 'gpt-oss-20b'
                      release_date: '2025-08-05'
                      model_creator:
                        id: 'e67e56e3-15cd-43db-b679-da4660a69f41'
                        name: 'OpenAI'
                        country: 'us'
                      reasoning_model: true
                      evaluations:
                        artificial_analysis_intelligence_index: 24.5
                        artificial_analysis_coding_index: 18.5
                        artificial_analysis_agentic_index: 27.6
                        tau2_telecom: 0.6
                        terminalbench_hard: 0.11
                        scicode: 0.34
                        aa_lcr: 0.31
                        aa_omniscience_index: -63.92
                        aa_omniscience_accuracy: 0.16
                        aa_omniscience_non_hallucination_rate: 0.06
                        ifbench: 0.65
                        hle: 0.1
                        gpqa_diamond: 0.69
                        critpt: 0.01
                        gdpval_aa_elo: 681
                        gdpval_aa_normalized: 0.09
                        mmmu_pro: null
                        artificial_analysis_openness_index: 38.9
                        artificial_analysis_multilingual_index: 0.8
                      artificial_analysis_intelligence_index_cost:
                        total_cost: 20.69
                        input_cost: 8.42
                        reasoning_cost: 11.66
                        answer_cost: 0.6
                      artificial_analysis_intelligence_index_token_counts:
                        input_tokens: 140318252
                        answer_tokens: 3023621
                        output_tokens: 61344686
                        reasoning_tokens: 58321064
                      pricing:
                        price_1m_blended_3_to_1: 0.09
                        price_1m_blended_7_to_2_to_1: 0.04
                        price_1m_input_tokens: 0.06
                        price_1m_output_tokens: 0.2
                        price_1m_cache_hit_tokens: 0.015
                        price_1m_cache_write_tokens: 0.075
                      performance:
                        percentile_05_output_tokens_per_second: 74.74
                        quartile_25_output_tokens_per_second: 164.57
                        median_output_tokens_per_second: 296.47
                        quartile_75_output_tokens_per_second: 405.84
                        percentile_95_output_tokens_per_second: 858.3
                        percentile_05_time_to_first_token_seconds: 0.28
                        quartile_25_time_to_first_token_seconds: 0.4
                        median_time_to_first_token_seconds: 0.65
                        quartile_75_time_to_first_token_seconds: 0.97
                        percentile_95_time_to_first_token_seconds: 16.22
                        median_time_to_first_answer_token_seconds: 7.4
                        median_end_to_end_response_time_seconds: 9.09
                      context_window_tokens: 131072
                      parameters:
                        total: 21
                        active: 4
                      modalities:
                        input: { text: true, image: false, video: false, speech: false }
                        output: { text: true, image: false, video: false, speech: false }
                      licensing:
                        is_open_weights: true
                      huggingface_url: 'https://huggingface.co/openai/gpt-oss-20b'
                      openrouter_api_id: 'openai/gpt-oss-20b'
                      evaluation_token_counts:
                        hle:
                          input_tokens: 12345678
                          answer_tokens: 234567
                          output_tokens: 5432109
                          reasoning_tokens: 5197542
                        aa_lcr:
                          input_tokens: 8765432
                          answer_tokens: 152340
                          output_tokens: 4567890
                          reasoning_tokens: 4415550
                        gpqa_diamond:
                          input_tokens: 6543210
                          answer_tokens: 198765
                          output_tokens: 3210987
                          reasoning_tokens: 3012222
                        tau2_telecom:
                          input_tokens: 18765432
                          answer_tokens: 432109
                          output_tokens: 9876543
                          reasoning_tokens: 9444434
                        critpt:
                          input_tokens: 5432109
                          answer_tokens: 123456
                          output_tokens: 2345678
                          reasoning_tokens: 2222222
                        gdpval_aa:
                          input_tokens: 22345678
                          answer_tokens: 567890
                          output_tokens: 11234567
                          reasoning_tokens: 10666677
                        ifbench:
                          input_tokens: 7654321
                          answer_tokens: 187654
                          output_tokens: 3987654
                          reasoning_tokens: 3800000
                        scicode:
                          input_tokens: 14567890
                          answer_tokens: 345678
                          output_tokens: 6789012
                          reasoning_tokens: 6443334
                        mmmu_pro:
                          input_tokens: 9876543
                          answer_tokens: 234567
                          output_tokens: 4321098
                          reasoning_tokens: 4086531
                        aa_omniscience:
                          input_tokens: 15432109
                          answer_tokens: 198765
                          output_tokens: 5678901
                          reasoning_tokens: 5480136
                        terminalbench_hard:
                          input_tokens: 18589850
                          answer_tokens: 347830
                          output_tokens: 3900246
                          reasoning_tokens: 3552416
                      aa_omniscience_breakdown:
                        total:
                          accuracy: 0.155
                          omniscience: -63.917
                          hallucination_rate: 0.941
                        law:
                          accuracy: 0.082
                          omniscience: -74.9
                          hallucination_rate: 0.905
                        health:
                          accuracy: 0.15
                          omniscience: -65.4
                          hallucination_rate: 0.946
                        business:
                          accuracy: 0.125
                          omniscience: -67.9
                          hallucination_rate: 0.919
                        humanities_and_social_sciences:
                          accuracy: 0.136
                          omniscience: -68.2
                          hallucination_rate: 0.947
                        science_engineering_and_mathematics:
                          accuracy: 0.256
                          omniscience: -44.9
                          hallucination_rate: 0.948
                        software_engineering:
                          accuracy: 0.183
                          omniscience: -62.2
                          hallucination_rate: 0.985
                      artificial_analysis_openness_index_breakdown:
                        weights_access: 3
                        weights_license: 3
                        data_pretrain_access: 0
                        data_pretrain_license: 0
                        data_posttrain_access: 0
                        data_posttrain_license: 0
                        methodology_license: 0
                        methodology_disclosure: 1
                        artificial_analysis_openness_index: 38.889
                      providers:
                        - id: 'b08f179e-4a69-4f35-b350-8f7144a8b7c8'
                          name: 'Novita'
                          slug: 'novita'
                          pricing:
                            price_1m_blended_3_to_1: 0.07
                            price_1m_blended_7_to_2_to_1: 0.03
                            price_1m_input_tokens: 0.04
                            price_1m_output_tokens: 0.15
                            price_1m_cache_hit_tokens: 0.01
                            price_1m_cache_write_tokens: 0.05
                          performance:
                            percentile_05_output_tokens_per_second: 61.93
                            quartile_25_output_tokens_per_second: 80.21
                            median_output_tokens_per_second: 105.43
                            quartile_75_output_tokens_per_second: 136.95
                            percentile_95_output_tokens_per_second: 188.2
                            percentile_05_time_to_first_token_seconds: 0.6
                            quartile_25_time_to_first_token_seconds: 0.61
                            median_time_to_first_token_seconds: 0.64
                            quartile_75_time_to_first_token_seconds: 0.74
                            percentile_95_time_to_first_token_seconds: 1.51
                            median_time_to_first_answer_token_seconds: 6.18
                            median_end_to_end_response_time_seconds: 10.92
                          context_window_tokens: 131072
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Free tier subscription error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: 'Model detail requires an Artificial Analysis Pro subscription'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/language/models/{slug}/performance:
    get:
      operationId: getLanguageModelPerformanceOverTime
      summary: Get performance over time for a single model
      description: |
        Returns a time series of performance metrics for the specified model, broken down by API provider.
        Each provider that offers this model will have its own series of data points within the requested window.

        The four metrics tracked per data point are:
        - **Output speed** — median tokens generated per second (`median_output_tokens_per_second`)
        - **Time to first token** — median latency before the first token is returned (`median_time_to_first_token_seconds`)
        - **Time to first answer token** — median time until the first answer token is available (`median_time_to_first_answer_token_seconds`)
        - **End-to-end response time** — median end-to-end response time in seconds (`median_end_to_end_response_time_seconds`)

        Use `window` to control how far back the data goes and `interval` to control the granularity
        (e.g. `window=90d&interval=weekly` returns ~13 weekly data points per provider).

        Pro and Commercial only. Free tier requests return a `403` subscription error.
      tags: [Language Models]
      parameters:
        - name: slug
          in: path
          required: true
          description: The unique identifier for the model (e.g. `claude-sonnet-4`). Use the `/models` endpoint to discover available slugs.
          schema:
            type: string
        - name: window
          in: query
          description: 'Lookback period from today. Maximum 90 days for single-model endpoint.'
          schema:
            type: string
            enum: [7d, 30d, 90d]
            default: 90d
        - $ref: '#/components/parameters/interval'
        - $ref: '#/components/parameters/prompt_type'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/language/models/claude-sonnet-4/performance?window=90d&interval=weekly" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/language/models/claude-sonnet-4/performance",
                headers={"x-api-key": "YOUR_API_KEY"},
                params={"window": "90d", "interval": "weekly"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/language/models/claude-sonnet-4/performance?window=90d&interval=weekly",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelPerformanceOverTimeResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Free tier subscription error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: 'Performance over time requires an Artificial Analysis Pro subscription'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'

  # ─── Language Model Provider Endpoints ──────────────────────────────

  /api/v2/language/providers:
    get:
      operationId: getLanguageProviders
      summary: Get all language model API providers
      description: |
        Returns data for all API providers including the models they offer,
        pricing, and median performance metrics.

        Pro and Commercial only. Free tier requests return a `403` subscription error.
      tags: [Language Model Providers]
      parameters:
        - $ref: '#/components/parameters/page'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/language/providers" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/language/providers",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/language/providers",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMProvidersResponse'
              examples:
                pro_tier:
                  summary: Pro tier example response
                  value:
                    tier: pro
                    pagination: { page: 1, page_size: 200, total_pages: 1, has_more: false }
                    data:
                      - id: 'e0bfeec9-405f-4e75-b120-a52bdd70c812'
                        name: 'Together.ai'
                        slug: 'togetherai'
                        country: 'us'
                        models:
                          - id: '43fc5506-c5ed-4dee-9b85-962bf7ae3986'
                            name: "DeepSeek V3 (Dec '24)"
                            slug: 'deepseek-v3'
                            pricing:
                              price_1m_blended_3_to_1: 1.25
                              price_1m_blended_7_to_2_to_1: 0.47
                              price_1m_input_tokens: 1.25
                              price_1m_output_tokens: 1.25
                              price_1m_cache_hit_tokens: 0.13
                              price_1m_cache_write_tokens: 1.56
                            performance:
                              median_output_tokens_per_second: 66.14
                              median_time_to_first_token_seconds: 0.55
                              median_time_to_first_answer_token_seconds: 0.55
                              median_end_to_end_response_time_seconds: 8.11
                            context_window_tokens: 128000
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Free tier subscription error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: 'Providers list requires an Artificial Analysis Pro subscription'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/language/providers/{slug}:
    get:
      operationId: getLanguageProviderBySlug
      summary: Get a single language model provider by slug
      description: |
        Returns data for a single API provider identified by its slug.
        Includes all fields from the providers list plus full performance
        percentile and quartile data for each model.
        Supports custom prompt_type, window, and interval parameters.

        Pro and Commercial only. Free tier requests return a `403` subscription error.
      tags: [Language Model Providers]
      parameters:
        - name: slug
          in: path
          required: true
          description: The provider slug (e.g. "openai", "fireworks").
          schema:
            type: string
        - $ref: '#/components/parameters/prompt_type'
        - $ref: '#/components/parameters/window'
        - $ref: '#/components/parameters/interval'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/language/providers/fireworks?prompt_type=medium" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/language/providers/fireworks",
                headers={"x-api-key": "YOUR_API_KEY"},
                params={"prompt_type": "medium"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/language/providers/fireworks?prompt_type=medium",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LLMProviderItemResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Free tier subscription error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: 'Provider detail requires an Artificial Analysis Pro subscription'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/language/providers/{slug}/performance:
    get:
      operationId: getLanguageProviderPerformanceOverTime
      summary: Get performance over time for a single provider
      description: |
        Returns performance time series for each model offered by the specified provider,
        looking back from today by the specified window.

        This is the inverse of the model performance endpoint — here you pick a provider and see
        how each of their models has performed over time.

        Pro and Commercial only. Free tier requests return a `403` subscription error.
      tags: [Language Model Providers]
      parameters:
        - name: slug
          in: path
          required: true
          description: The unique identifier for the provider (e.g. `anthropic`). Use the `/providers` endpoint to discover available slugs.
          schema:
            type: string
        - $ref: '#/components/parameters/window'
        - $ref: '#/components/parameters/interval'
        - $ref: '#/components/parameters/prompt_type'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/language/providers/anthropic/performance?window=90d&interval=weekly" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/language/providers/anthropic/performance",
                headers={"x-api-key": "YOUR_API_KEY"},
                params={"window": "90d", "interval": "weekly"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/language/providers/anthropic/performance?window=90d&interval=weekly",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderPerformanceOverTimeResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Free tier subscription error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: 'Performance over time requires an Artificial Analysis Pro subscription'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'

  # ─── LLM Measurement Endpoints (Commercial) ─────────────────────────

  /api/v2/language/providers/{slug}/measurements:
    get:
      operationId: getLanguageProviderMeasurements
      summary: Get raw measurements for a provider
      description: |
        Returns individual measurement records for the specified provider, including per-request
        output speed, time to first token, time to first answer token, estimated end-to-end response time,
        and success status. Results are grouped by model within the provider.

        **Commercial tier only.** Your API key must have explicit grants for the requested provider.
        If you are interested in accessing this endpoint, please [contact us](https://artificialanalysis.ai/data-api#contact)
        to discuss Commercial access.
      tags: [Language Model Measurements]
      parameters:
        - name: slug
          in: path
          required: true
          description: The unique identifier for the provider (e.g. `anthropic`). Your Commercial API key must have grants for this provider.
          schema:
            type: string
        - $ref: '#/components/parameters/prompt_type'
        - name: start_date
          in: query
          description: |
            Only return measurements recorded on or after this date (YYYY-MM-DD).
            Defaults to 90 days ago if omitted.
          schema:
            type: string
            format: date
            example: '2025-01-01'
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/language/providers/anthropic/measurements?prompt_type=medium&start_date=2025-01-01" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/language/providers/anthropic/measurements",
                headers={"x-api-key": "YOUR_API_KEY"},
                params={"prompt_type": "medium", "start_date": "2025-01-01"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/language/providers/anthropic/measurements?prompt_type=medium&start_date=2025-01-01",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeasurementsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Commercial access required — your API key does not have grants for this provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Commercial access required
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  # ─── CritPt Evaluation Endpoint ──────────────────────────────────────

  /api/v2/critpt/evaluate:
    post:
      operationId: evaluateCritPt
      summary: Submit code for CritPt evaluation
      description: |
        Submit generated code solutions for grading against CritPt benchmark problems.

        This endpoint differs from the rest of the API. It is a **code evaluation service**,
        not a data retrieval endpoint. It accepts one or more code submissions and returns
        grading results from the CritPt evaluation server.

        Rate limited to **10 requests per day** per user. Rate limit information is returned
        via `X-RateLimit-*` response headers.
      tags: [CritPt Evaluation]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [submissions, batch_metadata]
              properties:
                submissions:
                  type: array
                  description: One or more code submissions to evaluate.
                  items:
                    type: object
                    required: [problem_id, generated_code, model, generation_config]
                    properties:
                      problem_id:
                        type: string
                        description: The CritPt problem identifier.
                      generated_code:
                        type: string
                        description: The generated code solution to evaluate.
                      model:
                        type: string
                        description: The model that generated the code.
                      generation_config:
                        type: object
                        description: Configuration used for code generation (passed through to the grader).
                        additionalProperties: true
                      messages:
                        type: array
                        description: Optional conversation messages that produced the code.
                        items:
                          type: object
                          additionalProperties: true
                batch_metadata:
                  type: object
                  description: Metadata about the submission batch (passed through to the grader).
                  additionalProperties: true
            example:
              submissions:
                - problem_id: prob_001
                  generated_code: 'import numpy as np\n\ndef solve():\n    return np.array([1, 2, 3])'
                  model: claude-sonnet-4-20250514
                  generation_config:
                    temperature: 0
                    max_tokens: 4096
              batch_metadata:
                run_id: my-eval-run-001
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl -X POST "https://artificialanalysis.ai/api/v2/critpt/evaluate" \
              -H "x-api-key: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "submissions": [{
                  "problem_id": "prob_001",
                  "generated_code": "import numpy as np\n\ndef solve():\n    return np.array([1, 2, 3])",
                  "model": "claude-sonnet-4-20250514",
                  "generation_config": { "temperature": 0, "max_tokens": 4096 }
                }],
                "batch_metadata": { "run_id": "my-eval-run-001" }
              }'
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.post(
                "https://artificialanalysis.ai/api/v2/critpt/evaluate",
                headers={"x-api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
                json={
                    "submissions": [{
                        "problem_id": "prob_001",
                        "generated_code": "import numpy as np\n\ndef solve():\n    return np.array([1, 2, 3])",
                        "model": "claude-sonnet-4-20250514",
                        "generation_config": {"temperature": 0, "max_tokens": 4096},
                    }],
                    "batch_metadata": {"run_id": "my-eval-run-001"},
                }
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/critpt/evaluate",
              {
                method: "POST",
                headers: {
                  "x-api-key": "YOUR_API_KEY",
                  "Content-Type": "application/json",
                },
                body: JSON.stringify({
                  submissions: [{
                    problem_id: "prob_001",
                    generated_code: "import numpy as np\n\ndef solve():\n    return np.array([1, 2, 3])",
                    model: "claude-sonnet-4-20250514",
                    generation_config: { temperature: 0, max_tokens: 4096 },
                  }],
                  batch_metadata: { run_id: "my-eval-run-001" },
                }),
              }
            );
            const data = await response.json();
      responses:
        '200':
          description: Evaluation results from the CritPt grading server.
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
              description: When the current rate limit window resets.
          content:
            application/json:
              schema:
                description: Grading results returned by the CritPt evaluation server. The response shape is determined by the upstream grader.
                type: object
                additionalProperties: true
        '400':
          description: Invalid request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Invalid body
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          description: Rate limit exceeded (10 requests per day).
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
            X-RateLimit-Remaining:
              schema:
                type: integer
            X-RateLimit-Reset:
              schema:
                type: string
                format: date-time
            Retry-After:
              schema:
                type: integer
              description: Seconds until the rate limit resets.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Rate limit exceeded
        '500':
          $ref: '#/components/responses/InternalError'

  # ─── Media Endpoints ─────────────────────────────────────────────────

  /api/v2/media/text-to-image/models/free:
    get:
      operationId: getTextToImageArenaFree
      summary: Get text-to-image arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/text-to-image/models`. Returns the Free-shape
        arena response — model identity plus Elo and CI only. Accepts any valid API key
        (Free, Pro, or Commercial); Pro and Commercial keys also receive the Free-shape
        body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Image Arena]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/text-to-image/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/text-to-image/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/text-to-image/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageArenaFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: 'a1ee4d6f-d136-434b-bb1d-066fe5f9bf6f'
                        name: 'GPT Image 1.5 (high)'
                        slug: 'openai-gpt_image-1-5'
                        model_creator: { id: 'e67e56e3-15cd-43db-b679-da4660a69f41', name: 'OpenAI' }
                        elo: 1266
                        ci_95: 11
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/text-to-image/models:
    get:
      operationId: getTextToImageArena
      summary: Get text-to-image arena rankings
      description: |
        Returns arena Elo rankings for text-to-image models. Free tier returns model identity plus Elo and CI only; Pro adds rank, samples, pricing, release date, open_weights_url, and optional category breakdowns.

        **Pro+ only.** Free integrations should use [`/api/v2/media/text-to-image/models/free`](#getTextToImageArenaFree) instead.
      tags: [Media - Image Arena]
      parameters:
        - name: include_categories
          in: query
          description: Include per-category Elo breakdowns (Pro tier only).
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/text-to-image/models?include_categories=true" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageArenaResponse'
              examples:
                pro:
                  summary: Pro response with categories
                  value:
                    tier: pro
                    data:
                      - id: 'a1ee4d6f-d136-434b-bb1d-066fe5f9bf6f'
                        name: 'GPT Image 1.5 (high)'
                        slug: 'openai-gpt_image-1-5'
                        model_creator: { id: 'e67e56e3-15cd-43db-b679-da4660a69f41', name: 'OpenAI' }
                        elo: 1266
                        ci_95: 11
                        rank: 1
                        samples: 4650
                        release_date: '2025-12-16'
                        price_per_1k_images: 133
                        open_weights_url: null
                        categories:
                          - label: 'General & Photorealistic'
                            elo: 1273
                            ci_95: 18
                            samples: 1719
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/image-editing/models/free:
    get:
      operationId: getImageEditingArenaFree
      summary: Get image-editing arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/image-editing/models`. Returns the Free-shape
        arena response — model identity plus Elo and CI only. Accepts any valid API key
        (Free, Pro, or Commercial); Pro and Commercial keys also receive the Free-shape
        body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Image Arena]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/image-editing/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/image-editing/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/image-editing/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageArenaFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: 'ae424391-721f-4df7-bf24-a8bef3c4c46c'
                        name: 'Riverflow 2.0'
                        slug: 'sourceful_riverflow-2'
                        model_creator: { id: '71724fa8-622e-455f-aaa2-ef3c5a067f8b', name: 'Sourceful' }
                        elo: 1283
                        ci_95: 9
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/image-editing/models:
    get:
      operationId: getImageEditingArena
      summary: Get image-editing arena rankings
      description: |
        Returns arena Elo rankings for image-editing models. Free tier returns model identity plus Elo and CI only; Pro adds rank, samples, pricing, release date, open_weights_url, and optional category breakdowns.

        **Pro+ only.** Free integrations should use [`/api/v2/media/image-editing/models/free`](#getImageEditingArenaFree) instead.
      tags: [Media - Image Arena]
      parameters:
        - name: include_categories
          in: query
          description: Include per-category Elo breakdowns (Pro tier only).
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/image-editing/models" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageArenaResponse'
              examples:
                pro:
                  summary: Pro response with categories
                  value:
                    tier: pro
                    data:
                      - id: 'ae424391-721f-4df7-bf24-a8bef3c4c46c'
                        name: 'Riverflow 2.0'
                        slug: 'sourceful_riverflow-2'
                        model_creator: { id: '71724fa8-622e-455f-aaa2-ef3c5a067f8b', name: 'Sourceful' }
                        elo: 1283
                        ci_95: 9
                        rank: 1
                        samples: 4650
                        release_date: '2025-12-16'
                        price_per_1k_images: 133
                        open_weights_url: null
                        categories:
                          - label: 'General & Photorealistic'
                            elo: 1273
                            ci_95: 18
                            samples: 1719
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/text-to-video/models/free:
    get:
      operationId: getTextToVideoArenaFree
      summary: Get text-to-video arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/text-to-video/models`. Returns the Free-shape
        arena response — model identity plus Elo and CI only. Accepts any valid API key
        (Free, Pro, or Commercial); Pro and Commercial keys also receive the Free-shape
        body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Video Arena]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/text-to-video/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/text-to-video/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/text-to-video/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoArenaFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: '36db1f4d-a9f6-49d1-a74d-06bddbf2fe4f'
                        name: 'Dreamina Seedance 2.0 720p'
                        slug: 'seedance-2-0'
                        model_creator: { id: '2354746c-4775-4a06-b64d-0ba4137785b8', name: 'ByteDance Seed' }
                        elo: 1269
                        ci_95: 8
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/text-to-video/models:
    get:
      operationId: getTextToVideoArena
      summary: Get text-to-video arena rankings
      description: |
        Returns arena Elo rankings for text-to-video models. Free tier returns model identity plus Elo and CI only; Pro and Commercial add rank, samples, pricing, release date, open_weights_url, and optional category breakdowns.

        **Pro+ only.** Free integrations should use [`/api/v2/media/text-to-video/models/free`](#getTextToVideoArenaFree) instead.
      tags: [Media - Video Arena]
      parameters:
        - name: include_categories
          in: query
          description: Include per-category Elo breakdowns (Pro and Commercial only; ignored on Free tier).
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/text-to-video/models?include_categories=true" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoArenaResponse'
              examples:
                pro_tier:
                  summary: Pro tier response with categories
                  value:
                    tier: pro
                    data:
                      - id: '36db1f4d-a9f6-49d1-a74d-06bddbf2fe4f'
                        name: 'Dreamina Seedance 2.0 720p'
                        slug: 'seedance-2-0'
                        model_creator: { id: '2354746c-4775-4a06-b64d-0ba4137785b8', name: 'ByteDance Seed' }
                        elo: 1269
                        ci_95: 8
                        rank: 1
                        samples: 4271
                        release_date: '2025-06-01'
                        price_per_minute: 0.45
                        open_weights_url: null
                        categories:
                          - label: 'Cinematic'
                            elo: 1284
                            ci_95: 19
                            samples: 812
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/image-to-video/models/free:
    get:
      operationId: getImageToVideoArenaFree
      summary: Get image-to-video arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/image-to-video/models`. Returns the Free-shape
        arena response — model identity plus Elo and CI only. Accepts any valid API key
        (Free, Pro, or Commercial); Pro and Commercial keys also receive the Free-shape
        body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Video Arena]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/image-to-video/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/image-to-video/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/image-to-video/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoArenaFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: '61270a9b-9d2e-4875-810f-e81508bc5504'
                        name: 'Kling 2.1 Master'
                        slug: 'kling-2-1-master'
                        model_creator: { id: '62cc833b-f55a-4489-bcae-54806d4b04ff', name: 'Kuaishou KlingAI' }
                        elo: 1184
                        ci_95: 10
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/image-to-video/models:
    get:
      operationId: getImageToVideoArena
      summary: Get image-to-video arena rankings
      description: |
        Returns arena Elo rankings for image-to-video models. Free tier returns model identity plus Elo and CI only; Pro and Commercial add rank, samples, pricing, release date, open_weights_url, and optional category breakdowns.

        **Pro+ only.** Free integrations should use [`/api/v2/media/image-to-video/models/free`](#getImageToVideoArenaFree) instead.
      tags: [Media - Video Arena]
      parameters:
        - name: include_categories
          in: query
          description: Include per-category Elo breakdowns (Pro and Commercial only; ignored on Free tier).
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/image-to-video/models?include_categories=true" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoArenaResponse'
              examples:
                pro_tier:
                  summary: Pro tier response with categories
                  value:
                    tier: pro
                    data:
                      - id: '61270a9b-9d2e-4875-810f-e81508bc5504'
                        name: 'Kling 2.1 Master'
                        slug: 'kling-2-1-master'
                        model_creator: { id: '62cc833b-f55a-4489-bcae-54806d4b04ff', name: 'Kuaishou KlingAI' }
                        elo: 1184
                        ci_95: 10
                        rank: 1
                        samples: 1890
                        release_date: '2025-03-27'
                        price_per_minute: 0.5
                        open_weights_url: null
                        categories:
                          - label: 'People'
                            elo: 1196
                            ci_95: 21
                            samples: 354
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/text-to-video-audio/models/free:
    get:
      operationId: getTextToVideoAudioArenaFree
      summary: Get text-to-video with audio arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/text-to-video-audio/models`. Returns the
        Free-shape arena response — model identity plus Elo and CI only. Accepts any
        valid API key (Free, Pro, or Commercial); Pro and Commercial keys also receive
        the Free-shape body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Video Arena]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/text-to-video-audio/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/text-to-video-audio/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/text-to-video-audio/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoArenaFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: '5ad8e0d8-d9bf-4a55-904a-f98e7a7a4b2d'
                        name: 'Veo 3 Fast'
                        slug: 'veo-3-fast'
                        model_creator: { id: 'ad0d7c6b-6b44-458a-a95f-9d0cb3d8f8e2', name: 'Google' }
                        elo: 1221
                        ci_95: 14
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/text-to-video-audio/models:
    get:
      operationId: getTextToVideoAudioArena
      summary: Get text-to-video with audio arena rankings
      description: |
        Returns arena Elo rankings for text-to-video models that generate video with audio output. Free tier returns model identity plus Elo and CI only; Pro and Commercial add rank, samples, pricing, release date, open_weights_url, and optional category breakdowns.

        **Pro+ only.** Free integrations should use [`/api/v2/media/text-to-video-audio/models/free`](#getTextToVideoAudioArenaFree) instead.
      tags: [Media - Video Arena]
      parameters:
        - name: include_categories
          in: query
          description: Include per-category Elo breakdowns (Pro and Commercial only; ignored on Free tier).
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/text-to-video-audio/models?include_categories=true" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoArenaResponse'
              examples:
                pro_tier:
                  summary: Pro tier response with categories
                  value:
                    tier: pro
                    data:
                      - id: '5ad8e0d8-d9bf-4a55-904a-f98e7a7a4b2d'
                        name: 'Veo 3 Fast'
                        slug: 'veo-3-fast'
                        model_creator: { id: 'ad0d7c6b-6b44-458a-a95f-9d0cb3d8f8e2', name: 'Google' }
                        elo: 1221
                        ci_95: 14
                        rank: 1
                        samples: 2334
                        release_date: '2025-05-20'
                        price_per_minute: 0.75
                        open_weights_url: null
                        categories:
                          - label: 'Dialogue'
                            elo: 1237
                            ci_95: 27
                            samples: 401
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/image-to-video-audio/models/free:
    get:
      operationId: getImageToVideoAudioArenaFree
      summary: Get image-to-video with audio arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/image-to-video-audio/models`. Returns the
        Free-shape arena response — model identity plus Elo and CI only. Accepts any
        valid API key (Free, Pro, or Commercial); Pro and Commercial keys also receive
        the Free-shape body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Video Arena]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/image-to-video-audio/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/image-to-video-audio/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/image-to-video-audio/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoArenaFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: '8b7cdcab-6f22-4d95-8d0f-f09db1d2233d'
                        name: 'PixVerse V4.5 Audio'
                        slug: 'pixverse-v4-5-audio'
                        model_creator: { id: '1cb39f34-a0b6-4ca8-82fd-fec0e068eb7a', name: 'PixVerse' }
                        elo: 1163
                        ci_95: 17
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/image-to-video-audio/models:
    get:
      operationId: getImageToVideoAudioArena
      summary: Get image-to-video with audio arena rankings
      description: |
        Returns arena Elo rankings for image-to-video models that generate video with audio output. Free tier returns model identity plus Elo and CI only; Pro and Commercial add rank, samples, pricing, release date, open_weights_url, and optional category breakdowns.

        **Pro+ only.** Free integrations should use [`/api/v2/media/image-to-video-audio/models/free`](#getImageToVideoAudioArenaFree) instead.
      tags: [Media - Video Arena]
      parameters:
        - name: include_categories
          in: query
          description: Include per-category Elo breakdowns (Pro and Commercial only; ignored on Free tier).
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/image-to-video-audio/models?include_categories=true" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoArenaResponse'
              examples:
                pro_tier:
                  summary: Pro tier response with categories
                  value:
                    tier: pro
                    data:
                      - id: '8b7cdcab-6f22-4d95-8d0f-f09db1d2233d'
                        name: 'PixVerse V4.5 Audio'
                        slug: 'pixverse-v4-5-audio'
                        model_creator: { id: '1cb39f34-a0b6-4ca8-82fd-fec0e068eb7a', name: 'PixVerse' }
                        elo: 1163
                        ci_95: 17
                        rank: 1
                        samples: 987
                        release_date: '2025-02-14'
                        price_per_minute: 0.6
                        open_weights_url: null
                        categories:
                          - label: 'Animation'
                            elo: 1178
                            ci_95: 34
                            samples: 188
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/text-to-speech/models/free:
    get:
      operationId: getTextToSpeechArenaFree
      summary: Get text-to-speech arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/text-to-speech/models`. Returns the Free-shape
        arena response — model identity plus Elo and CI only. Accepts any valid API key
        (Free, Pro, or Commercial); Pro and Commercial keys also receive the Free-shape
        body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Speech]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/text-to-speech/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/text-to-speech/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/text-to-speech/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextToSpeechFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: '6e0eadf0-3bf9-4424-a563-90292f2a0afd'
                        name: 'Inworld TTS 1.5 Max'
                        slug: 'tts-1-5-max'
                        model_creator: { id: '3aab6d2e-04b0-43ee-996f-d8ef76ac3232', name: 'Inworld' }
                        elo: 1240
                        ci_95: 22
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/text-to-speech/models:
    get:
      operationId: getTextToSpeechArena
      summary: Get text-to-speech arena rankings
      description: |
        Returns arena Elo rankings for text-to-speech models. Free tier returns model identity plus Elo and CI only; Pro adds samples, release date, and pricing.

        **Pro+ only.** Free integrations should use [`/api/v2/media/text-to-speech/models/free`](#getTextToSpeechArenaFree) instead.
      tags: [Media - Speech]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/text-to-speech/models" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextToSpeechResponse'
              examples:
                pro:
                  summary: Pro response
                  value:
                    tier: pro
                    data:
                      - id: '6e0eadf0-3bf9-4424-a563-90292f2a0afd'
                        name: 'Inworld TTS 1.5 Max'
                        slug: 'tts-1-5-max'
                        model_creator: { id: '3aab6d2e-04b0-43ee-996f-d8ef76ac3232', name: 'Inworld' }
                        elo: 1240
                        ci_95: 22
                        samples: 1330
                        release_date: '2026-01-21'
                        price_per_1m_characters: 10
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/speech-to-speech/models/free:
    get:
      operationId: getSpeechToSpeechFree
      summary: Get speech-to-speech model data (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/speech-to-speech/models`. Returns the Free-shape
        response — model identity plus BBA and FDB scores, with Pro-only per-provider
        pricing and performance data omitted. Accepts any valid API key (Free, Pro, or
        Commercial); Pro and Commercial keys also receive the Free-shape body (no `tier`
        field, no Pro-only fields) when calling this URL.
      tags: [Media - Speech]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/speech-to-speech/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/speech-to-speech/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/speech-to-speech/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpeechToSpeechFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: 'eead24bb-ad0b-45be-b0ab-7b16381c2daf'
                        name: 'GPT 4o audio chatcompletions'
                        slug: '4o-audio-chatcompletions'
                        model_creator: { id: 'e67e56e3-15cd-43db-b679-da4660a69f41', name: 'OpenAI' }
                        bba_score: 0.54
                        fdb_score: null
                        tau_voice_score: 0.37
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/speech-to-speech/models:
    get:
      operationId: getSpeechToSpeech
      summary: Get speech-to-speech model data
      description: |
        Returns data for speech-to-speech models including quality metrics (BBA and FDB scores).
        Pro tier also includes per-provider pricing and performance data.

        **Pro+ only.** Free integrations should use [`/api/v2/media/speech-to-speech/models/free`](#getSpeechToSpeechFree) instead.
      tags: [Media - Speech]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/speech-to-speech/models" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpeechToSpeechResponse'
              examples:
                pro_tier:
                  summary: Pro tier response
                  value:
                    tier: pro
                    data:
                      - id: 'eead24bb-ad0b-45be-b0ab-7b16381c2daf'
                        name: 'GPT 4o audio chatcompletions'
                        slug: '4o-audio-chatcompletions'
                        model_creator: { id: 'e67e56e3-15cd-43db-b679-da4660a69f41', name: 'OpenAI' }
                        bba_score: 0.54
                        fdb_score: null
                        tau_voice_score: 0.37
                        providers:
                          - id: '6047c38a-af71-4b47-9d66-d361753f71b4'
                            name: 'OpenAI'
                            slug: 'openai'
                            price_per_hour_input: 3.6
                            price_per_hour_output: 14.4
                            time_to_first_audio_seconds: 3.38
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/speech-to-text/models/free:
    get:
      operationId: getSpeechToTextModelsFree
      summary: Get speech-to-text models (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/speech-to-text/models`. Returns the Free-shape
        response — model identity plus the overall WER index, with Pro-only benchmark
        breakdowns, open-weights status, and per-provider data omitted. Accepts any valid
        API key (Free, Pro, or Commercial); Pro and Commercial keys also receive the
        Free-shape body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Speech]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/speech-to-text/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/speech-to-text/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/speech-to-text/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpeechToTextModelsFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: '865b890e-c487-4e78-a404-d1af7d7ee910'
                        name: 'GPT-4o Mini Transcribe, OpenAI'
                        model_creator: { id: 'e67e56e3-15cd-43db-b679-da4660a69f41', name: 'OpenAI' }
                        aa_wer_index: 0
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/speech-to-text/models:
    get:
      operationId: getSpeechToTextModels
      summary: Get speech-to-text models
      description: |
        Returns speech-to-text model data including quality metrics (word error rates).
        Free tier returns model identity and overall WER index only.
        Pro tier adds benchmark-specific WER breakdowns, open weights status, and per-provider data.

        **Pro+ only.** Free integrations should use [`/api/v2/media/speech-to-text/models/free`](#getSpeechToTextModelsFree) instead.
      tags: [Media - Speech]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/speech-to-text/models" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpeechToTextModelsResponse'
              examples:
                pro:
                  summary: Pro response
                  value:
                    tier: pro
                    data:
                      - id: '865b890e-c487-4e78-a404-d1af7d7ee910'
                        name: 'GPT-4o Mini Transcribe, OpenAI'
                        model_creator: { id: 'e67e56e3-15cd-43db-b679-da4660a69f41', name: 'OpenAI' }
                        aa_wer_index: 0
                        aa_agenttalk: 0.04
                        voxpopuli_cleaned_aa: 0.02
                        earnings_22_cleaned_aa: 0.08
                        open_weights: false
                        providers:
                          - id: '6047c38a-af71-4b47-9d66-d361753f71b4'
                            name: 'OpenAI'
                            slug: 'openai'
                            price_per_1k_minutes: 3
                            median_speed_factor: 48.36
                            aa_wer_index: 0
                            aa_agenttalk: 0.04
                            voxpopuli_cleaned_aa: 0.02
                            earnings_22_cleaned_aa: 0.08
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  # ─── Music Endpoints ─────────────────────────────────────────────────

  /api/v2/media/music/instrumental/models/free:
    get:
      operationId: getMusicInstrumentalArenaFree
      summary: Get instrumental music arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/music/instrumental/models`. Returns the
        Free-shape arena response — model identity plus Elo and CI only. Accepts any
        valid API key (Free, Pro, or Commercial); Pro and Commercial keys also receive
        the Free-shape body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Music]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/music/instrumental/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/music/instrumental/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/music/instrumental/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MusicArenaFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: '1d06bf78-0a16-4fdf-8029-663a694e3470'
                        name: 'Suno V4.5'
                        model_creator: { id: '30bf1911-2cd9-4bce-a179-009b174196fc', name: 'Suno' }
                        elo: 1120
                        ci_95: 15
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/music/instrumental/models:
    get:
      operationId: getMusicInstrumentalArena
      summary: Get instrumental music arena rankings
      description: |
        Returns arena Elo rankings for instrumental music generation models. Free tier returns model identity plus Elo and CI only; Pro adds samples and optional genre breakdowns.

        **Pro+ only.** Free integrations should use [`/api/v2/media/music/instrumental/models/free`](#getMusicInstrumentalArenaFree) instead.
      tags: [Media - Music]
      parameters:
        - name: include_genres
          in: query
          description: Include per-genre Elo breakdowns (Pro tier only).
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/music/instrumental/models?include_genres=true" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MusicArenaResponse'
              examples:
                pro_tier:
                  summary: Pro response with genre breakdowns
                  value:
                    tier: pro
                    data:
                      - id: 'b5b7f9d3-85d4-47dc-9213-fe09c1ea5da1'
                        name: 'Eleven Music'
                        model_creator: { id: '8d057760-0a8b-460a-9625-6dd261bb325c', name: 'ElevenLabs' }
                        elo: 1064
                        ci_95: 14
                        samples: 2396
                        genres:
                          - label: 'Latin'
                            elo: 1063
                            ci_95: 48
                            samples: 214
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/music/with-vocals/models/free:
    get:
      operationId: getMusicWithVocalsArenaFree
      summary: Get with-vocals music arena rankings (Free tier)
      description: |
        Free-tier sibling of `/api/v2/media/music/with-vocals/models`. Returns the
        Free-shape arena response — model identity plus Elo and CI only. Accepts any
        valid API key (Free, Pro, or Commercial); Pro and Commercial keys also receive
        the Free-shape body (Pro-only fields omitted; the `tier` field reflects the caller's actual tier) when calling this URL.
      tags: [Media - Music]
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/music/with-vocals/models/free" \
              -H "x-api-key: YOUR_API_KEY"
        - lang: Python
          label: Python
          source: |
            import requests

            response = requests.get(
                "https://artificialanalysis.ai/api/v2/media/music/with-vocals/models/free",
                headers={"x-api-key": "YOUR_API_KEY"}
            )
            data = response.json()
        - lang: JavaScript
          label: JavaScript
          source: |
            const response = await fetch(
              "https://artificialanalysis.ai/api/v2/media/music/with-vocals/models/free",
              { headers: { "x-api-key": "YOUR_API_KEY" } }
            );
            const data = await response.json();
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MusicArenaFreeResponse'
              examples:
                free:
                  summary: Free-shape response with `tier` field
                  value:
                    tier: free
                    data:
                      - id: '1d06bf78-0a16-4fdf-8029-663a694e3470'
                        name: 'Suno V4.5'
                        model_creator: { id: '30bf1911-2cd9-4bce-a179-009b174196fc', name: 'Suno' }
                        elo: 1080
                        ci_95: 12
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

  /api/v2/media/music/with-vocals/models:
    get:
      operationId: getMusicWithVocalsArena
      summary: Get with-vocals music arena rankings
      description: |
        Returns arena Elo rankings for music generation models with vocals. Free tier returns model identity plus Elo and CI only; Pro adds samples and optional genre breakdowns.

        **Pro+ only.** Free integrations should use [`/api/v2/media/music/with-vocals/models/free`](#getMusicWithVocalsArenaFree) instead.
      tags: [Media - Music]
      parameters:
        - name: include_genres
          in: query
          description: Include per-genre Elo breakdowns (Pro tier only).
          schema:
            type: boolean
            default: false
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl "https://artificialanalysis.ai/api/v2/media/music/with-vocals/models?include_genres=true" \
              -H "x-api-key: YOUR_API_KEY"
      responses:
        '200':
          description: Successful response
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
            X-AA-Tier:
              $ref: '#/components/headers/Tier'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MusicArenaResponse'
              examples:
                pro_tier:
                  summary: Pro response with genre breakdowns
                  value:
                    tier: pro
                    data:
                      - id: '1d06bf78-0a16-4fdf-8029-663a694e3470'
                        name: 'Suno V4.5'
                        model_creator: { id: '30bf1911-2cd9-4bce-a179-009b174196fc', name: 'Suno' }
                        elo: 1080
                        ci_95: 12
                        samples: 3428
                        genres:
                          - label: 'Alternative / Indie'
                            elo: 1064
                            ci_95: 46
                            samples: 244
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'

components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Obtain from your Artificial Analysis account.

  parameters:
    prompt_type:
      name: prompt_type
      in: query
      description: |
        The prompt type preset used for performance benchmarking.
        Controls how many input tokens and parallel queries are used in latency/throughput measurements.

        | prompt_type | input_tokens | parallel_queries |
        | --- | --- | --- |
        | `medium` | 1,000 | 1 |
        | `long` (default) | 10,000 | 1 |
        | `100k` | 100,000 | 1 |
        | `vision_single_image` | 1,000 | 1 |
        | `medium_coding` | 1,000 | 1 |
        | `medium_parallel` | 1,000 | 10 |
      schema:
        type: string
        enum: [medium, long, 100k, vision_single_image, medium_coding, medium_parallel]
        default: long

    window:
      name: window
      in: query
      description: Lookback period from today.
      schema:
        type: string
        enum: [7d, 30d, 90d]
        default: 90d

    interval:
      name: interval
      in: query
      description: |
        Aggregation granularity. Auto-derived from window if omitted
        (7d/30d → daily, 90d → weekly).
      schema:
        type: string
        enum: [daily, weekly, monthly]

    page:
      name: page
      in: query
      description: |
        Page number for paginated results (1-indexed). Defaults to 1.
      schema:
        type: integer
        minimum: 1
        default: 1

  headers:
    RateLimitLimit:
      schema:
        type: integer
      description: Maximum requests allowed in the current window.
    RateLimitRemaining:
      schema:
        type: integer
      description: Requests remaining in the current window.
    RateLimitReset:
      schema:
        type: integer
      description: Unix timestamp at which the current rate limit window resets.
    Tier:
      schema:
        type: string
        enum: [free, pro, commercial]
      description: |
        Subscription tier that served the request. Present on every authenticated response
        (success and error), and mirrors the `tier` field in successful response bodies.
    RetryAfter:
      schema:
        type: integer
      description: Seconds to wait before retrying. Present on `429` responses.

  responses:
    BadRequest:
      description: Invalid query parameters
      headers:
        X-AA-Tier:
          $ref: '#/components/headers/Tier'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Invalid prompt_type. Valid options: medium, long, 100k, vision_single_image, medium_coding, medium_parallel'

    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'API key is required'

    NotFound:
      description: Resource not found
      headers:
        X-AA-Tier:
          $ref: '#/components/headers/Tier'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Model not found: nonexistent-slug'

    Forbidden:
      description: Free tier requesting a pro-only feature
      headers:
        X-AA-Tier:
          $ref: '#/components/headers/Tier'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Language models list requires a Pro subscription'

    RateLimited:
      description: Rate limited
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-AA-Tier:
          $ref: '#/components/headers/Tier'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Rate limit exceeded'

    InternalError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Internal Server Error'

  schemas:
    # ─── Common ──────────────────────────────────────────────────────

    ErrorResponse:
      type: object
      required: [error]
      properties:
        error:
          type: string
        details:
          type: object
          description: Additional error details (e.g. validation errors). Only present on some error responses.

    PaginationMeta:
      type: object
      required: [page, page_size, total_pages, has_more]
      properties:
        page:
          type: integer
          description: Current page number (1-indexed).
          example: 1
        page_size:
          type: integer
          description: Number of items per page.
          example: 50
        total_pages:
          type: integer
          description: Total number of pages.
          example: 3
        has_more:
          type: boolean
          description: Whether there are more pages after the current one.
          example: true

    ArenaModelCreator:
      type: object
      required: [id, name]
      properties:
        id:
          type: string
        name:
          type: string

    # ─── Language Models ────────────────────────────────────────────

    LLMModelsResponse:
      type: object
      required: [tier, intelligence_index_version, pagination, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        intelligence_index_version:
          $ref: '#/components/schemas/IntelligenceIndexVersion'
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
        data:
          type: array
          items:
            $ref: '#/components/schemas/ModelDataExternal'

    LLMModelsFreeResponse:
      type: object
      required: [tier, intelligence_index_version, pagination, data]
      properties:
        tier:
          type: string
          enum: [free, pro, commercial]
        intelligence_index_version:
          $ref: '#/components/schemas/IntelligenceIndexVersion'
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
        data:
          type: array
          items:
            $ref: '#/components/schemas/FreeModelData'

    LLMModelItemResponse:
      type: object
      required: [tier, intelligence_index_version, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        intelligence_index_version:
          $ref: '#/components/schemas/IntelligenceIndexVersion'
        data:
          $ref: '#/components/schemas/ModelDataExternal'

    IntelligenceIndexVersion:
      type: number
      description: |
        Version of the Artificial Analysis Intelligence Index the `artificial_analysis_intelligence_index`
        scores in this response belong to, as a number with the `v` dropped (e.g. `4` for v4.0). See the
        Intelligence Index versioning section for what major vs. minor changes mean.
      example: 4

    FreeModelData:
      type: object
      description: |
        Free-tier shape returned by `/api/v2/language/models/free`. Includes headline indices,
        median performance, and input/output pricing. Pro and Commercial keys also receive this
        shape when calling the `/free` endpoint.
      required:
        - id
        - name
        - slug
        - release_date
        - model_creator
        - evaluations
        - artificial_analysis_intelligence_index_cost
        - pricing
        - performance
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        release_date:
          type: [string, 'null']
          description: ISO date string (e.g. "2024-05-13").
        model_creator:
          oneOf:
            - $ref: '#/components/schemas/FreeModelCreator'
            - type: 'null'
        evaluations:
          $ref: '#/components/schemas/FreeEvaluations'
        artificial_analysis_intelligence_index_cost:
          description: Pre-calculated cost to run the Intelligence Index evaluation. Free tier exposes `total_cost` only.
          oneOf:
            - $ref: '#/components/schemas/FreeIntelligenceIndexCost'
            - type: 'null'
        pricing:
          description: Input and output token pricing. Pro tier adds blended pricing fields.
          $ref: '#/components/schemas/FreePricing'
        performance:
          description: Median performance metrics across all providers serving this model. Pro tier adds percentiles and quartiles.
          $ref: '#/components/schemas/FreeModelPerformance'

    FreeModelCreator:
      type: object
      required: [id, name]
      properties:
        id:
          type: string
        name:
          type: string

    FreeEvaluations:
      type: object
      description: Composite Artificial Analysis indices. Pro tier adds per-benchmark scores.
      required:
        - artificial_analysis_intelligence_index
        - artificial_analysis_coding_index
        - artificial_analysis_agentic_index
      properties:
        artificial_analysis_intelligence_index:
          type: [number, 'null']
          description: AA Intelligence Index composite score.
        artificial_analysis_coding_index:
          type: [number, 'null']
          description: AA Coding Index composite score.
        artificial_analysis_agentic_index:
          type: [number, 'null']
          description: AA Agentic Index composite score.

    FreeIntelligenceIndexCost:
      type: object
      required: [total_cost]
      properties:
        total_cost:
          type: number
          description: Total cost to run the Intelligence Index evaluation.

    FreePricing:
      type: object
      required:
        - price_1m_input_tokens
        - price_1m_output_tokens
        - price_1m_cache_hit_tokens
        - price_1m_cache_write_tokens
      properties:
        price_1m_input_tokens:
          type: [number, 'null']
          description: Price per 1M input tokens. Null when pricing data is not available.
          example: 0.06
        price_1m_output_tokens:
          type: [number, 'null']
          description: Price per 1M output tokens. Null when pricing data is not available.
          example: 0.2
        price_1m_cache_hit_tokens:
          type: [number, 'null']
          description: Price per 1M cached input (cache hit / read) tokens. Null when the provider does not report cache pricing.
          example: 0.015
        price_1m_cache_write_tokens:
          type: [number, 'null']
          description: Price per 1M cache write tokens. Null when the provider does not report cache pricing.
          example: 0.075

    FreeModelPerformance:
      type: object
      description: Median performance metrics across all providers serving this model. Individual fields are null when no measurements are available for that metric.
      required:
        - median_output_tokens_per_second
        - median_time_to_first_token_seconds
        - median_time_to_first_answer_token_seconds
        - median_end_to_end_response_time_seconds
      properties:
        median_output_tokens_per_second:
          type: [number, 'null']
        median_time_to_first_token_seconds:
          type: [number, 'null']
        median_time_to_first_answer_token_seconds:
          type: [number, 'null']
        median_end_to_end_response_time_seconds:
          type: [number, 'null']

    ModelDataExternal:
      type: object
      required:
        - id
        - name
        - slug
        - release_date
        - model_creator
        - evaluations
        - artificial_analysis_intelligence_index_cost
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        release_date:
          type: [string, 'null']
          description: ISO date string (e.g. "2024-05-13").

        model_creator:
          oneOf:
            - $ref: '#/components/schemas/ModelCreator'
            - type: 'null'

        reasoning_model:
          type: boolean
          description: 'Pro tier only. Omitted on Free tier.'
          x-tier: pro

        evaluations:
          $ref: '#/components/schemas/Evaluations'

        artificial_analysis_intelligence_index_cost:
          description: 'Pre-calculated cost to run the Intelligence Index evaluation. Free tier includes total_cost only; Pro tier adds input_cost, reasoning_cost, answer_cost.'
          oneOf:
            - $ref: '#/components/schemas/IntelligenceIndexCost'
            - type: 'null'

        artificial_analysis_intelligence_index_token_counts:
          description: 'Pro tier only. Omitted on Free tier.'
          x-tier: pro
          oneOf:
            - $ref: '#/components/schemas/IntelligenceIndexTokenCounts'
            - type: 'null'

        pricing:
          description: Full pricing object including blended fields. Free tier returns input and output token prices only. See `FreePricing`.
          $ref: '#/components/schemas/Pricing'

        performance:
          description: Full performance object including quartiles and percentiles. Free tier returns medians only. See `FreeModelPerformance`.
          $ref: '#/components/schemas/ModelPerformance'

        context_window_tokens:
          type: [integer, 'null']
          description: 'Pro tier only. Omitted on Free tier. Null when not set for the model.'
          x-tier: pro

        parameters:
          description: 'Pro tier only. Omitted on Free tier.'
          x-tier: pro
          oneOf:
            - $ref: '#/components/schemas/Parameters'
            - type: 'null'

        modalities:
          description: 'Pro tier only. Omitted on Free tier.'
          x-tier: pro
          $ref: '#/components/schemas/Modalities'

        licensing:
          description: 'Pro tier only. Omitted on Free tier.'
          x-tier: pro
          $ref: '#/components/schemas/Licensing'

        huggingface_url:
          type: [string, 'null']
          description: 'Pro tier only. Omitted on Free tier. Canonical Hugging Face or model weights URL when available.'
          x-tier: pro

        openrouter_api_id:
          type: [string, 'null']
          description: 'Pro tier only. Omitted on Free tier. OpenRouter API model identifier when available.'
          x-tier: pro

        evaluation_token_counts:
          description: 'Pro tier only. Detail endpoint only (`/api/v2/language/models/{slug}`). Omitted on Free tier and list endpoint.'
          x-tier: pro
          oneOf:
            - $ref: '#/components/schemas/EvaluationTokenCounts'
            - type: 'null'

        aa_omniscience_breakdown:
          description: 'Pro tier only. Detail endpoint only (`/api/v2/language/models/{slug}`). Omitted on Free tier and list endpoint.'
          x-tier: pro
          oneOf:
            - $ref: '#/components/schemas/OmniscienceBreakdown'
            - type: 'null'

        artificial_analysis_openness_index_breakdown:
          description: 'Pro tier only. Detail endpoint only (`/api/v2/language/models/{slug}`). Omitted on Free tier and list endpoint.'
          x-tier: pro
          $ref: '#/components/schemas/OpennessBreakdown'

        providers:
          type: array
          description: 'Pro tier only. Detail endpoint only (`/api/v2/language/models/{slug}`). Omitted on Free tier and list endpoint.'
          x-tier: pro
          items:
            $ref: '#/components/schemas/ModelProviderDataExternal'

    ModelCreator:
      type: object
      required: [id, name]
      properties:
        id:
          type: string
        name:
          type: string
        country:
          type: [string, 'null']
          description: 'Pro tier only. Omitted on Free tier. ISO 3166-1 alpha-2 country code of the model creator.'
          example: 'us'
          x-tier: pro

    Evaluations:
      type: object
      required:
        - artificial_analysis_intelligence_index
        - artificial_analysis_coding_index
        - artificial_analysis_agentic_index
      properties:
        # Composite indices (available on all tiers)
        artificial_analysis_intelligence_index:
          type: [number, 'null']
          description: AA Intelligence Index composite score.
        artificial_analysis_coding_index:
          type: [number, 'null']
          description: AA Coding Index composite score.
        artificial_analysis_agentic_index:
          type: [number, 'null']
          description: AA Agentic Index composite score.

        # Individual evaluations (pro tier only)
        tau2_telecom:
          type: [number, 'null']
          description: 'τ²-Bench Telecom score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        terminalbench_hard:
          type: [number, 'null']
          description: 'Terminal-Bench Hard score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        scicode:
          type: [number, 'null']
          description: 'SciCode score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        aa_lcr:
          type: [number, 'null']
          description: 'AA-LCR score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        aa_omniscience_index:
          type: [number, 'null']
          description: 'AA-Omniscience Index score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        aa_omniscience_accuracy:
          type: [number, 'null']
          description: 'Aggregate Omniscience accuracy. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        aa_omniscience_non_hallucination_rate:
          type: [number, 'null']
          description: 'Aggregate Omniscience non-hallucination score (1 - hallucination_rate). Pro tier only. Omitted on Free tier.'
          x-tier: pro
        ifbench:
          type: [number, 'null']
          description: 'IFBench score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        hle:
          type: [number, 'null']
          description: "Humanity's Last Exam score. Pro tier only. Omitted on Free tier."
          x-tier: pro
        gpqa_diamond:
          type: [number, 'null']
          description: 'GPQA Diamond score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        critpt:
          type: [number, 'null']
          description: 'CritPt score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        gdpval_aa_elo:
          type: [number, 'null']
          description: 'GDPval raw Elo score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        gdpval_aa_normalized:
          type: [number, 'null']
          description: 'GDPval score normalized to a 0-1 scale, used in the Intelligence Index. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        mmmu_pro:
          type: [number, 'null']
          description: 'MMMU-Pro visual reasoning score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        artificial_analysis_openness_index:
          type: [number, 'null']
          description: 'Openness Index score. Pro tier only. Omitted on Free tier.'
          x-tier: pro
        artificial_analysis_multilingual_index:
          type: [number, 'null']
          description: 'Multilingual Index score. Pro tier only. Omitted on Free tier.'
          x-tier: pro

    Pricing:
      type: object
      required:
        - price_1m_blended_3_to_1
        - price_1m_blended_7_to_2_to_1
        - price_1m_input_tokens
        - price_1m_output_tokens
        - price_1m_cache_hit_tokens
        - price_1m_cache_write_tokens
      properties:
        price_1m_blended_3_to_1:
          type: [number, 'null']
          description: Blended price per 1M tokens (3:1 Input-Output ratio). Null when pricing data is not available.
          example: 0.09
        price_1m_blended_7_to_2_to_1:
          type: [number, 'null']
          description: Blended price per 1M tokens (7:2:1 Cache-Input-Output ratio). Null when pricing data is not available.
          example: 0.04
        price_1m_input_tokens:
          type: [number, 'null']
          description: Price per 1M input tokens. Null when pricing data is not available.
          example: 0.06
        price_1m_output_tokens:
          type: [number, 'null']
          description: Price per 1M output tokens. Null when pricing data is not available.
          example: 0.2
        price_1m_cache_hit_tokens:
          type: [number, 'null']
          description: Price per 1M cached input (cache hit / read) tokens. Null when the provider does not report cache pricing.
          example: 0.015
        price_1m_cache_write_tokens:
          type: [number, 'null']
          description: Price per 1M cache write tokens. Null when the provider does not report cache pricing.
          example: 0.075

    ModelPerformance:
      type: object
      description: Aggregated performance metrics across all providers serving this model. Individual fields are null when no measurements are available for that metric.
      required:
        - percentile_05_output_tokens_per_second
        - quartile_25_output_tokens_per_second
        - median_output_tokens_per_second
        - quartile_75_output_tokens_per_second
        - percentile_95_output_tokens_per_second
        - percentile_05_time_to_first_token_seconds
        - quartile_25_time_to_first_token_seconds
        - median_time_to_first_token_seconds
        - quartile_75_time_to_first_token_seconds
        - percentile_95_time_to_first_token_seconds
        - median_time_to_first_answer_token_seconds
        - median_end_to_end_response_time_seconds
      properties:
        percentile_05_output_tokens_per_second:
          type: [number, 'null']
        quartile_25_output_tokens_per_second:
          type: [number, 'null']
        median_output_tokens_per_second:
          type: [number, 'null']
        quartile_75_output_tokens_per_second:
          type: [number, 'null']
        percentile_95_output_tokens_per_second:
          type: [number, 'null']
        percentile_05_time_to_first_token_seconds:
          type: [number, 'null']
        quartile_25_time_to_first_token_seconds:
          type: [number, 'null']
        median_time_to_first_token_seconds:
          type: [number, 'null']
        quartile_75_time_to_first_token_seconds:
          type: [number, 'null']
        percentile_95_time_to_first_token_seconds:
          type: [number, 'null']
        median_time_to_first_answer_token_seconds:
          type: [number, 'null']
        median_end_to_end_response_time_seconds:
          type: [number, 'null']

    Parameters:
      type: object
      required: [total, active]
      properties:
        total:
          type: number
          description: Total model parameters (in billions).
        active:
          type: [number, 'null']
          description: Active parameters per forward pass (relevant for MoE models).

    Modalities:
      type: object
      required: [input, output]
      properties:
        input:
          $ref: '#/components/schemas/ModalitySet'
        output:
          $ref: '#/components/schemas/ModalitySet'

    ModalitySet:
      type: object
      required: [text, image, video, speech]
      properties:
        text:
          type: [boolean, 'null']
        image:
          type: [boolean, 'null']
        video:
          type: [boolean, 'null']
        speech:
          type: [boolean, 'null']

    Licensing:
      type: object
      required: [is_open_weights]
      properties:
        is_open_weights:
          type: boolean

    EvalTokenCounts:
      type: object
      required: [input_tokens, answer_tokens, output_tokens, reasoning_tokens]
      properties:
        input_tokens:
          type: number
        answer_tokens:
          type: number
        output_tokens:
          type: number
        reasoning_tokens:
          type: number

    EvaluationTokenCounts:
      type: object
      description: Per-evaluation token counts for each benchmark in the Intelligence Index.
      properties:
        hle:
          $ref: '#/components/schemas/EvalTokenCounts'
        aa_lcr:
          $ref: '#/components/schemas/EvalTokenCounts'
        gpqa_diamond:
          $ref: '#/components/schemas/EvalTokenCounts'
        tau2_telecom:
          $ref: '#/components/schemas/EvalTokenCounts'
        critpt:
          $ref: '#/components/schemas/EvalTokenCounts'
        gdpval_aa:
          $ref: '#/components/schemas/EvalTokenCounts'
        ifbench:
          $ref: '#/components/schemas/EvalTokenCounts'
        scicode:
          $ref: '#/components/schemas/EvalTokenCounts'
        mmmu_pro:
          $ref: '#/components/schemas/EvalTokenCounts'
        aa_omniscience:
          $ref: '#/components/schemas/EvalTokenCounts'
        terminalbench_hard:
          $ref: '#/components/schemas/EvalTokenCounts'

    IntelligenceIndexCost:
      type: object
      required: [total_cost]
      properties:
        total_cost:
          type: number
          description: Total cost to run the Intelligence Index evaluation. Available on all tiers.
        input_cost:
          type: [number, 'null']
          description: 'Pro tier only. Omitted on Free tier. Null when not measured.'
          x-tier: pro
        reasoning_cost:
          type: [number, 'null']
          description: 'Pro tier only. Omitted on Free tier. Null when not measured.'
          x-tier: pro
        answer_cost:
          type: [number, 'null']
          description: 'Pro tier only. Omitted on Free tier. Null when not measured.'
          x-tier: pro

    IntelligenceIndexTokenCounts:
      type: object
      required: [input_tokens, answer_tokens, output_tokens, reasoning_tokens]
      properties:
        input_tokens:
          type: integer
        answer_tokens:
          type: integer
        output_tokens:
          type: integer
        reasoning_tokens:
          type: integer

    OmniscienceDomainBreakdown:
      type: object
      required: [accuracy, omniscience, hallucination_rate]
      properties:
        accuracy:
          type: number
        omniscience:
          type: number
        hallucination_rate:
          type: number

    OmniscienceBreakdown:
      type: object
      required: [total]
      properties:
        total:
          $ref: '#/components/schemas/OmniscienceDomainBreakdown'
        law:
          oneOf:
            - $ref: '#/components/schemas/OmniscienceDomainBreakdown'
            - type: 'null'
        health:
          oneOf:
            - $ref: '#/components/schemas/OmniscienceDomainBreakdown'
            - type: 'null'
        business:
          oneOf:
            - $ref: '#/components/schemas/OmniscienceDomainBreakdown'
            - type: 'null'
        humanities_and_social_sciences:
          oneOf:
            - $ref: '#/components/schemas/OmniscienceDomainBreakdown'
            - type: 'null'
        science_engineering_and_mathematics:
          oneOf:
            - $ref: '#/components/schemas/OmniscienceDomainBreakdown'
            - type: 'null'
        software_engineering:
          oneOf:
            - $ref: '#/components/schemas/OmniscienceDomainBreakdown'
            - type: 'null'

    OpennessBreakdown:
      type: object
      properties:
        weights_access:
          type: [number, 'null']
        weights_license:
          type: [number, 'null']
        data_pretrain_access:
          type: [number, 'null']
        data_pretrain_license:
          type: [number, 'null']
        data_posttrain_access:
          type: [number, 'null']
        data_posttrain_license:
          type: [number, 'null']
        methodology_license:
          type: [number, 'null']
        methodology_disclosure:
          type: [number, 'null']
        artificial_analysis_openness_index:
          type: [number, 'null']

    ModelProviderDataExternal:
      type: object
      required: [id, name, slug, pricing, performance, context_window_tokens]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        pricing:
          $ref: '#/components/schemas/Pricing'
        performance:
          $ref: '#/components/schemas/ProviderModelPerformance'
        context_window_tokens:
          type: [integer, 'null']
          description: Null when not set for the (provider, model) pair.

    ProviderModelPerformance:
      type: object
      description: Performance metrics for a single (provider, model) pair. Individual fields are null when no measurements are available for that metric.
      required:
        - percentile_05_output_tokens_per_second
        - quartile_25_output_tokens_per_second
        - median_output_tokens_per_second
        - quartile_75_output_tokens_per_second
        - percentile_95_output_tokens_per_second
        - percentile_05_time_to_first_token_seconds
        - quartile_25_time_to_first_token_seconds
        - median_time_to_first_token_seconds
        - quartile_75_time_to_first_token_seconds
        - percentile_95_time_to_first_token_seconds
        - median_time_to_first_answer_token_seconds
        - median_end_to_end_response_time_seconds
      properties:
        percentile_05_output_tokens_per_second:
          type: [number, 'null']
        quartile_25_output_tokens_per_second:
          type: [number, 'null']
        median_output_tokens_per_second:
          type: [number, 'null']
        quartile_75_output_tokens_per_second:
          type: [number, 'null']
        percentile_95_output_tokens_per_second:
          type: [number, 'null']
        percentile_05_time_to_first_token_seconds:
          type: [number, 'null']
        quartile_25_time_to_first_token_seconds:
          type: [number, 'null']
        median_time_to_first_token_seconds:
          type: [number, 'null']
        quartile_75_time_to_first_token_seconds:
          type: [number, 'null']
        percentile_95_time_to_first_token_seconds:
          type: [number, 'null']
        median_time_to_first_answer_token_seconds:
          type: [number, 'null']
        median_end_to_end_response_time_seconds:
          type: [number, 'null']

    # ─── Language Model Providers ───────────────────────────────────

    LLMProvidersResponse:
      type: object
      required: [tier, pagination, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
        data:
          type: array
          items:
            $ref: '#/components/schemas/ProviderDataExternal'

    LLMProviderItemResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          $ref: '#/components/schemas/ProviderDataExternal'

    ProviderDataExternal:
      type: object
      required: [id, name, slug, models]
      properties:
        id:
          type: string
          example: '6047c38a-af71-4b47-9d66-d361753f71b4'
        name:
          type: string
          example: 'Novita'
        slug:
          type: string
          example: 'novita'
        country:
          type: [string, 'null']
          description: ISO 3166-1 alpha-2 country code of the provider. Null when unknown.
          example: 'us'
        models:
          type: array
          items:
            $ref: '#/components/schemas/ProviderModelExternal'

    ProviderModelExternal:
      type: object
      required: [id, name, slug, pricing, context_window_tokens]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        pricing:
          $ref: '#/components/schemas/Pricing'
        performance:
          description: 'Median metrics on the list endpoint; full percentiles/quartiles on the detail endpoint (`/providers/{slug}`).'
          oneOf:
            - $ref: '#/components/schemas/ProviderModelPerformanceList'
            - $ref: '#/components/schemas/ProviderModelPerformanceDetail'
            - type: 'null'
        context_window_tokens:
          type: [integer, 'null']
          description: Null when not set for the (provider, model) pair.

    ProviderModelPerformanceList:
      type: object
      description: Median performance metrics returned on the providers list endpoint. Individual fields are null when no measurements are available for that metric.
      required:
        - median_output_tokens_per_second
        - median_time_to_first_token_seconds
        - median_time_to_first_answer_token_seconds
        - median_end_to_end_response_time_seconds
      properties:
        median_output_tokens_per_second:
          type: [number, 'null']
        median_time_to_first_token_seconds:
          type: [number, 'null']
        median_time_to_first_answer_token_seconds:
          type: [number, 'null']
        median_end_to_end_response_time_seconds:
          type: [number, 'null']

    ProviderModelPerformanceDetail:
      type: object
      description: Full performance metrics returned on the provider detail endpoint. Includes everything from the list endpoint plus percentile/quartile breakdowns. Individual fields are null when no measurements are available for that metric.
      required:
        - median_output_tokens_per_second
        - median_time_to_first_token_seconds
        - percentile_05_output_tokens_per_second
        - percentile_95_output_tokens_per_second
        - quartile_25_output_tokens_per_second
        - quartile_75_output_tokens_per_second
        - percentile_05_time_to_first_token_seconds
        - percentile_95_time_to_first_token_seconds
        - quartile_25_time_to_first_token_seconds
        - quartile_75_time_to_first_token_seconds
        - median_time_to_first_answer_token_seconds
        - median_end_to_end_response_time_seconds
      properties:
        median_output_tokens_per_second:
          type: [number, 'null']
        median_time_to_first_token_seconds:
          type: [number, 'null']
        percentile_05_output_tokens_per_second:
          type: [number, 'null']
        percentile_95_output_tokens_per_second:
          type: [number, 'null']
        quartile_25_output_tokens_per_second:
          type: [number, 'null']
        quartile_75_output_tokens_per_second:
          type: [number, 'null']
        percentile_05_time_to_first_token_seconds:
          type: [number, 'null']
        percentile_95_time_to_first_token_seconds:
          type: [number, 'null']
        quartile_25_time_to_first_token_seconds:
          type: [number, 'null']
        quartile_75_time_to_first_token_seconds:
          type: [number, 'null']
        median_time_to_first_answer_token_seconds:
          type: [number, 'null']
        median_end_to_end_response_time_seconds:
          type: [number, 'null']

    # ─── Performance Over Time ────────────────────────────────────────

    PerformanceSnapshot:
      type: object
      description: A single performance data point for a given date or interval period.
      required:
        - date
        - median_output_tokens_per_second
        - median_time_to_first_token_seconds
        - median_time_to_first_answer_token_seconds
        - median_end_to_end_response_time_seconds
      properties:
        date:
          type: string
          description: Start date of this data point's period (YYYY-MM-DD).
          example: '2025-01-06'
        median_output_tokens_per_second:
          type: [number, 'null']
          example: 87.2
        median_time_to_first_token_seconds:
          type: [number, 'null']
          example: 0.45
        median_time_to_first_answer_token_seconds:
          type: [number, 'null']
          example: 0.82
        median_end_to_end_response_time_seconds:
          type: [number, 'null']
          example: 1.6

    ModelPerformanceOverTimeResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          type: object
          required: [id, slug, name, providers]
          properties:
            id:
              type: string
            slug:
              type: string
            name:
              type: string
            providers:
              type: array
              items:
                type: object
                required: [id, slug, name, series]
                properties:
                  id:
                    type: string
                  slug:
                    type: string
                  name:
                    type: string
                  series:
                    type: array
                    items:
                      $ref: '#/components/schemas/PerformanceSnapshot'

    ProviderPerformanceOverTimeResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          type: object
          required: [id, name, slug, models]
          properties:
            id:
              type: string
            name:
              type: string
            slug:
              type: string
            models:
              type: array
              items:
                type: object
                required: [id, slug, name, series]
                properties:
                  id:
                    type: string
                  slug:
                    type: string
                  name:
                    type: string
                  series:
                    type: array
                    items:
                      $ref: '#/components/schemas/PerformanceSnapshot'

    # ─── LLM Measurements (Commercial) ─────────────────────────────────

    MeasurementsResponse:
      type: object
      required: [data]
      properties:
        data:
          type: object
          required: [id, name, slug, models]
          properties:
            id:
              type: string
            name:
              type: string
            slug:
              type: string
            models:
              type: array
              items:
                $ref: '#/components/schemas/MeasurementModel'

    MeasurementModel:
      type: object
      required: [id, name, slug, measurements]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        measurements:
          type: array
          items:
            $ref: '#/components/schemas/Measurement'

    Measurement:
      type: object
      required:
        - id
        - date
        - success
        - output_tokens_per_second
        - time_to_first_token_seconds
        - time_to_first_answer_token
        - end_to_end_response_time_seconds
      properties:
        id:
          type: string
        date:
          type: string
          description: Timestamp when the measurement was recorded.
          example: '2025-06-15T14:30:00.000Z'
        success:
          type: boolean
        output_tokens_per_second:
          type: [number, 'null']
          example: 92.5
        time_to_first_token_seconds:
          type: [number, 'null']
          example: 0.38
        time_to_first_answer_token:
          type: [number, 'null']
          example: 0.52
        end_to_end_response_time_seconds:
          type: [number, 'null']
          example: 1.46

    # ─── Media - Image Arena ─────────────────────────────────────────

    ImageArenaResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/ImageArenaResult'

    ImageArenaFreeResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [free, pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/ImageArenaResult'

    ImageArenaResult:
      type: object
      required: [id, name, slug, model_creator, elo, ci_95]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        model_creator:
          $ref: '#/components/schemas/ArenaModelCreator'
        elo:
          type: number
          description: Arena Elo rating.
        ci_95:
          type: [number, 'null']
          description: 95% confidence interval. Null if unavailable.
        rank:
          type: [integer, 'null']
          description: 'Pro tier only. Rank among current models by Elo.'
          x-tier: pro
        samples:
          type: integer
          description: 'Pro tier only. Total number of arena samples.'
          x-tier: pro
        release_date:
          type: [string, 'null']
          description: 'Pro tier only. Release date.'
          x-tier: pro
        price_per_1k_images:
          type: [number, 'null']
          description: 'Pro tier only. Price per 1,000 images.'
          x-tier: pro
        open_weights_url:
          type: [string, 'null']
          description: 'Pro tier only. URL to open weights; can be used to infer if open weights.'
          x-tier: pro
        categories:
          type: array
          description: 'Pro tier only. Per-category Elo breakdowns. Only present when include_categories=true.'
          x-tier: pro
          items:
            $ref: '#/components/schemas/ArenaCategory'

    # ─── Media - Video Arena ─────────────────────────────────────────

    VideoArenaResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/VideoArenaResultPaid'

    VideoArenaFreeResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [free, pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/VideoArenaResultFree'

    VideoArenaResultFree:
      type: object
      required: [id, name, slug, model_creator, elo, ci_95]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        model_creator:
          $ref: '#/components/schemas/ArenaModelCreator'
        elo:
          type: number
          description: Arena Elo rating.
        ci_95:
          type: [number, 'null']
          description: 95% confidence interval. Null if unavailable.

    VideoArenaResultPaid:
      allOf:
        - $ref: '#/components/schemas/VideoArenaResultFree'
        - type: object
          required: [rank, samples, release_date, price_per_minute, open_weights_url]
          properties:
            rank:
              type: [integer, 'null']
              description: Rank among current models by Elo.
            samples:
              type: integer
              description: Total number of arena samples.
            release_date:
              type: [string, 'null']
              description: Release date.
            price_per_minute:
              type: [number, 'null']
              description: Price per minute of video.
            open_weights_url:
              type: [string, 'null']
              description: URL to open weights; can be used to infer if open weights.
            categories:
              type: array
              description: Per-category Elo breakdowns. Only present when include_categories=true.
              items:
                $ref: '#/components/schemas/ArenaCategory'

    ArenaCategory:
      type: object
      required: [label, elo, ci_95, samples]
      properties:
        label:
          type: string
          description: Category label.
        elo:
          type: number
        ci_95:
          type: [number, 'null']
        samples:
          type: integer

    # ─── Media - Speech ──────────────────────────────────────────────

    TextToSpeechResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/TextToSpeechResult'

    TextToSpeechFreeResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [free, pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/TextToSpeechResult'

    TextToSpeechResult:
      type: object
      required: [id, name, slug, model_creator, elo, ci_95]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        model_creator:
          $ref: '#/components/schemas/ArenaModelCreator'
        elo:
          type: number
          description: Arena Elo rating.
        ci_95:
          type: [number, 'null']
          description: 95% confidence interval. Null if unavailable.
        samples:
          type: integer
          description: 'Pro tier only. Total number of arena samples.'
          x-tier: pro
        release_date:
          type: [string, 'null']
          description: 'Pro tier only. Release date.'
          x-tier: pro
        price_per_1m_characters:
          type: [number, 'null']
          description: 'Pro tier only. Price per 1 million characters.'
          x-tier: pro

    SpeechToSpeechResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/SpeechToSpeechResult'

    SpeechToSpeechFreeResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [free, pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/SpeechToSpeechResult'

    SpeechToSpeechResult:
      type: object
      required: [id, name, slug, model_creator, bba_score, fdb_score, tau_voice_score]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        model_creator:
          $ref: '#/components/schemas/ArenaModelCreator'
        bba_score:
          type: [number, 'null']
          description: Big Bench Audio score.
          example: 0.54
        fdb_score:
          type: [number, 'null']
          description: Full Duplex Bench score.
          example: 0.41
        tau_voice_score:
          type: [number, 'null']
          description: "\U0001D70F-Voice score (the model's best result across providers). Null when the model has no \U0001D70F-Voice measurements."
          example: 0.37
        providers:
          type: array
          description: 'Pro tier only. Omitted on Free tier.'
          x-tier: pro
          items:
            $ref: '#/components/schemas/SpeechToSpeechProvider'

    SpeechToSpeechProvider:
      type: object
      required: [id, name, slug, price_per_hour_input, price_per_hour_output, time_to_first_audio_seconds]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        price_per_hour_input:
          type: [number, 'null']
          description: Price per hour of input audio.
        price_per_hour_output:
          type: [number, 'null']
          description: Price per hour of output audio.
        time_to_first_audio_seconds:
          type: [number, 'null']
          description: Time to first audio output in seconds.

    SpeechToTextModelsResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/SpeechToTextModelResult'

    SpeechToTextModelsFreeResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [free, pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/SpeechToTextModelResult'

    SpeechToTextModelResult:
      type: object
      required: [id, name, model_creator, aa_wer_index]
      properties:
        id:
          type: string
        name:
          type: string
        model_creator:
          $ref: '#/components/schemas/ArenaModelCreator'
        aa_wer_index:
          type: [number, 'null']
          description: AA Word Error Rate index.
        aa_agenttalk:
          type: [number, 'null']
          description: 'Pro tier only. AA AgentTalk WER.'
          x-tier: pro
        voxpopuli_cleaned_aa:
          type: [number, 'null']
          description: 'Pro tier only. VoxPopuli cleaned WER.'
          x-tier: pro
        earnings_22_cleaned_aa:
          type: [number, 'null']
          description: 'Pro tier only. Earnings22 cleaned WER.'
          x-tier: pro
        open_weights:
          type: boolean
          description: 'Pro tier only. Whether the model has open weights.'
          x-tier: pro
        providers:
          type: array
          description: 'Pro tier only. Per-provider data.'
          x-tier: pro
          items:
            $ref: '#/components/schemas/SpeechToTextProvider'

    SpeechToTextProvider:
      type: object
      required: [id, name, slug]
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        price_per_1k_minutes:
          type: [number, 'null']
        median_speed_factor:
          type: [number, 'null']
        aa_wer_index:
          type: [number, 'null']
        aa_agenttalk:
          type: [number, 'null']
        voxpopuli_cleaned_aa:
          type: [number, 'null']
        earnings_22_cleaned_aa:
          type: [number, 'null']

    # ─── Media - Music ──────────────────────────────────────────────

    MusicArenaResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/MusicArenaResult'

    MusicArenaFreeResponse:
      type: object
      required: [tier, data]
      properties:
        tier:
          type: string
          enum: [free, pro, commercial]
        data:
          type: array
          items:
            $ref: '#/components/schemas/MusicArenaResult'

    MusicArenaResult:
      type: object
      required: [id, name, model_creator, elo, ci_95]
      properties:
        id:
          type: string
        name:
          type: string
        model_creator:
          $ref: '#/components/schemas/ArenaModelCreator'
        elo:
          type: number
          description: Arena Elo rating.
        ci_95:
          type: [number, 'null']
          description: 95% confidence interval. Null if unavailable.
        samples:
          type: integer
          description: 'Pro tier only. Total number of arena samples.'
          x-tier: pro
        genres:
          type: array
          description: 'Pro tier only. Per-genre Elo breakdowns. Only present when include_genres=true.'
          x-tier: pro
          items:
            $ref: '#/components/schemas/MusicGenre'

    MusicGenre:
      type: object
      required: [label, elo, ci_95, samples]
      properties:
        label:
          type: string
          description: Genre name (e.g. "Classical", "Electronic", "Pop").
        elo:
          type: number
        ci_95:
          type: [number, 'null']
        samples:
          type: integer
