What is the safest way to test API mode without consuming translation quota? #4
-
|
I am setting up API mode for The README mentions "Get Models" and "Test API". I want to confirm the expected behavior:
I am asking because I want to validate configuration safely before using API mode on a longer translation task. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The safe path is to validate API mode with the model-list endpoint first.
In this project, the "Get Models" and "Test API" actions are designed around the OpenAI-compatible `/models` endpoint. They should verify the API key and base URL without sending a chat/completion request, so they should not consume translation quota.
You can provide defaults through environment variables:
```powershell
$env:DEEPSEEK_API_KEY="your API key"
$env:DEEPSEEK_API_BASE="https://api.deepseek.com"
$env:DEEPSEEK_MODEL="deepseek-chat"
python main.pyThe UI values can still override those defaults during normal use. API keys must not be written into history, logs, or export files. They should only be used for the request authorization header. If API mode fails because the key or base URL is missing, the task status can be recorded, but the secret value itself should not be persisted. API calls should also not run on the PySide6 main thread. Model listing, API testing, and translation requests should run through worker/background execution so the UI stays responsive. |
Beta Was this translation helpful? Give feedback.
The UI values can still override those defaults during normal use.
API keys must not be written into history, logs, or export files. They should only be used fo…