---
title: "Import the credential already used by this provider's CLI on the Temps host. Discovery and encryption happen entirely server-side; the plaintext credential is never serialized into the response or browser state."
method: POST
path: "/settings/ai-providers/{provider_id}/credential/import-local"
tags: ["Agents"]
---

# Import the credential already used by this provider's CLI on the Temps host. Discovery and encryption happen entirely server-side; the plaintext credential is never serialized into the response or browser state.

`POST /settings/ai-providers/{provider_id}/credential/import-local`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/settings/ai-providers/{provider_id}/credential/import-local`
- Auth: HTTP bearer

## Path parameters

- `provider_id` string, required

## Query parameters

- `verification_model` string

## Response `200`

- ImportLocalCredentialResponse
  - `auth_type` string, required
  - `credential_verification_status` string, required
  - `provider` ProviderCatalogDto, required: One catalog entry rendered for the settings UI.
    - `auth_command` string, required
    - `auth_flavors` AuthFlavorDto[], required
      - `description` string, required
      - `env_var` string, nullable: For `api_key` format: the env var name that will be set inside the sandbox. Useful for showing the user "we'll set OPENAI_API_KEY" so they know what their key controls.
      - `format` string, required: `api_key`, `oauth_token`, or `config_file` — drives which input UI the settings page renders (single-line vs. multi-line textarea).
      - `id` string, required
      - `label` string, required
    - `credential_saved` boolean, required: True when a credential is currently saved for this provider in the settings JSON. Lets the UI render "Configured" badges without the frontend having to inspect the encrypted blob.
    - `credential_verification_status` string, required: `verified`, `unverified`, or `not_saved`; never implies model access.
    - `current_auth_type` string, nullable: Currently saved auth flavor id (when `credential_saved` is true). `None` when no credential is saved yet.
    - `default_model` string, nullable: Currently saved default model id for this provider, if one was picked. `None` means "use the CLI's own default" — the UI renders that as "Use provider default".
    - `default_permission_mode_id` string, required
    - `default_runtime_model_id` string, nullable: Explicit default used when a new harness thread is created.
    - `host_auth_hint` string, nullable: Explains why `host_authenticated` is false (not installed vs. installed-but-not-authenticated), or `None` when it's true.
    - `host_auth_method` string, nullable: Authentication mechanism reported by the CLI running in the Temps process environment (for example `chatgpt_subscription` or `host_auth_store`). Never contains credential material.
    - `host_authenticated` boolean, required: True when the CLI is installed AND authenticated on **this host** — the machine running the Temps server process. This is a completely different signal from `credential_saved`: that field is about a credential available to the server-side, turn-scoped workspace relay. Persistent workspace chat never inherits the host's ambient CLI session. A provider can show `credential_saved: true` and `host_authenticated: false` at the same time.
    - `host_version` string, nullable: Installed CLI version used as part of the model-cache identity.
    - `id` string, required
    - `install_command` string, required
    - `local_credential` LocalCredentialDto, nullable: Metadata about a credential that Temps can import from the server process user's existing CLI login. This never includes a path or credential value.
      - `auth_type` string, required
      - `label` string, required
      - `source` string, required: Stable machine-readable source: `environment` or `host_auth_store`.
    - `login_supported` boolean, required: True when this provider's CLI can sign in to a subscription from the console ("Sign in with Claude"). The UI shows the control whenever this is true, even if `login_unavailable_reason` says it cannot run yet.
    - `login_unavailable_reason` string, nullable: Why signing in cannot start right now (CLI not installed on this server, data directory unavailable) or why the provider has no console sign-in. `None` when the sign-in can be started.
    - `max_turns_analysis` integer, nullable: Default max turns for the autofixer analysis phase. `None` = built-in default (10). Only enforced for CLIs with a turn flag (Claude Code).
    - `max_turns_feedback` integer, nullable: Default max turns for autofixer feedback rounds. `None` = built-in default (10).
    - `max_turns_fix` integer, nullable: Default max turns for the autofixer fix phase. `None` = built-in default (20).
    - `model_source` 'live' | 'cache' | 'stale_cache' | 'bootstrap', required: Whether the catalog is live, cached, stale, or a bootstrap fallback.
    - `models` string[], required: Model ids this provider accepts, in display order. The first entry is the recommended default. Empty when the provider doesn't expose model selection (e.g. OpenCode), which the UI uses to hide the dropdown.
    - `models_refreshed_at` string, nullable: Time of the last successful account-aware CLI model discovery.
    - `name` string, required
    - `permission_modes` SelectOption[], required: Provider-native permission modes available to sandboxed harness turns.
      - `description` string, nullable
      - `id` string, required
      - `name` string, required
    - `runtime_models` ModelCapability[], required: Full normalized runtime capabilities used by application chat. Unlike `models`, this preserves resolved display names and reasoning choices.
      - `default_thinking_mode_id` string, nullable
      - `id` string, required
      - `name` string, required
      - `thinking_modes` SelectOption[], required
        - `description` string, nullable
        - `id` string, required
        - `name` string, required
      - `tool_thinking_modes` SelectOption[], nullable: Optional reasoning modes valid when function tools are attached. `None` inherits `thinking_modes`; `Some` is a model-specific restriction.
        - `description` string, nullable
        - `id` string, required
        - `name` string, required
    - `supports_max_turns` boolean, required: True when this provider's CLI supports enforcing a turn cap. False for Codex/OpenCode, which run to completion — the UI labels their max-turns inputs accordingly.
    - `verification_hint` string, nullable
    - `workspace_readiness_hint` string, nullable: Actionable explanation when `workspace_ready` is false.
    - `workspace_ready` boolean, required: True only when this provider can execute inside a persistent Temps workspace with a saved credential and a secure turn-scoped relay. This is the authoritative signal for workspace harness pickers.
  - `provider_id` string, required
  - `saved` boolean, required
  - `source` string, required
  - `verification_hint` string, nullable
  - `workspace_ready` boolean, required

## Other responses

- `400`: Unknown provider or invalid local credential
- `401`: Unauthorized
- `403`: System administrator permission required
- `404`: No importable local credential found

## Changes

- **2026-10-13** `22e058697ad7`: 2 info
  - added the optional property `provider/login_unavailable_reason` to the response with the `200` status
  - added the required property `provider/login_supported` to the response with the `200` status
- **2026-09-15** `c91fa4d5d612`: 4 info
  - added the new optional `query` request parameter `verification_model`
  - added the optional property `verification_hint` to the response with the `200` status
  - added the required property `credential_verification_status` to the response with the `200` status
  - added the required property `provider` to the response with the `200` status
- **2026-09-09** `961c884b4940`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/settings/ai-providers/:provider_id/credential/import-local/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
