Integrations

LLM Models

Connect model providers, choose the models your agents run on, tune temperature and reasoning, and understand system models and aliases.

Every agent needs a model. Models are not integrations: they are configured separately, through model providers. This page covers how a provider is connected, how a model is created from it, and which model an agent ends up using.

The four layers

LayerWhat it isAPI
Model providerA vendor entry contributed by a module: wire format, default endpoint, how to authenticate. Read-only.GET /api/model-provider-credentials/registry
ConfigurationA provider family (or a gateway endpoint), and who provides its connections: the organization or each member. Several may share a family./api/model-configs
ConnectionAn API key or a subscription for a configuration, stored encrypted. It belongs to the organization or to one member./api/model-provider-credentials
ModelA model of a configuration, with optional overrides (context window, max tokens, reasoning, cost). Served by the configuration's connections./api/models

Providers

The providers available on your instance depend on the MODULES setting (see Environment Variables). The registry endpoint always returns the exact list.

API key providers (core-providers, loaded by default)

ProviderWire format
Anthropicanthropic-messages
OpenAI, xAIopenai-responses
Mistralmistral-conversations
Cerebras, DeepSeek, Fireworks AI, Groq, Moonshot AI, OpenRouter, Together AI, Z.ai, OpenCode Goopenai-completions
OpenAI-compatible (custom endpoint)openai-completions
Anthropic-compatible (custom endpoint)anthropic-messages

The two custom endpoint providers are the escape hatch: point a model configuration at a self-hosted or third-party server (Ollama, vLLM, LiteLLM and similar) with its base_url. The API-key providers all use one of the four wire formats the platform's LLM proxy serves, so inference reaches the vendor through the same sidecar path whichever one you pick.

Google, Vertex, Azure OpenAI and AWS Bedrock are not native providers. To use a model served by one of them, put a gateway that exposes an OpenAI or Anthropic compatible API in front of it and connect that gateway through a custom endpoint provider.

Subscription providers

Two opt-in modules, @appstrate/module-claude-code and @appstrate/module-codex, let an organization, or a member for their own calls, use a Claude or ChatGPT subscription instead of an API key; an operator adds them to MODULES (see Modules). Check the provider's terms before enabling them.

Adding a provider and a model

A model belongs to a configuration: a provider family (anthropic, openai, …), or an endpoint of a custom endpoint provider. An organization may hold several of one family, for instance Sonnet in a configuration the organization provides and Opus in one each member provides. Its connections (an API key or a subscription, the organization's or a member's own) pay for the calls; a model is served by the connections of its configuration, never bound to one key.

# 1. A custom endpoint provider takes its endpoint from a configuration (the other providers
#    get their family's configuration implicitly when it is the only one, created when missing)
appstrate api POST /api/model-configs -d '{
  "providerId": "openai-compatible",
  "base_url": "https://llm.internal.example.com/v1"
}'
# -> { "id": "<configId>", ... }

# 2. Store the API key (encrypted at rest) as a connection of that configuration
appstrate api POST /api/model-provider-credentials -d '{
  "providerId": "openai-compatible",
  "api_key": "sk-...",
  "config_id": "<configId>"
}'

# 3. Create a model in the configuration
appstrate api POST /api/models -d '{
  "modelId": "<id from the provider offer>",
  "config_id": "<configId>"
}'
  • label is optional on every call. The platform derives one and avoids duplicates.
  • A configuration's endpoint changes with PATCH /api/model-configs/{id}, while it has no connection (model_config_has_connections otherwise). A connection omitting config_id joins its family's only configuration, else the only one of its side (409 model_config_ambiguous when several remain), and one is created with its side when there is none; a gateway needs one named.
  • A named provider only accepts model ids from its own offer (model_not_offered otherwise). The offer is the provider's records in the model registry bundled with your platform version, plus the newer ones the instance has read from the live model catalog. Gateways (OpenAI-compatible, Anthropic-compatible) and OpenRouter accept any id.
  • POST /api/model-provider-credentials/test and POST /api/model-provider-credentials/{id}/test check a key before or after saving. POST /api/models/{id}/test checks one model.
  • POST /api/model-provider-credentials/discover lists the models an endpoint serves (config_id or base_url in the body).
  • POST /api/models/seed creates several models from the provider's offer for one configuration in a single call; POST /api/models/apply applies a configuration's whole choice (models to add, enable, disable and the default) at once.
  • For OpenRouter, GET /api/models/openrouter?q=claude searches its catalogue. The registry marks such a provider with live_model_search: true: its models are searched live, and any model id is accepted.
  • Each model returned by GET /api/models carries pi_provider, the key of the Pi registry provider it is served through (for example moonshotai for moonshot). It is null for a gateway and for an aliased system model.
  • Per-model overrides (contextWindow, maxTokens, reasoning, input, cost) are optional. Left out, they come from the model catalogue and follow catalogue updates.
  • A default model of an organization configuration must be served by an organization connection (model_org_connection_required otherwise). A default model of a members configuration is served by each member's own connection: a member without one is asked to add it, and schedules, API keys and end users relying on the default are refused (see below).

The dashboard also seeds a provider's featured models the first time you connect it.

Where the offer comes from

A provider's offer comes from the model registry that ships with your platform version, the one the agent engine (Pi) uses. Two things change what you see in it:

  • A platform upgrade can change the offer. A model the registry no longer records can no longer be added. A model you already added on it stays in your list with the values stored, but it loses the catalog defaults (label, limits, capabilities, price) and runs unpriced unless you set a cost on it. If the operator listed such a model in SYSTEM_PROVIDER_KEYS, the platform refuses to boot until it is removed, and bun run verify:system-models run before the deploy catches it. The release notes of each version say which providers lost models.
  • A live catalog adds new models between releases. Each API process reads a signed file from get.appstrate.dev when it starts and every hour, and holds it in memory. It lists models a newer registry records and your build can already serve, so a new vendor model becomes selectable without a platform release. It only adds: it never changes a model of the bundled registry, a system model or a featured model. The read sends nothing about your instance. Until a process has read the file (just after a restart, or while the channel is unreachable), a model added from it runs without its catalog defaults. An operator turns the read off with MODEL_CATALOG_URL=off, which leaves the bundled registry alone (see Environment Variables). The design is in MODEL_CATALOG.md.

Organization connections and personal connections

A connection belongs to the organization (the default) or to one member. A personal connection is created with "owner_type": "user" on POST /api/model-provider-credentials, which takes the model-provider-credentials:connect permission, and joins a configuration like any other (config_id). It serves only its owner's own calls. Members manage theirs under Preferences.

Each configuration is provided by exactly one side: provided_by on POST and PATCH /api/model-configs, organization (the default) or members. Only the connections of that side serve its models.

  • organization: the organization's connections serve every caller. A personal connection serves nothing there: adding, testing or reconnecting one is refused with 409 model_config_provided_by_organization.
  • members: each member's own connection serves that member's calls. An organization connection serves nothing there, and adding, testing or reconnecting one is refused with 409 model_config_provided_by_members.

Within the serving side, one connection of the model's configuration serves the call. Several are tried in a fixed order: a subscription before an API key, then the oldest first. GET /api/model-provider-credentials lists them in that order, and Settings › Models numbers them. The rule is detailed in MODEL_ALIASES.md.

Suspending a connection

Whoever may edit a connection can set it aside: PATCH /api/model-provider-credentials/{id} with {"suspended": true}, or « Suspendre » in its menu. A suspended connection serves no call and the next one of its configuration does; {"suspended": false} (« Réactiver ») puts it back in its place. Its secret stays stored, a subscription keeps being refreshed, and it can still be tested. Use it when a connection has reached its quota or must be kept out of service for a while: nothing is detected or switched automatically.

When every connection of the serving side is suspended, the configuration reads suspended (org_connection / own_connection) and its models are refused like those of a configuration with no connection.

Which connection served

A run carries the name of the connection it was launched on (model_connection_label), and a chat reply shows it beside the model. Both are null or absent for a built-in or aliased model, whose backing is not shown.

Aliased models live only in organization configurations (409 model_config_provided_by_members otherwise). A model whose configuration holds no connection that can serve the caller is refused. The public LLM proxy never uses a subscription.

Calls without a member

Only a signed-in user pays from a personal connection. API keys, end-users, schedules and delegated tokens have no member to pay, so only an organization connection serves them. A schedule is paid by the organization, never by the member who created it. A members configuration refuses such a call with 409 model_credential_required ("this call has no member to pay for it"): give the schedule or the agent a model of an organization configuration. A schedule whose effective model falls back to such an organization default is refused when it is written, and fails at its fire once the default moves there.

Changing the side of a configuration

PATCH /api/model-configs/{id} refuses to change provided_by while it would leave connections serving nothing or models unservable:

  • 409 model_config_has_connections while connections of the side being left exist (the problem carries connection_count): delete them first.
  • 409 model_config_holds_aliases when switching to members while aliased models belong to the configuration (the problem carries alias_count).

Nothing else blocks a switch to members, though it takes the configuration's models away from schedules, API-key runs and agents running without a member: they fail with 409 model_credential_required from then on. A caller who can read the organization's credentials gets pinned_agent_count (agents whose switched-on space placement pins a model of the configuration) and pinned_schedule_count (enabled schedules of an agent active in their space whose effective model, the schedule's override, else the agent's space pin, else the organization default, is one; an agent switched off in a space counts for neither) on each configuration, null otherwise. The Settings › Models dialog « Changer qui fournit la connexion » shows both numbers before saving.

Subscriptions as organization connections

A subscription (Claude Pro/Max, ChatGPT plan) is accepted as an organization connection and ranks before an API key. It is then one person's vendor account spent by every member, and by schedules, API keys and end-users. Anthropic's consumer terms reserve Pro and Max credentials for individual use and forbid third parties from storing them or routing requests through them on others' behalf; the OpenAI plans have their own terms. This is a known risk the operator accepts by connecting one, not legal advice. For team or automated use, connect an API key instead. The reasoning is in SUBSCRIPTION_COMPLIANCE.md.

System models and organization models

An operator can offer models to every organization with the SYSTEM_PROVIDER_KEYS environment variable: a JSON array of provider credentials, each with the models it exposes. System models appear in GET /api/models next to the organization's own. System models cannot be added to, and no configuration of yours serves them: to add models for your organization, create your own configuration and connect it.

Model aliases

An operator can expose a system model under a vanity name (for example appstrate-medium) while the real model and endpoint stay on the server. Set "aliased": true and an explicit "label" on the entry. API callers see the alias, not the backing. This hides what the platform hands out, not what the model reveals about itself when asked. The pattern and its limits are described in MODEL_ALIASES.md.

Which model does a run use

The first match wins:

  1. The model named on the run request (modelId), or on a schedule.
  2. The model set on the agent.
  3. The organization default.
  4. The system default (the system model flagged as default).

If none is configured, the run cannot start: the launch answers 400 model_not_configured and creates no run.

A disabled model cannot be the organization default, and a model whose credential needs reconnection cannot either: PUT /api/models/default answers 409 with model_disabled or model_needs_reconnection. Disabling the current default (PATCH /api/models/{id} with enabled: false) is refused the same way (model_disabled): move or clear the default first. Two requests that would do both at once cannot both succeed, one of them gets the 409.

# Organization default (send null to clear)
appstrate api PUT /api/models/default -d '{"modelId": "<modelId>"}'

# Per-agent model
appstrate api PATCH /api/agents/@acme/triage/model -d '{"modelId": "<modelId>"}'

GET /api/agents/{scope}/{name}/model returns the current setting. Changing an agent's model needs the agents:configure permission. The modelId in these calls is the Appstrate model id, not the vendor's.

Generation settings: temperature and reasoning

Two request settings can be tuned per agent or per run, without changing the model itself:

  • Temperature, from 0 (deterministic) to 1 (more varied).
  • Reasoning level, one of off, minimal, low, medium, high, xhigh and max.

Both are optional. Left unset they inherit, and an unset reasoning level resolves to medium (or, when the model does not take medium, the nearest level it supports, looking upward first).

Where to set them

  • On an agent. Open the agent, then the Default settings tab (it needs the agents:configure permission). The Models card has the model select, a Temperature slider, a Reasoning level selector and a Save model settings button. The values apply to every run of the agent in that space.
  • For one run or one schedule. The Run with options dialog and the schedule form carry the same two controls. Empty fields inherit the agent's defaults.
  • In the chat. The chat's model picker ("Model and generation") has the same controls.
  • Through the API. generation on PATCH /api/agents/{scope}/{name}/model and on the run request, and generation_config_override on schedules, each with temperature and reasoning_level. See Agents and Runs.

The model form on the Models page of the organization settings only declares whether a model reasons, with a Reasoning checkbox among its capabilities. It has no temperature or reasoning level control.

What each model accepts

Each model declares which of these settings it supports. GET /api/models returns that as a generation object on every model, and the controls follow it:

  • The slider's first stop is Auto ("Provider default"), then 0 to 1 in steps of 0.1.
  • When a model declares a setting unsupported, its control is disabled, greyed out and badged Unsupported, with the note "The selected model declares this setting unsupported."
  • Reasoning levels the model does not confirm are disabled one by one, so you only see selectable levels. A model with no selectable level shows the whole reasoning control as unsupported.
  • Some models cannot combine a custom temperature with reasoning. For those, a temperature is not kept alongside a reasoning level other than off.
  • When you switch the model in the form, any value the new model refuses is cleared instead of being kept.

The capabilities come from the model catalogue, so they follow catalogue updates. A model the catalogue has no record of, such as a model on an OpenAI-compatible or Anthropic-compatible gateway, has unknown temperature support, so the temperature stays available. Its reasoning levels follow the Reasoning checkbox you set on the model: a model declared as reasoning takes off, low, medium and high, any other takes off only. minimal, xhigh and max stay refused on such a model, and the default level stays medium. On an OpenAI-compatible model, off sends no reasoning parameter at all, so the server keeps its own behaviour and some models still reason: the level control labels it "Not sent: the server decides" and says so in its hint. On an Anthropic-compatible model, off disables thinking.

When a setting is refused

What happens depends on where the value comes from:

  • Saving it. Storing a setting the model refuses, on an agent, a space or a schedule, answers 400 invalid_request, with param naming the field.
  • Sending it with a run request. A generation value in the request itself that the model refuses answers 400, with one of the codes temperature_unsupported, reasoning_unsupported, reasoning_level_unsupported or temperature_with_reasoning_unsupported. A value you set for one run is never silently changed.
  • A stored value the model now refuses. If the agent's defaults or a schedule's override were valid when saved but the model that runs now refuses them (you changed the default model, or the catalogue changed), the run proceeds without that setting. A scheduled fire has nobody to refuse it, so the run is not blocked.

In the last case the run's log says so. For each dropped setting the run gets one warn entry named generation_setting_dropped, with the setting, its value, the model and reason: "refused_by_model". Its message names the setting, its value and the model, and says the setting is ignored for this run. The platform's own log also records Stored generation settings refused by the model, dropped for this run. A request value that sets the same field takes precedence over the stored one, so that field is not reported as dropped.

Cost tracking

Appstrate records token usage for every inference call in a ledger and prices it from the model's rate card: the model catalogue, OpenRouter's price list for OpenRouter models, or the cost you set on the model. Prices are in US dollars per million tokens, and a run's cost is in USD, the sum of its ledger rows. The mechanics are in RUN_COST.md.

On this page