Skip to main content

Models

Endpoints for managing AI models and their configurations.

GET /api/models

List available AI models with optional filtering.

Authentication: Required (session)

Query Parameters:

ParameterTypeDefaultDescription
chatbooleanfalseFilter to chat-capable models
includeInternalbooleanfalseInclude internal/system models

Response:

{
"_links": {
"self": { "href": "/api/models" }
},
"_embedded": {
"inf:model": [
{
"id": "claude-opus-4",
"name": "Claude Opus 4",
"slug": "claude-opus-4",
"description": "Most capable model for complex tasks",
"providerId": "anthropic-123",
"model": "claude-opus-4-20250514",
"chat": true,
"web": true,
"generateImage": false,
"attachments": true,
"createEmbeddings": false,
"tier": "strategic",
"pricingTier": "Very High",
"contextWindow": 200000,
"maxOutputTokens": 16384,
"promptPpm": 15.0,
"completionPpm": 75.0,
"cacheReadPpm": 1.5,
"cacheWriteShortPpm": 18.75,
"cacheWriteLongPpm": 15.0,
"score": 95,
"moderated": false,
"internal": false,
"deprecatedAt": null,
"referencedModel": null
}
]
},
"start": 0,
"count": 1,
"total": 1
}

Model Properties:

FieldTypeDescription
idstringUnique model ID
namestringDisplay name
slugstringURL-safe identifier
descriptionstringModel description
providerIdstringProvider ID (for canonical models)
modelstringProvider's model identifier
referencesIdstringReferenced model ID (for alias models)
chatbooleanSupports chat completions
webbooleanCan access web content
generateImagebooleanCan generate images
attachmentsbooleanSupports file attachments
createEmbeddingsbooleanCan create embeddings
tierstringBudget tier: everyday, advanced, strategic
pricingTierstringCost category: Low, Medium, High, Very High
contextWindowintegerMaximum context tokens
maxOutputTokensintegerMaximum output tokens
promptPpmnumberCost per million prompt tokens
completionPpmnumberCost per million completion tokens
cacheReadPpmnumberCost per million cached read tokens
cacheWriteShortPpmnumberCost per million short-term cache writes
cacheWriteLongPpmnumberCost per million long-term cache writes
scoreintegerQuality/capability score (0-100)
moderatedbooleanContent moderation enabled
internalbooleanSystem-only model
deprecatedAtdateDeprecation date (null if active)

Alias Models:

Models can reference other models via referencesId. Alias models:

  • Inherit capabilities from referenced model
  • Can override name, slug, and instructions
  • Automatically adopt tier from base model if not specified
  • Share provider with referenced model (set via trigger)

POST /api/models

Create a new AI model (canonical or alias).

Authentication: permission.ai.manage

Pre-blocks:

  • permission.ai.manage
  • Provider lookup (for canonical models)
  • Referenced model lookup (for alias models)

Request Body (Canonical Model):

FieldTypeRequiredDescription
providerIdstringYesProvider ID
modelstringYesProvider's model identifier
namestringYesDisplay name
slugstringNoURL-safe ID (defaults to model)
descriptionstringNoModel description
chatbooleanNoSupports chat
webbooleanNoWeb access capability
generateImagebooleanNoImage generation
attachmentsbooleanNoFile attachment support
createEmbeddingsbooleanNoEmbedding generation
tierstringNoeveryday, advanced, strategic
pricingTierstringNoLow, Medium, High, Very High
contextWindowintegerNoMax context tokens
maxOutputTokensintegerNoMax output tokens
promptPpmnumberNoPrompt cost per million tokens
completionPpmnumberNoCompletion cost per million tokens
cacheReadPpmnumberNoCache read cost per million
cacheWriteShortPpmnumberNoShort cache write cost
cacheWriteLongPpmnumberNoLong cache write cost
scoreintegerNoQuality score (0-100)
moderatedbooleanNoContent moderation
instructionsstringNoSystem instructions
optionsobjectNoProvider-specific options
deprecatedAtdateNoDeprecation date

Request Body (Alias Model):

FieldTypeRequiredDescription
referencesIdstringYesBase model ID to reference
namestringYesDisplay name for alias
slugstringYesURL-safe identifier
instructionsstringNoOverride instructions
optionsobjectNoOverride options

Example (Canonical):

{
"providerId": "anthropic-123",
"model": "claude-3-5-sonnet-20241022",
"name": "Claude 3.5 Sonnet",
"slug": "claude-3-5-sonnet",
"chat": true,
"tier": "advanced",
"contextWindow": 200000,
"promptPpm": 3.0,
"completionPpm": 15.0
}

Example (Alias):

{
"referencesId": "claude-opus-4",
"name": "Strategic Assistant",
"slug": "strategic-assistant",
"instructions": "Focus on strategic analysis"
}

Response:

Returns the created model object.


GET /api/models/{id}

Retrieve a single model with full details.

Authentication: Required (session)

Pre-blocks: model.lookup

Response:

Model object with all properties and referenced model (if alias).


PUT /api/models/{id}

Update a model's configuration.

Authentication: permission.ai.manage

Pre-blocks:

  • model.lookup
  • permission.ai.manage

Request Body:

Same fields as POST, except providerId, model, and referencesId cannot be changed.

Managed Model Restrictions:

Internal and managed models have restrictions:

  • Cannot change providerId or model
  • Can update options and pricing for key-only updates
  • Cannot delete

Response:

Returns the updated model object.


DELETE /api/models/{id}

Delete a model.

Authentication: permission.ai.manage

Pre-blocks:

  • model.lookup
  • permission.ai.manage

Response:

204 No Content

Restrictions:

  • Cannot delete managed models
  • Cannot delete models currently in use by chats
  • Deleting a model may orphan alias models

POST /api/models/{id}/_chat

Send a chat message directly to a model (bypasses chat history).

Authentication: Required (session with AI seat)

Pre-blocks:

  • Model resolution
  • Tier-based budget enforcement

Request Body:

FieldTypeRequiredDescription
messagesarrayYesArray of message objects
systemstringNoSystem prompt
toolsarrayNoAvailable tools
assistantIdsarrayNoAssistants to load
datasetIdsarrayNoDatasets to include
libraryIdsarrayNoLibraries to include
toolkitIdsarrayNoToolkits to enable

Payload Limit: 200MB

Example Request:

{
"messages": [
{
"role": "user",
"content": "Analyze this data..."
}
],
"system": "You are a data analyst",
"assistantIds": ["asst-123"],
"datasetIds": ["ds-456"]
}

Response:

Server-Sent Events (SSE) stream with chat completion.

Use Cases:

  • One-off model queries without creating a chat
  • Model testing and evaluation
  • Skill-specific interactions
  • Temporary analysis workflows

POST /api/models/{id}/_completion

Generate a text completion using a model.

Authentication: Required (session with AI seat)

Pre-blocks:

  • Model resolution
  • Tier-based budget enforcement

Request Body:

FieldTypeRequiredDescription
promptstringYesCompletion prompt
messagesarrayNoOptional message context
maxTokensintegerNoMax tokens to generate
temperaturenumberNoSampling temperature (0-1)
stopSequencesarrayNoStop generation on these strings

Payload Limit: 200MB

Example Request:

{
"prompt": "Complete this sentence: The future of AI is",
"maxTokens": 100,
"temperature": 0.7
}

Response:

Server-Sent Events (SSE) stream with completion text.


POST /api/models/{id}/_object

Generate a structured object from a model using JSON Schema.

Authentication: Required (session with AI seat)

Pre-blocks:

  • Model resolution
  • Tier-based budget enforcement

Request Body:

FieldTypeRequiredDescription
schemaobjectYesJSON Schema for output structure
messagesarrayYesPrompt messages
systemstringNoSystem prompt

Example Request:

{
"schema": {
"type": "object",
"properties": {
"sentiment": { "type": "string", "enum": ["positive", "negative", "neutral"] },
"confidence": { "type": "number", "minimum": 0, "maximum": 1 },
"keywords": { "type": "array", "items": { "type": "string" } }
},
"required": ["sentiment", "confidence"]
},
"messages": [
{
"role": "user",
"content": "Analyze the sentiment: 'This product is amazing!'"
}
]
}

Response:

{
"sentiment": "positive",
"confidence": 0.95,
"keywords": ["amazing", "product"]
}

Validation:

  • Output is validated against provided schema
  • Invalid responses trigger retry (up to 3 attempts)
  • Schema must be valid JSON Schema draft 2020-12

Use Cases:

  • Extract structured data from text
  • Classification tasks
  • Sentiment analysis
  • Entity extraction
  • Data normalization
Model Selection

Use advanced or strategic tier models for complex schema generation. Everyday models may struggle with intricate structures.