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

# Model Ranking

> How Auto ranks models for a category, cost tier, and difficulty: quality, estimated cost, the selected model, and its fallbacks. Pass `category=all` (or a comma-separated list) to rank every task in one call; the Auto panel should use that instead of 14 parallel requests.

Pass `category=all`, a comma-separated list, or repeated `category` parameters to rank several tasks in one call. One category returns a flat object (with `pick`). Two or more return `picks` and `categories`. Set `includeItems=false` to drop per-model `items`; `frontier` still adds `frontier_rank`. `pick` is null when nothing scored for that task.


## OpenAPI

````yaml GET /router/catalog/ranking
openapi: 3.0.1
info:
  title: Electron Hub API
  description: >-
    Unified API platform integrating 200+ AI models for chat, image generation,
    speech-to-text, embeddings, and more.
  version: 1.0.0
  contact:
    name: Electron Hub Support
    email: support@electronhub.ai
    url: https://discord.com/invite/electronhub
  license:
    name: MIT
servers:
  - url: https://api.electronhub.ai/v1
    description: Production API v1
security:
  - bearerAuth: []
paths:
  /router/catalog/ranking:
    get:
      tags:
        - Router
      summary: Model ranking
      description: >-
        How Auto ranks models for a category, cost tier, and difficulty:
        quality, estimated cost, the selected model, and its fallbacks. Pass
        `category=all` (or a comma-separated list) to rank every task in one
        call; the Auto panel should use that instead of 14 parallel requests.
      operationId: getRouterRanking
      parameters:
        - name: category
          in: query
          schema:
            type: string
            default: chat
          description: >-
            One of chat, coding, reasoning, math, science, creative, vision,
            long_context, agentic, factuality, safety, roleplay, summarization,
            translation; a comma-separated subset; repeated `category`
            parameters; or `all`. Case is ignored. `all` cannot be combined with
            other categories. One category returns a flat object. Two or more
            return `picks` and `categories`.
        - name: costTier
          in: query
          schema:
            type: string
            enum:
              - low
              - medium
              - high
              - xhigh
              - max
            default: medium
        - name: difficulty
          in: query
          schema:
            type: string
            enum:
              - trivial
              - easy
              - medium
              - hard
              - extreme
            default: medium
        - name: inputTokens
          in: query
          schema:
            type: integer
            minimum: 0
            default: 2000
        - name: maxOutputTokens
          in: query
          schema:
            type: integer
            minimum: 1
        - name: endpoint
          in: query
          schema:
            type: string
            enum:
              - chat
              - messages
              - responses
            default: chat
        - name: domain
          in: query
          schema:
            type: string
          description: Professional domain, e.g. legal, medical, finance.
        - name: frontier
          in: query
          schema:
            type: number
            minimum: 0
            maximum: 1
          description: >-
            When set, each category also includes `frontier_rank` (Pareto mix of
            quality vs price).
        - name: includeItems
          in: query
          schema:
            type: boolean
            default: true
          description: >-
            Set false to omit per-model `items`. `frontier` still adds
            `frontier_rank`. Leave true for the Cost vs quality chart.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
              example:
                category: coding
                costTier: medium
                difficulty: medium
                domain: null
                inputTokens: 2000
                endpoint: chat
                band: 0.07
                q_star: 83.11
                selected: gemma-4-31b-it
                cascade:
                  - deepseek-v4.1-flash
                  - qwen3.6-35b-a3b
                pick:
                  model: gemma-4-31b-it
                  label: Gemma 4 31B
                  vendor: Google
                  tier: frontier
                  quality: 85
                  rank_quality: 83.11
                  est_cost: 0.0042
                  effort: medium
                items:
                  - model: gemma-4-31b-it
                    label: Gemma 4 31B
                    vendor: Google
                    tier: frontier
                    quality: 85
                    rank_quality: 83.11
                    est_cost: 0.0042
                    effort: medium
                    eligible: true
                    price_blended: 0.5
                    speed: null
                    sources:
                      - zeroeval
                    basis: zeroeval
                sources:
                  zeroeval: true
                  artificial_analysis: true
                  epoch: true
                  eqbench: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Unknown category 'nope'. Use all, or: chat, coding,
                    reasoning, math, science, creative, vision, long_context,
                    agentic, factuality, safety, roleplay, summarization,
                    translation
                  type: router_invalid_request
                  param: category
                  code: 400
        '403':
          description: Proxy keys cannot manage Router settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Only master keys can manage Router settings.
                  type: error
                  param: null
                  code: 403
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your API key (starts with 'ek-')

````

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