TypeScript SDKReference

Model Types

TypeScript types for browsing models, pricing, vendor info, and model metadata.

See Models for usage.

Model

SDK representation of the Model object returned from the Models API. This TypeScript interface matches the API JSON response exactly — returned by GET /v1/models and GET /v1/models/:slug. The SDK performs no transformations.

interface Model {
  name: string;
  description: string;
  namespace: string;
  type: ModelType;
  privacy: ModelPrivacy;
  img_url: string | null;
  vendor: Vendor;
  billable: boolean;
  pricing: Pricing;
  capabilities: string[];
  metadata: ModelMetadata;
  status: string;
  service: Service;
  input_schema: ModelInputSchema | null;
  output_schema: ModelOutputSchema | null;
}
FieldTypeDescription
namestringDisplay name.
descriptionstringModel description.
namespacestringAPI slug — pass to client.run().
typeModelTypeContent type.
privacyModelPrivacy'public' or 'private'.
img_urlstring | nullModel image URL.
vendorVendorProvider info.
billablebooleanWhether predictions are billed.
pricingPricingCost info. See Pricing.
capabilitiesstring[]e.g. ['text-to-image', 'image-to-image'].
metadataModelMetadataRuntime hints.
statusstring'operational' or 'offline'.
serviceServiceInference service info.
input_schemaModelInputSchema | nullJSON Schema for inputs (when requested via fields).
output_schemaModelOutputSchema | nullJSON Schema for outputs (when requested via fields).

Vendor

interface Vendor {
  name: string;
  description: string;
  image_url: string;
  verified: boolean;
  slug: string;
  metadata: unknown;
}
FieldTypeDescription
namestringVendor name.
descriptionstringVendor description.
image_urlstringVendor logo URL.
verifiedbooleanWhether the vendor is verified.
slugstringVendor slug.
metadataunknownVendor metadata.

Pricing

interface Pricing {
  amount: number;
  currency: string;
  unit: string;
  criterias: PricingCriteria[];
  formula: PricingFormula;
}
FieldTypeDescription
amountnumberPrice per unit.
currencystringCurrency code (e.g. 'USD').
unitstringBilling unit — see PricingUnit.
criteriasPricingCriteria[]Conditional pricing rules.
formulaPricingFormulaComputed pricing formula.

PricingCriteria

interface PricingCriteria {
  field: string;
  description: string;
  operator: PricingOperator;
  value: string | boolean | number;
  billable_price: number;
  unit: string;
}
FieldTypeDescription
fieldstringInput field to evaluate.
descriptionstringHuman-readable description.
operatorPricingOperator'equals' or '=='.
valuestring | boolean | numberValue to compare.
billable_pricenumberPrice when criteria matches.
unitstringBilling unit for this criteria.

PricingFormula

interface PricingFormula {
  description: string;
  type: string;
  variables: Record<string, number>;
  terms: PricingFormulaTerm[];
  result_key: string;
}
FieldTypeDescription
descriptionstringFormula description.
typestringFormula type.
variablesRecord<string, number>Variable values.
termsPricingFormulaTerm[]Formula terms.
result_keystringResult variable name.

ModelMetadata

interface ModelMetadata {
  edge_compatible: boolean;
  openai_compatible: boolean;
  cold_boot: boolean;
  deployment_hardware: DeploymentHardware;
}
FieldTypeDescription
edge_compatiblebooleanWorks in edge runtimes.
openai_compatiblebooleanHas OpenAI-compatible interface.
cold_bootbooleanRequires cold boot.
deployment_hardwareDeploymentHardwareHardware info.

DeploymentHardware

interface DeploymentHardware {
  type: string;
  slug: string;
}
FieldTypeDescription
typestringHardware type.
slugstringHardware slug.

ModelInputSchema / ModelOutputSchema

interface ModelInputSchema {
  type: string;
  title: string;
  required: string[];
  properties: Record<string, Record<string, any>>;
}

type ModelOutputSchema = ModelInputSchema;
FieldTypeDescription
typestringJSON Schema type.
titlestringSchema title.
requiredstring[]Required fields.
propertiesRecord<string, ...>Property definitions.

ModelFieldsOptions

interface ModelFieldsOptions {
  fields: ('input_schema' | 'output_schema')[];
}
FieldTypeDescription
fields('input_schema' | 'output_schema')[]Extra fields to include.

Service

interface Service {
  type: string;
  inference_party: string;
}
FieldTypeDescription
typestringService type.
inference_partystringWhich party runs inference.

Model Enums

enum ModelType {
  IMAGE      = 'image',
  VIDEO      = 'video',
  AUDIO      = 'audio',
  MUSIC      = 'music',
  TEXT       = 'text',
  CODE       = 'code',
  MULTIMODAL = 'multimodal',
}

enum ModelPrivacy {
  PUBLIC  = 'public',
  PRIVATE = 'private',
}

enum PricingUnit {
  IMAGE             = 'image',
  VIDEO             = 'video',
  SECOND            = 'second',
  PREDICTION        = 'prediction',
  GPU               = 'gpu',
  IMAGE_MEGAPIXEL   = 'image_megapixel',
  COMPUTING_SECOND  = 'computing_second',
  AUDIO_SECOND      = 'audio_second',
  VIDEO_SECOND      = 'video_second',
  TOKEN             = 'token',
  FIVE_SECONDS      = '5 seconds',
  MINUTE            = 'minute',
}

enum PricingOperator {
  EQUALS        = 'equals',
  DOUBLE_EQUALS = '==',
}

How is this guide?

On this page