Interface ModelInterface

Model entity interface

Mirrors macs-node-sdk/lib/ai/models/model.js. Required on create: name, model, description, base_url, api_type, api_key, prices.

interface ModelInterface {
    external_id?: string;
    extensors?: { [key: string]: string };
    record_history?: RecordHistory;
    id?: string;
    org?: string;
    user?: string;
    name: string;
    model: string;
    image?: string;
    description: string;
    readme?: string;
    max_context_tokens?: number;
    max_output_tokens?: number;
    encoding?: string;
    safety_margin?: number;
    tokens_per_char_multiplier?: number;
    type?: ModelType;
    base_url: string;
    api_type: string;
    api_key: string;
    prices: { [key: string]: number };
    public?: boolean;
    active?: boolean;
    tags?: string[];
    keywords?: string[];
}

Hierarchy (View Summary)

Properties

external_id?: string

External system identifier for integration with third-party systems

extensors?: { [key: string]: string }

Extended properties for custom integrations

record_history?: RecordHistory

Record history tracking information

id?: string

Unique identifier for the entity

org?: string
user?: string
name: string

Display name (required, unique among public models)

model: string

Upstream model identifier (e.g. 'gpt-4o', 'claude-3-5-sonnet-20241022'). Required.

image?: string
description: string

One-line description (required)

readme?: string

Markdown README

max_context_tokens?: number

Max context tokens the model accepts

max_output_tokens?: number

Max output tokens the model will produce

encoding?: string

Tokenizer encoding (default 'cl100k_base')

safety_margin?: number

Fraction of max context to reserve (0–1, default 0.85)

tokens_per_char_multiplier?: number

Heuristic multiplier for estimating tokens per character (default 1.0)

type?: ModelType

Model category (default 'chat')

base_url: string

Provider API base URL — required, encrypted at rest

api_type: string

Provider protocol (e.g. 'openai', 'anthropic'). Required.

api_key: string

Provider API key — required, encrypted at rest

prices: { [key: string]: number }

Pricing map (values must be numbers). Required.

public?: boolean
active?: boolean

Whether the entity is active

tags?: string[]
keywords?: string[]