OpenAI
Configure OpenAI in AI Plate and verify a request from Node.js.
1. Configure your credentials
Create an API key in your OpenAI account. In AI Plate, open Settings → System Configuration → .env (API Keys & Secrets). Add the key locally, save, then select the provider and model in Models. Use the displayed resolved path when editing files outside the app.
OPENAI_API_KEY=YOUR_API_KEY
MODEL=YOUR_MODEL_IDdotenv2. Select the provider and model
provider:
active: "openai"
models:
openai: "YOUR_MODEL_ID"yamlReplace YOUR_MODEL_ID with a model available to your account. For OpenRouter use the complete provider/model slug. Model catalogs and tool support change; these docs do not guarantee that the app’s bundled model list remains available.
The app uses the OpenAI-compatible driver at https://api.openai.com/v1. A MODEL environment variable overrides the YAML default model. Clear it if you want YAML to control the model. Restart the app after external file edits if the selection has not refreshed.
Implementation sources
Paths in your AI Plate source checkout:
core/config.tsproviders/provider-registry.tsproviders/openai-provider.ts
3. Verify a request from Node.js
Run this separately from the desktop app. Use a new Node.js project and a local .env with the same credential plus MODEL. The request may incur provider usage charges. No credentials or live requests are required for this verification.
npm init -y
npm install openai
node --env-file=.env check-provider.mjsshellimport OpenAI from 'openai';
if (!process.env.OPENAI_API_KEY || !process.env.MODEL) {
throw new Error('Set OPENAI_API_KEY and MODEL');
}
const client = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: 'https://api.openai.com/v1',
});
const result = await client.chat.completions.create({
model: process.env.MODEL,
messages: [{ role: 'user', content: 'Reply with: connection ready' }],
});
console.log(result.choices[0]?.message?.content);javascriptThe Chat Completions example matches the protocol used by AI Plate’s current OpenAI-compatible driver.
4. Verify tools and embeddings
- Send a short message in the desktop app and confirm the selected provider/model.
- Enable Hello Tools and ask it to greet Ada. The selected model must support tool calling.
- Configure embedding.provider and embedding.model separately before using document search. A successful chat request does not verify embeddings.
- For authentication failures check the key and account access; for 429 responses inspect the provider’s quota, billing, and limits. Never include credentials in bug reports.
Implementation sources
Paths in your AI Plate source checkout:
providers/provider-factory.tscore/embedder.ts
