Not Diamond Custom Routers API

The Custom Routers API from Not Diamond — 2 operation(s) for custom routers.

Operations 2

POST /pzn/trainCustomRouter Train a custom router. #
POST /preferences/userPreferenceCreate Create a user preference. #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/notdiamond-custom-routers-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

notdiamond-custom-routers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Not Diamond Custom Routers API
  description: REST API for the Not Diamond AI model router. The modelSelect endpoint routes a prompt to the best LLM across providers based on quality, cost, and latency tradeoffs. Additional endpoints list supported models, report feedback and latency metrics to personalize routing in real time, and train custom routers from evaluation datasets.
  termsOfService: https://www.notdiamond.ai/terms
  contact:
    name: Not Diamond
    url: https://www.notdiamond.ai
  version: '2.0'
servers:
- url: https://api.notdiamond.ai/v2
security:
- bearerAuth: []
tags:
- name: Custom Routers
paths:
  /pzn/trainCustomRouter:
    post:
      operationId: trainCustomRouter
      tags:
      - Custom Routers
      summary: Train a custom router.
      description: Trains a custom router from an uploaded CSV evaluation dataset. Training is asynchronous and typically takes 5-15 minutes. Returns a preference ID used to drive personalized routing in subsequent modelSelect calls.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TrainCustomRouterRequest'
      responses:
        '200':
          description: The trained router's preference ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainCustomRouterResponse'
        '401':
          description: Missing or invalid API key.
        '422':
          description: Validation error.
  /preferences/userPreferenceCreate:
    post:
      operationId: createUserPreference
      tags:
      - Custom Routers
      summary: Create a user preference.
      description: Creates a user preference (router) and returns its preference ID, which can be referenced in modelSelect calls and custom router training.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPreferenceCreateRequest'
      responses:
        '200':
          description: The created preference ID.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserPreferenceCreateResponse'
        '401':
          description: Missing or invalid API key.
components:
  schemas:
    TrainCustomRouterResponse:
      type: object
      properties:
        preference_id:
          type: string
          description: Unique identifier for the trained router.
    UserPreferenceCreateRequest:
      type: object
      properties:
        name:
          type:
          - string
          - 'null'
          description: Optional name for the preference/router.
    UserPreferenceCreateResponse:
      type: object
      properties:
        preference_id:
          type: string
    TrainCustomRouterRequest:
      type: object
      properties:
        dataset_file:
          type: string
          format: binary
          description: CSV file with evaluation data (minimum 25 samples).
        language:
          type: string
          enum:
          - english
          - multilingual
        llm_providers:
          type: string
          description: JSON array of model providers.
        prompt_column:
          type: string
          description: CSV column name containing prompts.
        maximize:
          type: boolean
          description: Whether higher scores indicate better performance.
        preference_id:
          type:
          - string
          - 'null'
          description: Existing router ID to update.
        override:
          type:
          - boolean
          - 'null'
          default: true
          description: Override existing router.
      required:
      - dataset_file
      - language
      - llm_providers
      - prompt_column
      - maximize
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Not Diamond API key passed as a Bearer token.