Models

Connect LLM providers in Service, register workspace models, configure reasoning and context defaults, set custom token pricing, and enable media analysis.

First connect a model provider with upstream credentials, then register workspace models that agents reference by immutable key.

Add a model

In Console, open Models → Add model, pick a provider, select a catalog model (or enter an upstream ID manually), review capabilities/settings/pricing, and save.

Via API (POST /api/v1/models, requires write on the workspace and provider):

JSON
{
  "provider_id": "mprov_...",
  "key": "local-llama",
  "name": "Llama (local)",
  "config": {
    "model_name": "llama3.3",
    "model_api": "ollama.chat_completions",
    "characteristics": {"context_window_tokens": 131072},
    "settings": {"max_tokens": 4096}
  }
}
  • Query public metadata to prefill characteristics, pricing, and catalog_ref via GET /api/v1/model-catalog?provider=openai&model=gpt-5.5.
  • Update a model with PATCH /api/v1/models/{key} and If-Match (config replaces the whole object; disable with {"enabled": false}).
  • Declare native binary input support (image_understanding, video_understanding, audio_understanding, document_understanding) and optional image_input limits (shared image policy) under config.characteristics.

For voice, choose a realtime model API when registering the model, then select it as the agent’s primary model in a realtime call. Use a non-realtime model for ordinary text runs. Check realtime image support in the availability response; it comes from the realtime model profile.

Advanced request settings

Set model-wide defaults in config.settings and agent-level overrides in agent.config.model_settings (for example, openai_reasoning_effort, max_tokens, temperature, cache: "12h", openai_store: false, extra_headers, extra_body).

Precedence: Service baseline → Model config.settings → Agent model_settings (a per-run model_settings override replaces the agent's model_settings object on top of model defaults).

Service enables automatic prompt caching for supported request models by default. To set independent retention for Anthropic and OpenAI, add this to Service TOML:

TOML
[providers.auto_prompt_cache]
anthropic = "5m"
openai = "12h"

The same policy can be supplied as A13N_PROVIDERS__AUTO_PROMPT_CACHE='{"anthropic":"5m","openai":"12h"}'. The Anthropic slot covers Anthropic Messages and Anthropic upstreams on OpenRouter and Bedrock. The OpenAI slot covers Responses and Chat Completions, including Azure models using those APIs. Omitted slots inherit default (true if omitted). Use auto_prompt_cache = false under [providers] to stop adding defaults globally; explicit model and agent settings still apply. See the configuration reference for available values.

For prompt-cache routing through a compatible non-realtime gateway, set config.session_affinity_header on the model provider.

Media understanding

Configure non-realtime workspace fallback models for images, audio, or video when the active agent's primary model cannot read that modality natively (Workspace settings → Media understanding, or GET + PUT /api/v1/media-understanding-defaults with If-Match and {"image": "model-key", "video": null, "audio": null}). An agent's explicit media_understanding field overrides workspace defaults.

Usage and prices

Service attributes every call (including compaction, tool review, media understanding, and subagents) to the selected workspace model key and snapshots its saved pricing on the usage record.

Model providers

On this page