Loading...
const client = createClient({
apiKey: 'abc123-test-key',
});const client = createClient({
apiKey: process.env.API_KEY,
});A completion that fills in a sample key gets committed easily, so the key should come from the environment.
Completion suggests the next lines while you type, and you accept each one. A coding agent takes a whole task, edits many files and runs commands.
Usually yes, the surrounding code is sent to the model as context. Check the tool's settings and exclude files with secrets or private data.
The model predicts likely code, not code verified against your dependencies. A type checker and tests catch invented APIs.