Models and authentication

Configure API keys and OAuth subscriptions (Codex, ChatGPT, Grok, GitHub Copilot), set reasoning effort, and manage context windows in Harness UI.

A Model is a reusable provider connection with request settings (models/*.yaml). An Agent selects a Model by ID and adds instructions and tools. Credentials are stored separately from YAML.

Create and manage Models

Add a new Model in Settings → Models (WebUI) or via CLI:

Terminal
a13n-harness-ui add model
  1. Choose an API provider/protocol or a subscription (ChatGPT, Codex, Grok, or GitHub Copilot).
  2. Connect credentials: pick a saved key, enter a new key, reference an environment variable, or choose a subscription account group.
  3. Select a suggested model or enter a provider model ID, review defaults (reasoning, speed tier, context budget), and save.
  4. Select the Model in a conversation (/model in TUI or the composer footer in WebUI) and send a short prompt to verify connectivity.

In the TUI:

CommandEffect
/agent or /agent agent-primarySelect the full Agent configuration
/model or /model model-primaryOverride the Model and remember it for this Project
/model defaultClear the Model override and remembered Project choice
/thinking / /thinking defaultInspect or reset reasoning effort for the next Run
/statusCheck active Agent, Model, and usage

Codex Model example

  1. Sign in with a13n-harness-ui login codex.
  2. Save models/codex.yaml beside your root config (a13n-harness-ui config path):
models/codex.yaml
schema_version: "1"
kind: model
id: model-codex
name: Codex
route: openai-codex:gpt-6.2-sol
authentication:
  kind: codex_subscription
settings:
  openai_reasoning_effort: high
  openai_reasoning_summary: detailed
  openai_store: false
model_characteristics:
  context_window_tokens: 350000
  proactive_context_management_threshold: 0.65
  compact_threshold: 0.90
  1. Run a13n-harness-ui config validate, then select /model model-codex and test a prompt.

Model file reference

Every Model file requires schema_version: "1", kind: model, a unique model- ID, and name:

FieldDefaultPurpose
routeRequiredProvider and model ID (e.g., openai-responses:gpt-5)
authenticationRequiredCredential source matching the route
settings{}Request parameters (reasoning, max_tokens, temperature, etc.)
model_configuration{}Connection wiring (base_url, session_affinity_header)
model_characteristicsnullLocal context budget, compaction thresholds, and media policy

API-key authentication takes either an environment variable or a saved key (a13n-harness-ui auth key set key-primary):

YAML
authentication:
  kind: api_key
  env: OPENAI_API_KEY # or credential_ref: key-primary

Subscription authentication uses chatgpt_subscription, codex_subscription, grok_subscription, or copilot_subscription (with optional group for Codex/Grok).

Context and modality policy

Configure local budgets and media capabilities under model_characteristics:

FieldDefaultMeaning
context_window_tokensnullLocal working context budget
proactive_context_management_threshold0.65Fraction at which context reminders trigger
compact_threshold0.90Fraction at which compaction triggers
capabilities[]Binary input types: image_understanding, audio_understanding, video_understanding, document_understanding
image_inputdefaultsImage limits (max_images, image_retention_ratio, max_image_bytes, support_gif); null disables
video_input.max_video_bytes10485760Base64-encoded video budget per video and per request

Native request settings and connection wiring

Use settings for provider parameters (max_tokens, temperature, thinking, openai_reasoning_effort, anthropic_thinking, google_thinking_config, service_tier, openai_transport: websocket|http, extra_headers, extra_body).

Use model_configuration.base_url for custom HTTP/API-key endpoints or gateways (for example, route: google-cloud:<model-id> with base_url: https://gateway.example.com). Subscription routes and native xai: gRPC do not accept custom base_url.

Subscription login and API keys

ProviderLogin commandNotes
API keysa13n-harness-ui auth key set <key-id>Stored in the local key store; referenced by credential_ref
Codex / Groka13n-harness-ui login codex / grokBrowser OAuth; supports named account groups
ChatGPTa13n-harness-ui login chatgptOAuth callback-URL paste flow
GitHub Copilota13n-harness-ui login copilotDevice authorization flow using the public Copilot App ID

GitHub Copilot subscription

Run a13n-harness-ui login copilot, open the printed GitHub verification URL, and enter the device code. No custom OAuth App registration is required. Use route: github-copilot:<model-id> with authentication: {kind: copilot_subscription}.

Account store locations

Credentials and subscription groups (subscription_groups/*.yaml) live under your Harness UI state directory (~/.a13n-harness-ui/ by default) with owner-only file permissions. Never put raw API keys or OAuth tokens into YAML files.

Media understanding defaults

When an active Model cannot read images, audio, or video natively, configure fallback Model IDs in Settings → Models (or /model defaults in TUI) under media_understanding.image, .audio, and .video in a13n-harness-ui.yaml.

On this page