workspace

Validate BYOK LLM credentials and persist on success.

ADR-013 §5.3: instantiates a throw-away provider with the supplied credentials, issues a minimal ping (max_tokens=1), and persists the encrypted key only on success. Supports: openrouter_byok (sk-or-v1-...), polza_byok (any format), and ollama_byok (self-hosted Ollama; uses base_url field; no key persisted). Rate-limited: 5 attempts per tenant per 10 minutes. Plaintext key is NEVER logged or returned (ADR-019). Requires 'admin' scope.

post/v1/workspace/llm/test

Request

  • Base URL: https://api.andish.ru (the document declares no server; this is the origin it was published from)
  • URL: https://api.andish.ru/v1/workspace/llm/test
  • Auth: none declared

Request body

provider'openrouter_byok' | 'polza_byok' | 'ollama_byok' required

BYOK provider type. 'openrouter_byok': OpenRouter (key format sk-or-v1-...). 'polza_byok': polza.ai RU gateway (Bearer token, any format). 'ollama_byok': self-hosted Ollama (no auth; use base_url field).

api_keystring

Plaintext API key for the selected provider. Required for openrouter_byok and polza_byok. Not used for ollama_byok (pass empty string or omit). Stored AES-256-GCM encrypted on success (ADR-036). Plaintext is never logged or echoed back (ADR-019).

base_urlstring nullable

Ollama base URL for ollama_byok provider. Example: 'http://localhost:11434' or 'http://192.168.1.10:11434'. Ignored for openrouter_byok and polza_byok.

modelstring nullable

Optional model override for the validation ping. If omitted, a provider-appropriate default is used. polza.ai example: 'openai/gpt-4o-mini'. ollama_byok example: 'llama3' or 'mistral'.

Response

Validation result. See status field for outcome.

status'ok' | 'rejected' required

'ok' — provider accepted credentials and key is now stored. 'rejected' — provider rejected credentials; nothing was written.

provider'openrouter_byok' | 'polza_byok' | 'ollama_byok' required

Provider type that was tested.

reasonstring nullable

Human-readable rejection reason (masked — never echoes plaintext key). Present only when status='rejected'.

versionstring nullable

Ollama server version string (e.g. '0.5.4'). Only populated for ollama_byok when status='ok'.

warningstring nullable

Non-fatal advisory message. For ollama_byok: emitted when the base_url points to localhost but Andish is running in managed (remote) mode — in that case the endpoint won't be reachable in production.

Changes

No recorded changes to this operation across all 1 revision of this API.